uber

package
v5.0.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Code generated by swagger_to. DO NOT EDIT.

Code generated by swagger_to. DO NOT EDIT.

Code generated by swagger_to. DO NOT EDIT.

Code generated by swagger_to. DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupRouter

func SetupRouter(h Handler) *mux.Router

SetupRouter sets up a router. If you don't use any middleware, you are good to go. Otherwise, you need to maually re-implement this function with your middlewares.

func ValidateAgainstActivitiesSchema

func ValidateAgainstActivitiesSchema(bb []byte) error

ValidateAgainstActivitiesSchema validates a message coming from the client against Activities schema.

func ValidateAgainstActivitySchema

func ValidateAgainstActivitySchema(bb []byte) error

ValidateAgainstActivitySchema validates a message coming from the client against Activity schema.

func ValidateAgainstPriceEstimateArraySchema

func ValidateAgainstPriceEstimateArraySchema(bb []byte) error

ValidateAgainstPriceEstimateArraySchema validates a message coming from the client against PriceEstimateArray schema.

func ValidateAgainstPriceEstimateSchema

func ValidateAgainstPriceEstimateSchema(bb []byte) error

ValidateAgainstPriceEstimateSchema validates a message coming from the client against PriceEstimate schema.

func ValidateAgainstProductListSchema

func ValidateAgainstProductListSchema(bb []byte) error

ValidateAgainstProductListSchema validates a message coming from the client against ProductList schema.

func ValidateAgainstProductMapSchema

func ValidateAgainstProductMapSchema(bb []byte) error

ValidateAgainstProductMapSchema validates a message coming from the client against ProductMap schema.

func ValidateAgainstProductSchema

func ValidateAgainstProductSchema(bb []byte) error

ValidateAgainstProductSchema validates a message coming from the client against Product schema.

func ValidateAgainstProfileSchema

func ValidateAgainstProfileSchema(bb []byte) error

ValidateAgainstProfileSchema validates a message coming from the client against Profile schema.

func WrapEstimatesPrice

func WrapEstimatesPrice(h Handler, w http.ResponseWriter, r *http.Request)

WrapEstimatesPrice wraps the path `/estimates/price/{start_latitude}/{start_longitude}/{end_latitude}/{end_longitude}` with the method "get".

Path description: The Price Estimates endpoint returns an estimated price range for each product offered at a given location. The price estimate is provided as a formatted string with the full price range and the localized currency symbol.

func WrapEstimatesTime

func WrapEstimatesTime(h Handler, w http.ResponseWriter, r *http.Request)

WrapEstimatesTime wraps the path `/estimates/time` with the method "get".

Path description: The Time Estimates endpoint returns ETAs for all products.

func WrapHistory

func WrapHistory(h Handler, w http.ResponseWriter, r *http.Request)

WrapHistory wraps the path `/history` with the method "get".

Path description: The User Activity endpoint returns data about a user's lifetime activity with Uber. The response will include pickup locations and times, dropoff locations and times, the distance of past requests, and information about which products were requested.

func WrapProducts

func WrapProducts(h Handler, w http.ResponseWriter, r *http.Request)

WrapProducts wraps the path `/products` with the method "get".

Path description: The Products endpoint returns information about the Uber products offered at a given location.

func WrapUpdateMe

func WrapUpdateMe(h Handler, w http.ResponseWriter, r *http.Request)

WrapUpdateMe wraps the path `/me` with the method "patch".

Path description: Update an User Profile.

func WrapUploadInfos

func WrapUploadInfos(h Handler, w http.ResponseWriter, r *http.Request)

WrapUploadInfos wraps the path `/upload_infos` with the method "patch".

Path description: Upload information about an User.

Types

type Activities

type Activities struct {
	// Position in pagination.
	Offset int32 `json:"offset"`

	// Number of items to retrieve (100 max).
	Limit int32 `json:"limit"`

	// Total number of items available.
	Count int64 `json:"count"`

	History []Activity `json:"history"`
}

type Activity

type Activity struct {
	// Unique identifier for the activity
	Uuid string `json:"uuid"`
}

