api

package
v0.1.0-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 7, 2022 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package api provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen version v1.12.2 DO NOT EDIT.

Package api has helper functions to manipulate operations linked to the api specification.

Most of the functions are generated from the OpenAPI specfication with oapi-codegen.

The package also exports:

* helpers to perform conversions between Driver/PassengerCarpoolBooking and Booking types. * umbrella type `Journeys` to manipulate driverJourneys and passengerJourneys alike

Index

Constants

This section is empty.

Variables

View Source
var (
	ExampleOperator    = "example.com"
	ExampleJourneyType = DYNAMIC
)

Functions

func GetJourneys

func GetJourneys(s ServerInterface, ctx echo.Context, params GetJourneysParams) error

func NewGetBookingsRequest

func NewGetBookingsRequest(server string, bookingId BookingId) (*http.Request, error)

NewGetBookingsRequest generates requests for GetBookings

func NewGetDriverJourneysRequest

func NewGetDriverJourneysRequest(server string, params *GetDriverJourneysParams) (*http.Request, error)

NewGetDriverJourneysRequest generates requests for GetDriverJourneys

func NewGetDriverRegularTripsRequest

func NewGetDriverRegularTripsRequest(server string, params *GetDriverRegularTripsParams) (*http.Request, error)

NewGetDriverRegularTripsRequest generates requests for GetDriverRegularTrips

func NewGetPassengerJourneysRequest

func NewGetPassengerJourneysRequest(server string, params *GetPassengerJourneysParams) (*http.Request, error)

NewGetPassengerJourneysRequest generates requests for GetPassengerJourneys

func NewGetPassengerRegularTripsRequest

func NewGetPassengerRegularTripsRequest(server string, params *GetPassengerRegularTripsParams) (*http.Request, error)

NewGetPassengerRegularTripsRequest generates requests for GetPassengerRegularTrips

func NewGetStatusRequest

func NewGetStatusRequest(server string) (*http.Request, error)

NewGetStatusRequest generates requests for GetStatus

func NewPatchBookingsRequest

func NewPatchBookingsRequest(server string, bookingId BookingId, params *PatchBookingsParams) (*http.Request, error)

NewPatchBookingsRequest generates requests for PatchBookings

func NewPostBookingEventsRequest

func NewPostBookingEventsRequest(server string, body PostBookingEventsJSONRequestBody) (*http.Request, error)

NewPostBookingEventsRequest calls the generic PostBookingEvents builder with application/json body

func NewPostBookingEventsRequestWithBody

func NewPostBookingEventsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewPostBookingEventsRequestWithBody generates requests for PostBookingEvents with any type of body

func NewPostBookingsRequest

func NewPostBookingsRequest(server string, body PostBookingsJSONRequestBody) (*http.Request, error)

NewPostBookingsRequest calls the generic PostBookings builder with application/json body

func NewPostBookingsRequestWithBody

func NewPostBookingsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewPostBookingsRequestWithBody generates requests for PostBookings with any type of body

func NewPostMessagesRequest

func NewPostMessagesRequest(server string, body PostMessagesJSONRequestBody) (*http.Request, error)

NewPostMessagesRequest calls the generic PostMessages builder with application/json body

func NewPostMessagesRequestWithBody

func NewPostMessagesRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewPostMessagesRequestWithBody generates requests for PostMessages with any type of body

func RegisterHandlers

func RegisterHandlers(router EchoRouter, si ServerInterface)

RegisterHandlers adds each server route to the EchoRouter.

func RegisterHandlersWithBaseURL

func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)

Registers handlers, and prepends BaseURL to the paths, so that the paths can be served under a prefix.

Types

type ArrivalLat

type ArrivalLat = float32

ArrivalLat defines model for arrivalLat.

type ArrivalLng

type ArrivalLng = float32

ArrivalLng defines model for arrivalLng.

type ArrivalRadius

type ArrivalRadius = float32

ArrivalRadius defines model for arrivalRadius.

type BadRequest

type BadRequest struct {
	// Error Explain why the request couldn't be processed.
	Error *string `json:"error,omitempty"`
}

BadRequest defines model for BadRequest.

type Booking

type Booking struct {
	Car *Car `json:"car,omitempty"`

	// Distance Carpooling distance in meters.
	Distance *int `json:"distance,omitempty"`
	Driver   User `json:"driver"`

	// DriverJourneyId ID of the Driver's journey to which the booking is related (if any). Unique given the `User`'s `operator` property.
	DriverJourneyId *string `json:"driverJourneyId,omitempty"`

	// Duration Carpooling duration in seconds.
	Duration *int `json:"duration,omitempty"`

	// Id Booking id is common between both operators, and must be created as a [UUID](https://datatracker.ietf.org/doc/html/rfc4122) by whoever initiates the booking.  Usage of a [4 UUID](https://datatracker.ietf.org/doc/html/rfc4122#section-4.4) generation algorithm is advised.
	Id        BookingId `json:"id"`
	Passenger User      `json:"passenger"`

	// PassengerDropAddress String representing the drop-off address.
	PassengerDropAddress *string `json:"passengerDropAddress,omitempty"`

	// PassengerDropLat Latitude of the passenger drop-off point.
	PassengerDropLat float64 `json:"passengerDropLat"`

	// PassengerDropLng Longitude of the passenger drop-off point.
	PassengerDropLng float64 `json:"passengerDropLng"`

	// PassengerJourneyId ID of the Passenger's journey to which the booking is related (if any). Unique given the `User`'s `operator` property.
	PassengerJourneyId *string `json:"passengerJourneyId,omitempty"`

	// PassengerPickupAddress String representing the pickup-up address.
	PassengerPickupAddress *string `json:"passengerPickupAddress,omitempty"`

	// PassengerPickupDate Passenger pickup datetime as a UNIX UTC timestamp in seconds.
	PassengerPickupDate int64 `json:"passengerPickupDate"`

	// PassengerPickupLat Latitude of the passenger pick-up point.
	PassengerPickupLat float64 `json:"passengerPickupLat"`

	// PassengerPickupLng Longitude of the passenger pick-up point.
	PassengerPickupLng float64 `json:"passengerPickupLng"`
	Price              Price   `json:"price"`

	// Status Status of the booking.
	Status BookingStatus `json:"status"`

	// WebUrl URL of the booking on the webservice provider platform.
	WebUrl *string `json:"webUrl,omitempty"`
}

Booking defines model for Booking.

func (Booking) ToDriverCarpoolBooking

func (b Booking) ToDriverCarpoolBooking() *DriverCarpoolBooking

ToDriverCarpoolBooking performs a lossy conversion from Booking to DriverCarpoolBooking objects

func (Booking) ToPassengerCarpoolBooking

func (b Booking) ToPassengerCarpoolBooking() *PassengerCarpoolBooking

ToPassengerCarpoolBooking performs a lossy conversion from Booking to PassengerCarpoolBooking objects

type BookingId

type BookingId = openapi_types.UUID