type Handler

type Handler interface {
	// Products handles the path `/products` with the method "get".
	//
	// Path description:
	// The Products endpoint returns information about the Uber products offered at a given location.
	Products(w http.ResponseWriter,
		r *http.Request,
		latitude float64,
		longitude float64)

	// EstimatesPrice handles the path `/estimates/price/{start_latitude}/{start_longitude}/{end_latitude}/{end_longitude}` with the method "get".
	//
	// Path description:
	// The Price Estimates endpoint returns an estimated price range for each product offered at a given
	// location. The price estimate is provided as a formatted string with the full price range and the localized
	// currency symbol.
	EstimatesPrice(w http.ResponseWriter,
		r *http.Request,
		startLatitude float64,
		startLongitude float64,
		endLatitude float64,
		endLongitude float64,
		maxLines *int32)

	// EstimatesTime handles the path `/estimates/time` with the method "get".
	//
	// Path description:
	// The Time Estimates endpoint returns ETAs for all products.
	EstimatesTime(w http.ResponseWriter,
		r *http.Request,
		startLatitude float64,
		startLongitude float64,
		customerUuid *string,
		productID *string)

	// UpdateMe handles the path `/me` with the method "patch".
	//
	// Path description:
	// Update an User Profile.
	UpdateMe(w http.ResponseWriter,
		r *http.Request,
		updateUser Profile)

	// UploadInfos handles the path `/upload_infos` with the method "patch".
	//
	// Path description:
	// Upload information about an User.
	UploadInfos(w http.ResponseWriter,
		r *http.Request)

	// History handles the path `/history` with the method "get".
	//
	// Path description:
	// The User Activity endpoint returns data about a user's lifetime activity with Uber. The response will
	// include pickup locations and times, dropoff locations and times, the distance of past requests, and
	// information about which products were requested.
	History(w http.ResponseWriter,
		r *http.Request,
		offset *int32,
		limit *int32)
}

Handler defines an interface to handling the routes.

type PriceEstimate

type PriceEstimate struct {
	// Unique identifier representing a specific product for a given latitude & longitude. For example,
	// uberX in San Francisco will have a different product_id than uberX in Los Angeles
	ProductID string `json:"product_id"`

	// [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) currency code.
	CurrencyCode string `json:"currency_code"`

	// Display name of product.
	DisplayName string `json:"display_name"`

	// Formatted string of estimate in local currency of the start location.
	// Estimate could be a range, a single number (flat rate) or "Metered" for TAXI.
	Estimate string `json:"estimate"`

	// Lower bound of the estimated price.
	LowEstimate *float64 `json:"low_estimate,omitempty"`

	// Upper bound of the estimated price.
	HighEstimate *float64 `json:"high_estimate,omitempty"`

	// Expected surge multiplier. Surge is active if surge_multiplier is greater than 1.
	// Price estimate already factors in the surge multiplier.
	SurgeMultiplier *float64 `json:"surge_multiplier,omitempty"`
}

type PriceEstimateArray

type PriceEstimateArray []Product

type Product

type Product struct {
	// Unique identifier representing a specific product for a given latitude & longitude.
	// For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles.
	ProductID string `json:"product_id"`

	// Description of product.
	Desc string `json:"desc"`

	// Display name of product.
	DisplayName string `json:"display_name"`

	// Capacity of product. For example, 4 people.
	Capacity int32 `json:"capacity"`

	// Image URL representing the product.
	Image string `json:"image"`
}

type ProductList

type ProductList struct {
	// Contains the list of products
	Products []Product `json:"products"`
}

type ProductMap

type ProductMap map[string]Product

type Profile

type Profile struct {
	// First name of the Uber user.
	FirstName *string `json:"first_name,omitempty"`

	// Last name of the Uber user.
	LastName string `json:"last_name"`

	// Email address of the Uber user
	Email string `json:"email"`

	// Image URL of the Uber user.
	Picture string `json:"picture"`

	// Promo code of the Uber user.
	PromoCode *string `json:"promo_code,omitempty"`
}

Jump to

Keyboard shortcuts

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