BookingId Booking id is common between both operators, and must be created as a [UUID](https://datatracker.ietf.org/doc/html/rfc4122) by whoever initiates the booking. Usage of a [4 UUID](https://datatracker.ietf.org/doc/html/rfc4122#section-4.4) generation algorithm is advised.

type BookingStatus

type BookingStatus string

BookingStatus Status of the booking.

const (
	BookingStatusCANCELLED                  BookingStatus = "CANCELLED"
	BookingStatusCOMPLETEDPENDINGVALIDATION BookingStatus = "COMPLETED_PENDING_VALIDATION"
	BookingStatusCONFIRMED                  BookingStatus = "CONFIRMED"
	BookingStatusVALIDATED                  BookingStatus = "VALIDATED"
	BookingStatusWAITINGCONFIRMATION        BookingStatus = "WAITING_CONFIRMATION"
)

Defines values for BookingStatus.

type Car

type Car struct {
	// Brand Brand of the car.
	Brand *string `json:"brand,omitempty"`

	// Model Model of the car.
	Model *string `json:"model,omitempty"`
}

Car defines model for Car.

type CarpoolBooking

type CarpoolBooking struct {
	// Distance Carpooling distance in meters. When the booking is COMPLETED or VALIDATED, this is the actual distance travelled if available.
	Distance *int `json:"distance,omitempty"`

	// Duration Carpooling duration in seconds.
	Duration *int `json:"duration,omitempty"`

	// Id Unique identifier of the booking.
	Id openapi_types.UUID `json:"id"`

	// PassengerDropAddress String representing the drop-off address.
	PassengerDropAddress *string `json:"passengerDropAddress,omitempty"`

	// PassengerDropLat Latitude of the passenger drop-off point.
	PassengerDropLat float64 `json:"passengerDropLat"`

	// PassengerDropLng Longitude of the passenger drop-off point.
	PassengerDropLng float64 `json:"passengerDropLng"`

	// PassengerPickupAddress String representing the pickup-up address.
	PassengerPickupAddress *string `json:"passengerPickupAddress,omitempty"`

	// PassengerPickupDate Passenger pickup datetime as a UNIX UTC timestamp in seconds.
	PassengerPickupDate int64 `json:"passengerPickupDate"`

	// PassengerPickupLat Latitude of the passenger pick-up point.
	PassengerPickupLat float64 `json:"passengerPickupLat"`

	// PassengerPickupLng Longitude of the passenger pick-up point.
	PassengerPickupLng float64              `json:"passengerPickupLng"`
	Status             CarpoolBookingStatus `json:"status"`

	// WebUrl URL of the booking on the webservice provider platform.
	WebUrl string `json:"webUrl"`
}

CarpoolBooking defines model for CarpoolBooking.

type CarpoolBookingEvent

type CarpoolBookingEvent struct {
	Data CarpoolBookingEvent_Data `json:"data"`

	// Id Unique journey's id in the format of an [UUID](https://datatracker.ietf.org/doc/html/rfc4122). Usage of a [4 UUID](https://datatracker.ietf.org/doc/html/rfc4122#section-4.4) generation algorithm is advised.
	Id openapi_types.UUID `json:"id"`

	// IdToken ID token of the user retrieved using the OpenID Connect flows.
	IdToken string `json:"idToken"`
}

CarpoolBookingEvent defines model for CarpoolBookingEvent.

type CarpoolBookingEvent_Data

type CarpoolBookingEvent_Data struct {
	// contains filtered or unexported fields
}

CarpoolBookingEvent_Data defines model for CarpoolBookingEvent.Data.

func (CarpoolBookingEvent_Data) AsDriverCarpoolBooking

func (t CarpoolBookingEvent_Data) AsDriverCarpoolBooking() (DriverCarpoolBooking, error)

AsDriverCarpoolBooking returns the union data inside the CarpoolBookingEvent_Data as a DriverCarpoolBooking

func (CarpoolBookingEvent_Data) AsPassengerCarpoolBooking

func (t CarpoolBookingEvent_Data) AsPassengerCarpoolBooking() (PassengerCarpoolBooking, error)

AsPassengerCarpoolBooking returns the union data inside the CarpoolBookingEvent_Data as a PassengerCarpoolBooking

func (*CarpoolBookingEvent_Data) FromDriverCarpoolBooking

func (t *CarpoolBookingEvent_Data) FromDriverCarpoolBooking(v DriverCarpoolBooking) error

FromDriverCarpoolBooking overwrites any union data inside the CarpoolBookingEvent_Data as the provided DriverCarpoolBooking

func (*CarpoolBookingEvent_Data) FromPassengerCarpoolBooking

func (t *CarpoolBookingEvent_Data) FromPassengerCarpoolBooking(v PassengerCarpoolBooking) error

FromPassengerCarpoolBooking overwrites any union data inside the CarpoolBookingEvent_Data as the provided PassengerCarpoolBooking

func (CarpoolBookingEvent_Data) MarshalJSON

func (t CarpoolBookingEvent_Data) MarshalJSON() ([]byte, error)

func (*CarpoolBookingEvent_Data) MergeDriverCarpoolBooking

func (t *CarpoolBookingEvent_Data) MergeDriverCarpoolBooking(v DriverCarpoolBooking) error

MergeDriverCarpoolBooking performs a merge with any union data inside the CarpoolBookingEvent_Data, using the provided DriverCarpoolBooking

func (*CarpoolBookingEvent_Data) MergePassengerCarpoolBooking

func (t *CarpoolBookingEvent_Data) MergePassengerCarpoolBooking(v PassengerCarpoolBooking) error

MergePassengerCarpoolBooking performs a merge with any union data inside the CarpoolBookingEvent_Data, using the provided PassengerCarpoolBooking

func (*CarpoolBookingEvent_Data) UnmarshalJSON

func (t *CarpoolBookingEvent_Data) UnmarshalJSON(b []byte) error

type CarpoolBookingStatus

type CarpoolBookingStatus string

CarpoolBookingStatus defines model for CarpoolBooking.Status.

const (
	CarpoolBookingStatusCANCELLED                  CarpoolBookingStatus = "CANCELLED"
	CarpoolBookingStatusCOMPLETEDPENDINGVALIDATION CarpoolBookingStatus = "COMPLETED_PENDING_VALIDATION"
	CarpoolBookingStatusCONFIRMED                  CarpoolBookingStatus = "CONFIRMED"
	CarpoolBookingStatusVALIDATED                  CarpoolBookingStatus = "VALIDATED"
	CarpoolBookingStatusWAITINGCONFIRMATION        CarpoolBookingStatus = "WAITING_CONFIRMATION"
)

Defines values for CarpoolBookingStatus.

type Client

type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example. This can contain a path relative
	// to the server, such as https://api.deepmap.com/dev-test, and all the
	// paths in the swagger spec will be appended to the server.
	Server string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client HttpRequestDoer

	// A list of callbacks for modifying requests which are generated before sending over
	// the network.
	RequestEditors []RequestEditorFn
}

Client which conforms to the OpenAPI3 specification for this service.

func NewClient

func NewClient(server string, opts ...ClientOption) (*Client, error)

Creates a new Client, with reasonable defaults

func (*Client) GetBookings

func (c *Client) GetBookings(ctx context.Context, bookingId BookingId, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetDriverJourneys

func (c *Client) GetDriverJourneys(ctx context.Context, params *GetDriverJourneysParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetDriverRegularTrips

func (c *Client) GetDriverRegularTrips(ctx context.Context, params *GetDriverRegularTripsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetPassengerJourneys

func (c *Client) GetPassengerJourneys(ctx context.Context, params *GetPassengerJourneysParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetPassengerRegularTrips

func (c *Client) GetPassengerRegularTrips(ctx context.Context, params *GetPassengerRegularTripsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetStatus

func (c *Client) GetStatus(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PatchBookings

func (c *Client) PatchBookings(ctx context.Context, bookingId BookingId, params *PatchBookingsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PostBookingEvents

func (c *Client) PostBookingEvents(ctx context.Context, body PostBookingEventsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PostBookingEventsWithBody

func (c *Client) PostBookingEventsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PostBookings

func (c *Client) PostBookings(ctx context.Context, body PostBookingsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PostBookingsWithBody

func (c *Client) PostBookingsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PostMessages

func (c *Client) PostMessages(ctx context.Context, body PostMessagesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PostMessagesWithBody

func (c *Client) PostMessagesWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

type ClientInterface

type ClientInterface interface {
	// PostBookingEvents request with any body
	PostBookingEventsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	PostBookingEvents(ctx context.Context, body PostBookingEventsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PostBookings request with any body
	PostBookingsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	PostBookings(ctx context.Context, body PostBookingsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetBookings request
	GetBookings(ctx context.Context, bookingId BookingId, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PatchBookings request
	PatchBookings(ctx context.Context, bookingId BookingId, params *PatchBookingsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetDriverJourneys request
	GetDriverJourneys(ctx context.Context, params *GetDriverJourneysParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetDriverRegularTrips request
	GetDriverRegularTrips(ctx context.Context, params *GetDriverRegularTripsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PostMessages request with any body
	PostMessagesWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	PostMessages(ctx context.Context, body PostMessagesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetPassengerJourneys request
	GetPassengerJourneys(ctx context.Context, params *GetPassengerJourneysParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetPassengerRegularTrips request
	GetPassengerRegularTrips(ctx context.Context, params *GetPassengerRegularTripsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetStatus request
	GetStatus(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

func WithHTTPClient

func WithHTTPClient(doer HttpRequestDoer) ClientOption

WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.

func WithRequestEditorFn

func WithRequestEditorFn(fn RequestEditorFn) ClientOption

WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.

type ClientWithResponses

type ClientWithResponses struct {
	ClientInterface
}

ClientWithResponses builds on ClientInterface to offer response payloads

func NewClientWithResponses

func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)

NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) GetBookingsWithResponse

func (c *ClientWithResponses) GetBookingsWithResponse(ctx context.Context, bookingId BookingId, reqEditors ...RequestEditorFn) (*GetBookingsResponse, error)

GetBookingsWithResponse request returning *GetBookingsResponse

func (*ClientWithResponses) GetDriverJourneysWithResponse

func (c *ClientWithResponses) GetDriverJourneysWithResponse(ctx context.Context, params *GetDriverJourneysParams, reqEditors ...RequestEditorFn) (*GetDriverJourneysResponse, error)

GetDriverJourneysWithResponse request returning *GetDriverJourneysResponse

func (*ClientWithResponses) GetDriverRegularTripsWithResponse

func (c *ClientWithResponses) GetDriverRegularTripsWithResponse(ctx context.Context, params *GetDriverRegularTripsParams, reqEditors ...RequestEditorFn) (*GetDriverRegularTripsResponse, error)

GetDriverRegularTripsWithResponse request returning *GetDriverRegularTripsResponse

func (*ClientWithResponses) GetPassengerJourneysWithResponse

func (c *ClientWithResponses) GetPassengerJourneysWithResponse(ctx context.Context, params *GetPassengerJourneysParams, reqEditors ...RequestEditorFn) (*GetPassengerJourneysResponse, error)

GetPassengerJourneysWithResponse request returning *GetPassengerJourneysResponse

func (*ClientWithResponses) GetPassengerRegularTripsWithResponse

func (c *ClientWithResponses) GetPassengerRegularTripsWithResponse(ctx context.Context, params *GetPassengerRegularTripsParams, reqEditors ...RequestEditorFn) (*GetPassengerRegularTripsResponse, error)

GetPassengerRegularTripsWithResponse request returning *GetPassengerRegularTripsResponse

func (*ClientWithResponses) GetStatusWithResponse

func (c *ClientWithResponses) GetStatusWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetStatusResponse, error)

GetStatusWithResponse request returning *GetStatusResponse

func (*ClientWithResponses) PatchBookingsWithResponse

func (c *ClientWithResponses) PatchBookingsWithResponse(ctx context.Context, bookingId BookingId, params *PatchBookingsParams, reqEditors ...RequestEditorFn) (*PatchBookingsResponse, error)

PatchBookingsWithResponse request returning *PatchBookingsResponse

func (*ClientWithResponses) PostBookingEventsWithBodyWithResponse

func (c *ClientWithResponses) PostBookingEventsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostBookingEventsResponse, error)

PostBookingEventsWithBodyWithResponse request with arbitrary body returning *PostBookingEventsResponse

func (*ClientWithResponses) PostBookingEventsWithResponse

func (c *ClientWithResponses) PostBookingEventsWithResponse(ctx context.Context, body PostBookingEventsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostBookingEventsResponse, error)

func (*ClientWithResponses) PostBookingsWithBodyWithResponse

func (c *ClientWithResponses) PostBookingsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostBookingsResponse, error)

PostBookingsWithBodyWithResponse request with arbitrary body returning *PostBookingsResponse

func (*ClientWithResponses) PostBookingsWithResponse

func (c *ClientWithResponses) PostBookingsWithResponse(ctx context.Context, body PostBookingsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostBookingsResponse, error)

func (*ClientWithResponses) PostMessagesWithBodyWithResponse

func (c *ClientWithResponses) PostMessagesWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostMessagesResponse, error)

PostMessagesWithBodyWithResponse request with arbitrary body returning *PostMessagesResponse

func (*ClientWithResponses) PostMessagesWithResponse

func (c *ClientWithResponses) PostMessagesWithResponse(ctx context.Context, body PostMessagesJSONRequestBody, reqEditors ...RequestEditorFn) (*PostMessagesResponse, error)

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// PostBookingEvents request with any body
	PostBookingEventsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostBookingEventsResponse, error)

	PostBookingEventsWithResponse(ctx context.Context, body PostBookingEventsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostBookingEventsResponse, error)

	// PostBookings request with any body
	PostBookingsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostBookingsResponse, error)

	PostBookingsWithResponse(ctx context.Context, body PostBookingsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostBookingsResponse, error)

	// GetBookings request
	GetBookingsWithResponse(ctx context.Context, bookingId BookingId, reqEditors ...RequestEditorFn) (*GetBookingsResponse, error)

	// PatchBookings request
	PatchBookingsWithResponse(ctx context.Context, bookingId BookingId, params *PatchBookingsParams, reqEditors ...RequestEditorFn) (*PatchBookingsResponse, error)

	// GetDriverJourneys request
	GetDriverJourneysWithResponse(ctx context.Context, params *GetDriverJourneysParams, reqEditors ...RequestEditorFn) (*GetDriverJourneysResponse, error)

	// GetDriverRegularTrips request
	GetDriverRegularTripsWithResponse(ctx context.Context, params *GetDriverRegularTripsParams, reqEditors ...RequestEditorFn) (*GetDriverRegularTripsResponse, error)

	// PostMessages request with any body
	PostMessagesWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostMessagesResponse, error)

	PostMessagesWithResponse(ctx context.Context, body PostMessagesJSONRequestBody, reqEditors ...RequestEditorFn) (*PostMessagesResponse, error)

	// GetPassengerJourneys request
	GetPassengerJourneysWithResponse(ctx context.Context, params *GetPassengerJourneysParams, reqEditors ...RequestEditorFn) (*GetPassengerJourneysResponse, error)

	// GetPassengerRegularTrips request
	GetPassengerRegularTripsWithResponse(ctx context.Context, params *GetPassengerRegularTripsParams, reqEditors ...RequestEditorFn) (*GetPassengerRegularTripsResponse, error)

	// GetStatus request
	GetStatusWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetStatusResponse, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type Count

type Count = int

Count defines model for count.

type DepartureDate

type DepartureDate = int

DepartureDate defines model for departureDate.

type DepartureLat

type DepartureLat = float32

DepartureLat defines model for departureLat.

type DepartureLng

type DepartureLng = float32

DepartureLng defines model for departureLng.

type DepartureRadius

type DepartureRadius = float32

DepartureRadius defines model for departureRadius.

type DepartureTimeOfDay

type DepartureTimeOfDay = string

DepartureTimeOfDay defines model for departureTimeOfDay.

type DepartureWeekdays

type DepartureWeekdays = []string

DepartureWeekdays defines model for departureWeekdays.

type DriverCarpoolBooking

type DriverCarpoolBooking struct {
	// Embedded struct due to allOf(#/components/schemas/CarpoolBooking)
	CarpoolBooking `yaml:",inline"`
	// Embedded fields due to inline allOf schema
	Car    *Car  `json:"car,omitempty"`
	Driver User  `json:"driver"`
	Price  Price `json:"price"`
}

DriverCarpoolBooking defines model for DriverCarpoolBooking.

func (DriverCarpoolBooking) ToBooking

func (dcb DriverCarpoolBooking) ToBooking() *Booking

ToBooking performs a lossy conversion from driverCarpoolBooking to Booking objects

type DriverJourney

type DriverJourney struct {
	// Embedded struct due to allOf(#/components/schemas/DriverTrip)
	DriverTrip `yaml:",inline"`
	// Embedded struct due to allOf(#/components/schemas/JourneySchedule)
	JourneySchedule `yaml:",inline"`
	// Embedded fields due to inline allOf schema
	// AvailableSeats Available seats in the car.
	AvailableSeats *int   `json:"availableSeats,omitempty"`
	Price          *Price `json:"price,omitempty"`
}

DriverJourney defines model for DriverJourney.

func NewDriverJourney

func NewDriverJourney() DriverJourney

NewDriverJourney returns a valid DriverJourney

type DriverRegularTrip

type DriverRegularTrip struct {
	DriverTrip
	Schedules *[]Schedule
}

func NewDriverRegularTrip

func NewDriverRegularTrip() DriverRegularTrip

NewDriverRegularTrip returns a valid DriverRegularTrip

type DriverTrip

type DriverTrip struct {
	// Embedded struct due to allOf(#/components/schemas/Trip)
	Trip `yaml:",inline"`
	// Embedded fields due to inline allOf schema
	Car *Car `json:"car,omitempty"`

	// DepartureToPickupWalkingDistance Walking distance from the requested departure location
	// to the pick-up location.
	DepartureToPickupWalkingDistance *int `json:"departureToPickupWalkingDistance,omitempty"`

	// DepartureToPickupWalkingDuration Walking duration from the requested departure location
	// to the pick-up location.
	DepartureToPickupWalkingDuration *int `json:"departureToPickupWalkingDuration,omitempty"`

	// DepartureToPickupWalkingPolyline Walking
	// [Google Encoded Polyline](https://developers.google.com/maps/documentation/utilities/polylinealgorithm)
	// from the requested departure location to the pick-up location.
	DepartureToPickupWalkingPolyline *string `json:"departureToPickupWalkingPolyline,omitempty"`
	Driver                           User    `json:"driver"`

	// DropoffToArrivalWalkingDistance Walking distance to the requested arrival location
	// from the drop-off location.
	DropoffToArrivalWalkingDistance *int `json:"dropoffToArrivalWalkingDistance,omitempty"`

	// DropoffToArrivalWalkingDuration Walking duration to the requested arrival location
	// from the drop-off location.
	DropoffToArrivalWalkingDuration *int `json:"dropoffToArrivalWalkingDuration,omitempty"`

	// DropoffToArrivalWalkingPolyline Walking
	// [Google Encoded Polyline](https://developers.google.com/maps/documentation/utilities/polylinealgorithm)
	// to the requested arrival location from the drop-off location.
	DropoffToArrivalWalkingPolyline *string `json:"dropoffToArrivalWalkingPolyline,omitempty"`
}

DriverTrip defines model for DriverTrip.

type EchoRouter

type EchoRouter interface {
	CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
}

This is a simple interface which specifies echo.Route addition functions which are present on both echo.Echo and echo.Group, since we want to allow using either of them for path registration

type GetBookingsResponse

type GetBookingsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *Booking
	JSON400      *struct {
		// Error Explain why the request couldn't be processed.
		Error *string `json:"error,omitempty"`
	}
	JSON404 *struct {
		// Error Explain why the request couldn't be processed.
		Error *string `json:"error,omitempty"`
	}
}

func ParseGetBookingsResponse

func ParseGetBookingsResponse(rsp *http.Response) (*GetBookingsResponse, error)

ParseGetBookingsResponse parses an HTTP response from a GetBookingsWithResponse call

func (GetBookingsResponse) Status

func (r GetBookingsResponse) Status() string

Status returns HTTPResponse.Status

func (GetBookingsResponse) StatusCode

func (r GetBookingsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetDriverJourneysParams

type GetDriverJourneysParams struct {
	// DepartureLat Latitude of searched departure point.
	DepartureLat DepartureLat `form:"departureLat" json:"departureLat"`

	// DepartureLng Longitude of searched departure point.
	DepartureLng DepartureLng `form:"departureLng" json:"departureLng"`

	// ArrivalLat Latitude of searched arrival point.
	ArrivalLat ArrivalLat `form:"arrivalLat" json:"arrivalLat"`

	// ArrivalLng Longitude of searched arrival point.
	ArrivalLng ArrivalLng `form:"arrivalLng" json:"arrivalLng"`

	// DepartureDate Departure datetime using a UNIX UTC timestamp in seconds.
	DepartureDate DepartureDate `form:"departureDate" json:"departureDate"`

	// TimeDelta Time margin in seconds. The retrieved journeys must match the given time parameters within a +`timeDelta` / -`timeDelta` interval .
	TimeDelta *TimeDelta `form:"timeDelta,omitempty" json:"timeDelta,omitempty"`

	// DepartureRadius Search radius in kilometers around the departure point.
	DepartureRadius *DepartureRadius `form:"departureRadius,omitempty" json:"departureRadius,omitempty"`

	// ArrivalRadius Search radius in kilometers around the arrival point.
	ArrivalRadius *ArrivalRadius `form:"arrivalRadius,omitempty" json:"arrivalRadius,omitempty"`

	// Count Maximum number of returned results. If missing, all matching results are returned.
	Count *Count `form:"count,omitempty" json:"count,omitempty"`
}

GetDriverJourneysParams defines parameters for GetDriverJourneys.

func NewGetDriverJourneysParams

func NewGetDriverJourneysParams(
	departure, arrival util.Coord,
	departureDate int,
) *GetDriverJourneysParams

NewGetDriverJourneysParams returns query parameters, looking for a trip from "departure" to "arrival" at "departureDate".

func (*GetDriverJourneysParams) GetArrivalLat

func (p *GetDriverJourneysParams) GetArrivalLat() float64

func (*GetDriverJourneysParams) GetArrivalLng

func (p *GetDriverJourneysParams) GetArrivalLng() float64

func (*GetDriverJourneysParams) GetArrivalRadius

func (p *GetDriverJourneysParams) GetArrivalRadius() float64

GetArrivalRadius returns the value of ArrivalRadius if any, or its default value otherwise.

func (*GetDriverJourneysParams) GetCount

func (p *GetDriverJourneysParams) GetCount() *int

func (*GetDriverJourneysParams) GetDepartureDate

func (p *GetDriverJourneysParams) GetDepartureDate() int

func (*GetDriverJourneysParams) GetDepartureLat

func (p *GetDriverJourneysParams) GetDepartureLat() float64

func (*GetDriverJourneysParams) GetDepartureLng

func (p *GetDriverJourneysParams) GetDepartureLng() float64

func (*GetDriverJourneysParams) GetDepartureRadius

func (p *GetDriverJourneysParams) GetDepartureRadius() float64

GetDepartureRadius returns the value of DepartureRadius if any, or its default value otherwise.

func (*GetDriverJourneysParams) GetTimeDelta

func (p *GetDriverJourneysParams) GetTimeDelta() int

GetTimeDelta returns the value of TimeDelta if any, or its default value otherwise. Implements GetJourneyParams.GetTimeDelta().

type GetDriverJourneysResponse

type GetDriverJourneysResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *[]DriverJourney
	JSON400      *struct {
		// Error Explain why the request couldn't be processed.
		Error *string `json:"error,omitempty"`
	}
}

func ParseGetDriverJourneysResponse

func ParseGetDriverJourneysResponse(rsp *http.Response) (*GetDriverJourneysResponse, error)

ParseGetDriverJourneysResponse parses an HTTP response from a GetDriverJourneysWithResponse call

func (GetDriverJourneysResponse) Status

func (r GetDriverJourneysResponse) Status() string

Status returns HTTPResponse.Status

func (GetDriverJourneysResponse) StatusCode

func (r GetDriverJourneysResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetDriverRegularTripsParams

type GetDriverRegularTripsParams struct {
	// DepartureLat Latitude of searched departure point.
	DepartureLat DepartureLat `form:"departureLat" json:"departureLat"`

	// DepartureLng Longitude of searched departure point.
	DepartureLng DepartureLng `form:"departureLng" json:"departureLng"`

	// ArrivalLat Latitude of searched arrival point.
	ArrivalLat ArrivalLat `form:"arrivalLat" json:"arrivalLat"`

	// ArrivalLng Longitude of searched arrival point.
	ArrivalLng ArrivalLng `form:"arrivalLng" json:"arrivalLng"`

	// DepartureTimeOfDay Departure time of day represented as [RFC3339 partial-time](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6).
	DepartureTimeOfDay DepartureTimeOfDay `form:"departureTimeOfDay" json:"departureTimeOfDay"`

	// DepartureWeekdays Departure days of week. The retrieved trips should have at least one schedule applicable on one of the departureWeekdays.
	DepartureWeekdays *DepartureWeekdays `form:"departureWeekdays,omitempty" json:"departureWeekdays,omitempty"`

	// TimeDelta Time margin in seconds. The retrieved journeys must match the given time parameters within a +`timeDelta` / -`timeDelta` interval .
	TimeDelta *TimeDelta `form:"timeDelta,omitempty" json:"timeDelta,omitempty"`

	// DepartureRadius Search radius in kilometers around the departure point.
	DepartureRadius *DepartureRadius `form:"departureRadius,omitempty" json:"departureRadius,omitempty"`

	// ArrivalRadius Search radius in kilometers around the arrival point.
	ArrivalRadius *ArrivalRadius `form:"arrivalRadius,omitempty" json:"arrivalRadius,omitempty"`

	// MinDepartureDate Minimum date of departure for the returned journeys. Datetime using a UNIX UTC timestamp in seconds.
	MinDepartureDate *MinDepartureDate `form:"minDepartureDate,omitempty" json:"minDepartureDate,omitempty"`

	// MaxDepartureDate Maximum date of departure for the returned journeys. Datetime using a UNIX UTC timestamp in seconds.
	MaxDepartureDate *MaxDepartureDate `form:"maxDepartureDate,omitempty" json:"maxDepartureDate,omitempty"`

	// Count Maximum number of returned results. If missing, all matching results are returned.
	Count *Count `form:"count,omitempty" json:"count,omitempty"`
}

GetDriverRegularTripsParams defines parameters for GetDriverRegularTrips.

func (*GetDriverRegularTripsParams) GetArrivalLat

func (p *GetDriverRegularTripsParams) GetArrivalLat() float64

func (*GetDriverRegularTripsParams) GetArrivalLng

func (p *GetDriverRegularTripsParams) GetArrivalLng() float64

func (*GetDriverRegularTripsParams) GetArrivalRadius

func (p *GetDriverRegularTripsParams) GetArrivalRadius() float64

GetArrivalRadius returns the value of ArrivalRadius if any, or its default value otherwise.

func (*GetDriverRegularTripsParams) GetCount

func (p *GetDriverRegularTripsParams) GetCount() *int

func (*GetDriverRegularTripsParams) GetDepartureLat

func (p *GetDriverRegularTripsParams) GetDepartureLat() float64

func (*GetDriverRegularTripsParams) GetDepartureLng

func (p *GetDriverRegularTripsParams) GetDepartureLng() float64

func (*GetDriverRegularTripsParams) GetDepartureRadius

func (p *GetDriverRegularTripsParams) GetDepartureRadius() float64

GetDepartureRadius returns the value of DepartureRadius if any, or its default value otherwise.

func (*GetDriverRegularTripsParams) GetDepartureTimeOfDay

func (p *GetDriverRegularTripsParams) GetDepartureTimeOfDay() string

func (*GetDriverRegularTripsParams) GetDepartureWeekDays

func (p *GetDriverRegularTripsParams) GetDepartureWeekDays() []string

func (*GetDriverRegularTripsParams) GetMaxDepartureDate

func (p *GetDriverRegularTripsParams) GetMaxDepartureDate() *int

func (*GetDriverRegularTripsParams) GetMinDepartureDate

func (p *GetDriverRegularTripsParams) GetMinDepartureDate() *int

func (*GetDriverRegularTripsParams) GetTimeDelta

func (p *GetDriverRegularTripsParams) GetTimeDelta() int

GetTimeDelta returns the value of TimeDelta if any, or its default value otherwise. Implements GetJourneyParams.GetTimeDelta().

type GetDriverRegularTripsResponse

type GetDriverRegularTripsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *[]struct {
		// Embedded struct due to allOf(#/components/schemas/DriverTrip)
		DriverTrip `yaml:",inline"`
		// Embedded fields due to inline allOf schema
		Schedules *[]Schedule `json:"schedules,omitempty"`
	}
	JSON400 *struct {
		// Error Explain why the request couldn't be processed.
		Error *string `json:"error,omitempty"`
	}
}

func ParseGetDriverRegularTripsResponse

func ParseGetDriverRegularTripsResponse(rsp *http.Response) (*GetDriverRegularTripsResponse, error)

ParseGetDriverRegularTripsResponse parses an HTTP response from a GetDriverRegularTripsWithResponse call

func (GetDriverRegularTripsResponse) Status

Status returns HTTPResponse.Status

func (GetDriverRegularTripsResponse) StatusCode

func (r GetDriverRegularTripsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetJourneysParams

type GetJourneysParams interface {
	JourneyOrTripPartialParams
	GetDepartureDate() int
}

type GetPassengerJourneysParams

type GetPassengerJourneysParams struct {
	// DepartureLat Latitude of searched departure point.
	DepartureLat DepartureLat `form:"departureLat" json:"departureLat"`

	// DepartureLng Longitude of searched departure point.
	DepartureLng DepartureLng `form:"departureLng" json:"departureLng"`

	// ArrivalLat Latitude of searched arrival point.
	ArrivalLat ArrivalLat `form:"arrivalLat" json:"arrivalLat"`

	// ArrivalLng Longitude of searched arrival point.
	ArrivalLng ArrivalLng `form:"arrivalLng" json:"arrivalLng"`

	// DepartureDate Departure datetime using a UNIX UTC timestamp in seconds.
	DepartureDate DepartureDate `form:"departureDate" json:"departureDate"`

	// TimeDelta Time margin in seconds. The retrieved journeys must match the given time parameters within a +`timeDelta` / -`timeDelta` interval .
	TimeDelta *TimeDelta `form:"timeDelta,omitempty" json:"timeDelta,omitempty"`

	// DepartureRadius Search radius in kilometers around the departure point.
	DepartureRadius *DepartureRadius `form:"departureRadius,omitempty" json:"departureRadius,omitempty"`

	// ArrivalRadius Search radius in kilometers around the arrival point.
	ArrivalRadius *ArrivalRadius `form:"arrivalRadius,omitempty" json:"arrivalRadius,omitempty"`

	// Count Maximum number of returned results. If missing, all matching results are returned.
	Count *Count `form:"count,omitempty" json:"count,omitempty"`
}

GetPassengerJourneysParams defines parameters for GetPassengerJourneys.

func NewGetPassengerJourneysParams

func NewGetPassengerJourneysParams(
	departure, arrival util.Coord,
	departureDate int,
) *GetPassengerJourneysParams

NewGetPassengerJourneysParams returns query parameters, looking for a trip from "departure" to "arrival" at "departureDate".

func (*GetPassengerJourneysParams) GetArrivalLat

func (p *GetPassengerJourneysParams) GetArrivalLat() float64

func (*GetPassengerJourneysParams) GetArrivalLng

func (p *GetPassengerJourneysParams) GetArrivalLng() float64

func (*GetPassengerJourneysParams) GetArrivalRadius

func (p *GetPassengerJourneysParams) GetArrivalRadius() float64

GetArrivalRadius returns the value of ArrivalRadius if any, or its default value otherwise.

func (*GetPassengerJourneysParams) GetCount

func (p *GetPassengerJourneysParams) GetCount() *int

func (*GetPassengerJourneysParams) GetDepartureDate

func (p *GetPassengerJourneysParams) GetDepartureDate() int

func (*GetPassengerJourneysParams) GetDepartureLat

func (p *GetPassengerJourneysParams) GetDepartureLat() float64

func (*GetPassengerJourneysParams) GetDepartureLng

func (p *GetPassengerJourneysParams) GetDepartureLng() float64

func (*GetPassengerJourneysParams) GetDepartureRadius

func (p *GetPassengerJourneysParams) GetDepartureRadius() float64

GetDepartureRadius returns the value of DepartureRadius if any, or its default value otherwise.

func (*GetPassengerJourneysParams) GetTimeDelta

func (p *GetPassengerJourneysParams) GetTimeDelta() int

GetTimeDelta returns the value of TimeDelta if any, or its default value otherwise. Implements GetJourneyParams.GetTimeDelta().

type GetPassengerJourneysResponse

type GetPassengerJourneysResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *[]PassengerJourney
	JSON400      *struct {
		// Error Explain why the request couldn't be processed.
		Error *string `json:"error,omitempty"`
	}
}

func ParseGetPassengerJourneysResponse

func ParseGetPassengerJourneysResponse(rsp *http.Response) (*GetPassengerJourneysResponse, error)

ParseGetPassengerJourneysResponse parses an HTTP response from a GetPassengerJourneysWithResponse call

func (GetPassengerJourneysResponse) Status

Status returns HTTPResponse.Status

func (GetPassengerJourneysResponse) StatusCode

func (r GetPassengerJourneysResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetPassengerRegularTripsParams

type GetPassengerRegularTripsParams struct {
	// DepartureLat Latitude of searched departure point.
	DepartureLat DepartureLat `form:"departureLat" json:"departureLat"`

	// DepartureLng Longitude of searched departure point.
	DepartureLng DepartureLng `form:"departureLng" json:"departureLng"`

	// ArrivalLat Latitude of searched arrival point.
	ArrivalLat ArrivalLat `form:"arrivalLat" json:"arrivalLat"`

	// ArrivalLng Longitude of searched arrival point.
	ArrivalLng ArrivalLng `form:"arrivalLng" json:"arrivalLng"`

	// DepartureTimeOfDay Departure time of day represented as [RFC3339 partial-time](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6).
	DepartureTimeOfDay DepartureTimeOfDay `form:"departureTimeOfDay" json:"departureTimeOfDay"`

	// DepartureWeekdays Departure days of week. The retrieved trips should have at least one schedule applicable on one of the departureWeekdays.
	DepartureWeekdays *DepartureWeekdays `form:"departureWeekdays,omitempty" json:"departureWeekdays,omitempty"`

	// TimeDelta Time margin in seconds. The retrieved journeys must match the given time parameters within a +`timeDelta` / -`timeDelta` interval .
	TimeDelta *TimeDelta `form:"timeDelta,omitempty" json:"timeDelta,omitempty"`

	// DepartureRadius Search radius in kilometers around the departure point.
	DepartureRadius *DepartureRadius `form:"departureRadius,omitempty" json:"departureRadius,omitempty"`

	// ArrivalRadius Search radius in kilometers around the arrival point.
	ArrivalRadius *ArrivalRadius `form:"arrivalRadius,omitempty" json:"arrivalRadius,omitempty"`

	// MinDepartureDate Minimum date of departure for the returned journeys. Datetime using a UNIX UTC timestamp in seconds.
	MinDepartureDate *MinDepartureDate `form:"minDepartureDate,omitempty" json:"minDepartureDate,omitempty"`

	// MaxDepartureDate Maximum date of departure for the returned journeys. Datetime using a UNIX UTC timestamp in seconds.
	MaxDepartureDate *MaxDepartureDate `form:"maxDepartureDate,omitempty" json:"maxDepartureDate,omitempty"`

	// Count Maximum number of returned results. If missing, all matching results are returned.
	Count *Count `form:"count,omitempty" json:"count,omitempty"`
}

GetPassengerRegularTripsParams defines parameters for GetPassengerRegularTrips.

func (*GetPassengerRegularTripsParams) GetArrivalLat

func (p *GetPassengerRegularTripsParams) GetArrivalLat() float64

func (*GetPassengerRegularTripsParams) GetArrivalLng

func (p *GetPassengerRegularTripsParams) GetArrivalLng() float64

func (*GetPassengerRegularTripsParams) GetArrivalRadius

func (p *GetPassengerRegularTripsParams) GetArrivalRadius() float64

GetArrivalRadius returns the value of ArrivalRadius if any, or its default value otherwise.

func (*GetPassengerRegularTripsParams) GetCount

func (p *GetPassengerRegularTripsParams) GetCount() *int

func (*GetPassengerRegularTripsParams) GetDepartureLat

func (p *GetPassengerRegularTripsParams) GetDepartureLat() float64

func (*GetPassengerRegularTripsParams) GetDepartureLng

func (p *GetPassengerRegularTripsParams) GetDepartureLng() float64

func (*GetPassengerRegularTripsParams) GetDepartureRadius

func (p *GetPassengerRegularTripsParams) GetDepartureRadius() float64

GetDepartureRadius returns the value of DepartureRadius if any, or its default value otherwise.

func (*GetPassengerRegularTripsParams) GetDepartureTimeOfDay

func (p *GetPassengerRegularTripsParams) GetDepartureTimeOfDay() string

func (*GetPassengerRegularTripsParams) GetDepartureWeekDays

func (p *GetPassengerRegularTripsParams) GetDepartureWeekDays() []string

func (*GetPassengerRegularTripsParams) GetMaxDepartureDate

func (p *GetPassengerRegularTripsParams) GetMaxDepartureDate() *int

func (*GetPassengerRegularTripsParams) GetMinDepartureDate

func (p *GetPassengerRegularTripsParams) GetMinDepartureDate() *int

func (*GetPassengerRegularTripsParams) GetTimeDelta

func (p *GetPassengerRegularTripsParams) GetTimeDelta() int

GetTimeDelta returns the value of TimeDelta if any, or its default value otherwise. Implements GetJourneyParams.GetTimeDelta().

type GetPassengerRegularTripsResponse

type GetPassengerRegularTripsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *[]struct {
		// Embedded struct due to allOf(#/components/schemas/PassengerTrip)
		PassengerTrip `yaml:",inline"`
		// Embedded fields due to inline allOf schema
		Schedules *[]Schedule `json:"schedules,omitempty"`
	}
	JSON400 *struct {
		// Error Explain why the request couldn't be processed.
		Error *string `json:"error,omitempty"`
	}
}

func ParseGetPassengerRegularTripsResponse

func ParseGetPassengerRegularTripsResponse(rsp *http.Response) (*GetPassengerRegularTripsResponse, error)

ParseGetPassengerRegularTripsResponse parses an HTTP response from a GetPassengerRegularTripsWithResponse call

func (GetPassengerRegularTripsResponse) Status

Status returns HTTPResponse.Status

func (GetPassengerRegularTripsResponse) StatusCode

func (r GetPassengerRegularTripsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetRegularTripParams

type GetRegularTripParams interface {
	JourneyOrTripPartialParams
	GetDepartureTimeOfDay() string
	GetDepartureWeekDays() []string
	GetMinDepartureDate() *int
	GetMaxDepartureDate() *int
}

type GetStatusResponse

type GetStatusResponse struct {
	Body         []byte
	HTTPResponse *http.Response
}

func ParseGetStatusResponse

func ParseGetStatusResponse(rsp *http.Response) (*GetStatusResponse, error)

ParseGetStatusResponse parses an HTTP response from a GetStatusWithResponse call

func (GetStatusResponse) Status

func (r GetStatusResponse) Status() string

Status returns HTTPResponse.Status

func (GetStatusResponse) StatusCode

func (r GetStatusResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type HttpRequestDoer

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

type JourneyOrTripPartialParams

type JourneyOrTripPartialParams interface {
	GetDepartureLat() float64
	GetDepartureLng() float64
	GetDepartureRadius() float64
	GetArrivalLat() float64
	GetArrivalLng() float64
	GetArrivalRadius() float64
	GetTimeDelta() int
	GetCount() *int
}

type JourneySchedule

type JourneySchedule struct {
	// DriverDepartureDate Driver departure datetime as a UNIX UTC timestamp in seconds.
	DriverDepartureDate *int64 `json:"driverDepartureDate,omitempty"`

	// Id Journey's id. It MUST be unique for a given operator.
	Id *string `json:"id,omitempty"`

	// PassengerPickupDate Passenger pickup datetime as a UNIX UTC timestamp in seconds.
	PassengerPickupDate int64 `json:"passengerPickupDate"`

	// Type Type of journey. A dynamic journey is happening in real time.
	Type JourneyScheduleType `json:"type"`

	// WebUrl URL of the journey on the webservice provider platform. Required to support booking by deeplink.
	WebUrl *string `json:"webUrl,omitempty"`
}

JourneySchedule defines model for JourneySchedule.

func NewJourneySchedule

func NewJourneySchedule() JourneySchedule

NewJourneySchedule returns a valid JourneySchedule

type JourneyScheduleType

type JourneyScheduleType string

JourneyScheduleType Type of journey. A dynamic journey is happening in real time.

const (
	DYNAMIC JourneyScheduleType = "DYNAMIC"
	LINE    JourneyScheduleType = "LINE"
	PLANNED JourneyScheduleType = "PLANNED"
)

Defines values for JourneyScheduleType.

type MaxDepartureDate

type MaxDepartureDate = int

MaxDepartureDate defines model for maxDepartureDate.

type MinDepartureDate

type MinDepartureDate = int

MinDepartureDate defines model for minDepartureDate.

type PassengerCarpoolBooking

type PassengerCarpoolBooking struct {
	// Embedded struct due to allOf(#/components/schemas/CarpoolBooking)
	CarpoolBooking `yaml:",inline"`
	// Embedded fields due to inline allOf schema
	Passenger User `json:"passenger"`
}

PassengerCarpoolBooking defines model for PassengerCarpoolBooking.

func (PassengerCarpoolBooking) ToBooking

func (pcb PassengerCarpoolBooking) ToBooking() *Booking

ToBooking performs a lossy conversion from passengerCarpoolBooking to Booking objects

type PassengerJourney

type PassengerJourney struct {
	// Embedded struct due to allOf(#/components/schemas/PassengerTrip)
	PassengerTrip `yaml:",inline"`
	// Embedded struct due to allOf(#/components/schemas/JourneySchedule)
	JourneySchedule `yaml:",inline"`
	// Embedded fields due to inline allOf schema
	// RequestedSeats Requested seats by the passenger.
	RequestedSeats *int `json:"requestedSeats,omitempty"`
}

PassengerJourney defines model for PassengerJourney.

func NewPassengerJourney

func NewPassengerJourney() PassengerJourney

NewPassengerJourney returns a valid PassengerJourney

type PassengerRegularTrip

type PassengerRegularTrip struct {
	PassengerTrip
	Schedules *[]Schedule
}

func NewPassengerRegularTrip

func NewPassengerRegularTrip() PassengerRegularTrip

NewPassengerRegularTrip returns a valid PassengerRegularTrip

type PassengerTrip

type PassengerTrip struct {
	// Embedded struct due to allOf(#/components/schemas/Trip)
	Trip `yaml:",inline"`
	// Embedded fields due to inline allOf schema
	Passenger User `json:"passenger"`
}

PassengerTrip defines model for PassengerTrip.

type PatchBookingsParams

type PatchBookingsParams struct {
	// Status New status of the Booking.
	Status BookingStatus `form:"status" json:"status"`

	// Message Free text content of a message. The message can contain explanations on the status change.
	Message *string `form:"message,omitempty" json:"message,omitempty"`
}

PatchBookingsParams defines parameters for PatchBookings.

type PatchBookingsResponse

type PatchBookingsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON400      *struct {
		// Error Explain why the request couldn't be processed.
		Error *string `json:"error,omitempty"`
	}
	JSON404 *struct {
		// Error Explain why the request couldn't be processed.
		Error *string `json:"error,omitempty"`
	}
	JSON409 *struct {
		// Error Explain why the request couldn't be processed.
		Error *string `json:"error,omitempty"`
	}
}

func ParsePatchBookingsResponse

func ParsePatchBookingsResponse(rsp *http.Response) (*PatchBookingsResponse, error)

ParsePatchBookingsResponse parses an HTTP response from a PatchBookingsWithResponse call

func (PatchBookingsResponse) Status

func (r PatchBookingsResponse) Status() string

Status returns HTTPResponse.Status

func (PatchBookingsResponse) StatusCode

func (r PatchBookingsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type PostBookingEventsJSONRequestBody

type PostBookingEventsJSONRequestBody = CarpoolBookingEvent

PostBookingEventsJSONRequestBody defines body for PostBookingEvents for application/json ContentType.

type PostBookingEventsResponse

type PostBookingEventsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON400      *struct {
		// Error Explain why the request couldn't be processed.
		Error *string `json:"error,omitempty"`
	}
}

func ParsePostBookingEventsResponse

func ParsePostBookingEventsResponse(rsp *http.Response) (*PostBookingEventsResponse, error)

ParsePostBookingEventsResponse parses an HTTP response from a PostBookingEventsWithResponse call

func (PostBookingEventsResponse) Status

func (r PostBookingEventsResponse) Status() string

Status returns HTTPResponse.Status

func (PostBookingEventsResponse) StatusCode

func (r PostBookingEventsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type PostBookingsJSONRequestBody

type PostBookingsJSONRequestBody = Booking

PostBookingsJSONRequestBody defines body for PostBookings for application/json ContentType.

type PostBookingsResponse

type PostBookingsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON201      *Booking
	JSON400      *struct {
		// Error Explain why the request couldn't be processed.
		Error *string `json:"error,omitempty"`
	}
}

func ParsePostBookingsResponse

func ParsePostBookingsResponse(rsp *http.Response) (*PostBookingsResponse, error)

ParsePostBookingsResponse parses an HTTP response from a PostBookingsWithResponse call

func (PostBookingsResponse) Status

func (r PostBookingsResponse) Status() string

Status returns HTTPResponse.Status

func (PostBookingsResponse) StatusCode

func (r PostBookingsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type PostMessagesJSONBody

type PostMessagesJSONBody struct {
	// BookingId Booking id is common between both operators, and must be created as a [UUID](https://datatracker.ietf.org/doc/html/rfc4122) by whoever initiates the booking.  Usage of a [4 UUID](https://datatracker.ietf.org/doc/html/rfc4122#section-4.4) generation algorithm is advised.
	BookingId *BookingId `json:"bookingId,omitempty"`

	// DriverJourneyId ID of the Driver's journey to which the message is related (if any). Unique given the `Driver`'s `operator` property.
	DriverJourneyId *string `json:"driverJourneyId,omitempty"`
	From            User    `json:"from"`

	// Message Free text content of a message. The message can contain all the details (phone number, email, etc.) allowing the recipient to call back the sender in order to carpool with him/her.
	Message string `json:"message"`

	// PassengerJourneyId ID of the Passenger's journey to which the message is related (if any). Unique given the `Passenger`'s `operator` property.
	PassengerJourneyId *string `json:"passengerJourneyId,omitempty"`

	// RecipientCarpoolerType Defines if the recipient of this message is either the driver or the passenger.
	RecipientCarpoolerType PostMessagesJSONBodyRecipientCarpoolerType `json:"recipientCarpoolerType"`
	To                     User                                       `json:"to"`
}

PostMessagesJSONBody defines parameters for PostMessages.

type PostMessagesJSONBodyRecipientCarpoolerType

type PostMessagesJSONBodyRecipientCarpoolerType string

PostMessagesJSONBodyRecipientCarpoolerType defines parameters for PostMessages.

Defines values for PostMessagesJSONBodyRecipientCarpoolerType.

type PostMessagesJSONRequestBody

type PostMessagesJSONRequestBody PostMessagesJSONBody

PostMessagesJSONRequestBody defines body for PostMessages for application/json ContentType.

type PostMessagesResponse

type PostMessagesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON400      *struct {
		// Error Explain why the request couldn't be processed.
		Error *string `json:"error,omitempty"`
	}
}

func ParsePostMessagesResponse

func ParsePostMessagesResponse(rsp *http.Response) (*PostMessagesResponse, error)

ParsePostMessagesResponse parses an HTTP response from a PostMessagesWithResponse call

func (PostMessagesResponse) Status

func (r PostMessagesResponse) Status() string

Status returns HTTPResponse.Status

func (PostMessagesResponse) StatusCode

func (r PostMessagesResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Preferences

type Preferences struct {
	// Animals If driver journey, specifies if the driver allows animals in the car.
	Animals *bool `json:"animals,omitempty"`

	// IsTalker If driver journey, specifies if the driver enjoys talking with passengers.
	IsTalker *bool `json:"isTalker,omitempty"`

	// LuggageSize If driver journey, specifies the size of allowed luggages.
	// From very small (1) to very big (5).
	LuggageSize *int `json:"luggageSize,omitempty"`

	// Music If driver journey, specifies if the driver enjoys music in the car.
	Music *bool `json:"music,omitempty"`

	// Smoking If driver journey, specifies if the driver allows smoking in the car.
	Smoking *bool `json:"smoking,omitempty"`
}

Preferences defines model for Preferences.

type Price

type Price struct {
	// Amount Carpooling passenger cost estimate. In the case of integrated booking by API, amount expected by the carpooling operator.
	Amount *float32 `json:"amount,omitempty"`

	// Currency ISO 4217 code representing the currency of the price.
	Currency *string `json:"currency,omitempty"`

	// Type Either « FREE », « PAYING » or « UNKNOWN ». « UNKNOWN » is given
	// when it should be « PAYING » but we cannot set the price yet.
	Type *PriceType `json:"type,omitempty"`
}

Price defines model for Price.

type PriceType

type PriceType string

PriceType Either « FREE », « PAYING » or « UNKNOWN ». « UNKNOWN » is given when it should be « PAYING » but we cannot set the price yet.

const (
	FREE    PriceType = "FREE"
	PAYING  PriceType = "PAYING"
	UNKNOWN PriceType = "UNKNOWN"
)

Defines values for PriceType.

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

type Schedule

type Schedule struct {
	JourneySchedules *[]JourneySchedule `json:"journeySchedules,omitempty"`

	// PassengerPickupDay Day of week of the passenger pick-up.
	PassengerPickupDay *SchedulePassengerPickupDay `json:"passengerPickupDay,omitempty"`

	// PassengerPickupTimeOfDay Passenger pick-up time of day represented as
	// [RFC3339 partial-time](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6).
	PassengerPickupTimeOfDay *string `json:"passengerPickupTimeOfDay,omitempty"`
}

Schedule defines model for Schedule.

func NewSchedule

func NewSchedule() Schedule

NewSchedule returns a valid Schedule

type SchedulePassengerPickupDay

type SchedulePassengerPickupDay string

SchedulePassengerPickupDay Day of week of the passenger pick-up.

Defines values for SchedulePassengerPickupDay.

type ServerInterface

type ServerInterface interface {
	// Sends booking information of a user connected with a third-party provider back to the provider.
	// (POST /booking_events)
	PostBookingEvents(ctx echo.Context) error
	// Create a punctual outward Booking request.
	// (POST /bookings)
	PostBookings(ctx echo.Context) error
	// Retrieves an existing Booking request.
	// (GET /bookings/{bookingId})
	GetBookings(ctx echo.Context, bookingId BookingId) error
	// Updates status of an existing Booking request.
	// (PATCH /bookings/{bookingId})
	PatchBookings(ctx echo.Context, bookingId BookingId, params PatchBookingsParams) error
	// Search for matching punctual planned outward driver journeys.
	// (GET /driver_journeys)
	GetDriverJourneys(ctx echo.Context, params GetDriverJourneysParams) error
	// Search for matching regular driver trips.
	// (GET /driver_regular_trips)
	GetDriverRegularTrips(ctx echo.Context, params GetDriverRegularTripsParams) error
	// Send a message to the owner of a retrieved journey.
	// (POST /messages)
	PostMessages(ctx echo.Context) error
	// Search for matching punctual planned outward passenger journeys.
	// (GET /passenger_journeys)
	GetPassengerJourneys(ctx echo.Context, params GetPassengerJourneysParams) error
	// Search for matching passenger regular trips.
	// (GET /passenger_regular_trips)
	GetPassengerRegularTrips(ctx echo.Context, params GetPassengerRegularTripsParams) error
	// Give health status of the webservice.
	// (GET /status)
	GetStatus(ctx echo.Context) error
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

ServerInterfaceWrapper converts echo contexts to parameters.

func (*ServerInterfaceWrapper) GetBookings

func (w *ServerInterfaceWrapper) GetBookings(ctx echo.Context) error

GetBookings converts echo context to params.

func (*ServerInterfaceWrapper) GetDriverJourneys

func (w *ServerInterfaceWrapper) GetDriverJourneys(ctx echo.Context) error

GetDriverJourneys converts echo context to params.

func (*ServerInterfaceWrapper) GetDriverRegularTrips

func (w *ServerInterfaceWrapper) GetDriverRegularTrips(ctx echo.Context) error

GetDriverRegularTrips converts echo context to params.

func (*ServerInterfaceWrapper) GetPassengerJourneys

func (w *ServerInterfaceWrapper) GetPassengerJourneys(ctx echo.Context) error

GetPassengerJourneys converts echo context to params.

func (*ServerInterfaceWrapper) GetPassengerRegularTrips

func (w *ServerInterfaceWrapper) GetPassengerRegularTrips(ctx echo.Context) error

GetPassengerRegularTrips converts echo context to params.

func (*ServerInterfaceWrapper) GetStatus

func (w *ServerInterfaceWrapper) GetStatus(ctx echo.Context) error

GetStatus converts echo context to params.

func (*ServerInterfaceWrapper) PatchBookings

func (w *ServerInterfaceWrapper) PatchBookings(ctx echo.Context) error

PatchBookings converts echo context to params.

func (*ServerInterfaceWrapper) PostBookingEvents

func (w *ServerInterfaceWrapper) PostBookingEvents(ctx echo.Context) error

PostBookingEvents converts echo context to params.

func (*ServerInterfaceWrapper) PostBookings

func (w *ServerInterfaceWrapper) PostBookings(ctx echo.Context) error

PostBookings converts echo context to params.

func (*ServerInterfaceWrapper) PostMessages

func (w *ServerInterfaceWrapper) PostMessages(ctx echo.Context) error

PostMessages converts echo context to params.

type TimeDelta

type TimeDelta = int

TimeDelta defines model for timeDelta.

type Trip

type Trip struct {
	// Distance Carpooling distance in meters.
	Distance *int `json:"distance,omitempty"`

	// DriverArrivalAddress String representing the arrival address of the driver.
	DriverArrivalAddress *string `json:"driverArrivalAddress,omitempty"`

	// DriverArrivalLat Latitude of the arrival.
	DriverArrivalLat *float64 `json:"driverArrivalLat,omitempty"`

	// DriverArrivalLng Longitude of the arrival.
	DriverArrivalLng *float64 `json:"driverArrivalLng,omitempty"`

	// DriverDepartureAddress String representing the departure address of the driver.
	DriverDepartureAddress *string `json:"driverDepartureAddress,omitempty"`

	// DriverDepartureLat Latitude of the departure.
	DriverDepartureLat *float64 `json:"driverDepartureLat,omitempty"`

	// DriverDepartureLng Longitude of the departure.
	DriverDepartureLng *float64 `json:"driverDepartureLng,omitempty"`

	// Duration Carpooling duration in seconds.
	Duration int `json:"duration"`

	// JourneyPolyline Carpooling journey itinerary as a
	// [Google Encoded Polyline](https://developers.google.com/maps/documentation/utilities/polylinealgorithm), compressed at  level 5.
	JourneyPolyline *string `json:"journeyPolyline,omitempty"`

	// Operator The operator identifier. MUST be a Root Domain (example operator.org) owned by the operator or a Fully Qualified Domain Name (example carpool.mycity.com) exclusively operated by the operator. A given operator SHOULD always send the same value.
	Operator string `json:"operator"`

	// PassengerDropAddress String representing the drop-off address.
	PassengerDropAddress *string `json:"passengerDropAddress,omitempty"`

	// PassengerDropLat Latitude of the passenger drop-off point.
	PassengerDropLat float64 `json:"passengerDropLat"`

	// PassengerDropLng Longitude of the passenger drop-off point.
	PassengerDropLng float64 `json:"passengerDropLng"`

	// PassengerPickupAddress String representing the pickup-up address.
	PassengerPickupAddress *string `json:"passengerPickupAddress,omitempty"`

	// PassengerPickupLat Latitude of the passenger pick-up point.
	PassengerPickupLat float64 `json:"passengerPickupLat"`

	// PassengerPickupLng Longitude of the passenger pick-up point.
	PassengerPickupLng float64      `json:"passengerPickupLng"`
	Preferences        *Preferences `json:"preferences,omitempty"`

	// WebUrl URL of the trip on the webservice provider platform.
	WebUrl *string `json:"webUrl,omitempty"`
}

Trip defines model for Trip.

func NewTrip

func NewTrip() Trip

NewTrip returns a valid Trip

type User

type User struct {
	// Alias User's alias.
	Alias string `json:"alias"`

	// FirstName User's first name.
	FirstName *string `json:"firstName,omitempty"`

	// Gender User's gender. 'O' stands for 'Other'.
	Gender *UserGender `json:"gender,omitempty"`

	// Grade User's grade from 1 to 5.
	Grade *int `json:"grade,omitempty"`

	// Id User's identifier. It MUST be unique for a given `operator`.
	Id string `json:"id"`

	// LastName User's last name.
	LastName *string `json:"lastName,omitempty"`

	// Operator The operator identifier. MUST be a Fully Qualified Domain Name (example carpool.mycity.com) owned by the operator or a Partially Qualified Domain Name (example operator.org) owned and exclusively operated by the operator. Operators SHOULD always send the same value.
	Operator string `json:"operator"`

	// Picture User's profile picture absolute URL.
	Picture *string `json:"picture,omitempty"`

	// VerifiedIdentity true if the identity of this user has been verified by the operator or a third party; and the firstName, lastName, birthdate have been confirmed as identitical to an official identity proof document. Can be left empty if the information is not available.
	VerifiedIdentity *bool `json:"verifiedIdentity,omitempty"`
}

User defines model for User.

type UserGender

type UserGender string

UserGender User's gender. 'O' stands for 'Other'.

const (
	F UserGender = "F"
	M UserGender = "M"
	O UserGender = "O"
)

Defines values for UserGender.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL