locations

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

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

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewListLocationsRequest

func NewListLocationsRequest(server string, params *ListLocationsParams, body ListLocationsJSONRequestBody) (*http.Request, error)

NewListLocationsRequest calls the generic ListLocations builder with application/json body

func NewListLocationsRequestWithBody

func NewListLocationsRequestWithBody(server string, params *ListLocationsParams, contentType string, body io.Reader) (*http.Request, error)

NewListLocationsRequestWithBody generates requests for ListLocations with any type of body

Types

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

	// A callback for modifying response which are generated after receive from the network.
	ResponseEditors []ResponseEditorFn

	// The user agent header identifies your application, its version number, and the platform and programming language you are using.
	// You must include a user agent header in each request submitted to the sales partner API.
	UserAgent string
}

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) ListLocations

func (c *Client) ListLocations(ctx context.Context, params *ListLocationsParams, body ListLocationsJSONRequestBody) (*http.Response, error)

func (*Client) ListLocationsWithBody

func (c *Client) ListLocationsWithBody(ctx context.Context, params *ListLocationsParams, contentType string, body io.Reader) (*http.Response, error)

type ClientInterface

type ClientInterface interface {
	// ListLocationsWithBody request with any body
	ListLocationsWithBody(ctx context.Context, params *ListLocationsParams, contentType string, body io.Reader) (*http.Response, error)

	ListLocations(ctx context.Context, params *ListLocationsParams, body ListLocationsJSONRequestBody) (*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.

func WithResponseEditorFn added in v0.0.2

func WithResponseEditorFn(fn ResponseEditorFn) ClientOption

WithResponseEditorFn allows setting up a callback function, which will be called right after receive the response.

type ClientWithResponses

type ClientWithResponses struct {
	ClientInterface
}

func NewClientWithResponses

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

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

func (*ClientWithResponses) ListLocationsWithBodyWithResponse

func (c *ClientWithResponses) ListLocationsWithBodyWithResponse(ctx context.Context, params *ListLocationsParams, contentType string, body io.Reader) (*ListLocationsResp, error)

ListLocationsWithBodyWithResponse request with arbitrary body returning *ListLocationsResp

func (*ClientWithResponses) ListLocationsWithResponse

func (c *ClientWithResponses) ListLocationsWithResponse(ctx context.Context, params *ListLocationsParams, body ListLocationsJSONRequestBody) (*ListLocationsResp, error)

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// ListLocationsWithBodyWithResponse request with any body
	ListLocationsWithBodyWithResponse(ctx context.Context, params *ListLocationsParams, contentType string, body io.Reader) (*ListLocationsResp, error)

	ListLocationsWithResponse(ctx context.Context, params *ListLocationsParams, body ListLocationsJSONRequestBody) (*ListLocationsResp, error)
}

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

type Error

type Error struct {
	Errors *[]SubError `json:"errors,omitempty"`

	// Message A human-readable description of the response.
	Message *string `json:"message,omitempty"`

	// RequestId Request Id that uniquely identifies your request.
	RequestId *string `json:"requestId,omitempty"`
}

Error The error response object.

type HexgateBadRequestV1

type HexgateBadRequestV1 = Error

HexgateBadRequestV1 The error response object.

type HexgateForbiddenV1

type HexgateForbiddenV1 = Error

HexgateForbiddenV1 The error response object.

type HexgateInternalServerErrorV1

type HexgateInternalServerErrorV1 = Error

HexgateInternalServerErrorV1 The error response object.

type HexgateNotFoundV1

type HexgateNotFoundV1 = Error

HexgateNotFoundV1 The error response object.

type HexgateTooManyRequestsV1

type HexgateTooManyRequestsV1 = Error

HexgateTooManyRequestsV1 The error response object.

type HexgateUnauthorizedV1

type HexgateUnauthorizedV1 = Error

HexgateUnauthorizedV1 The error response object.

type HttpRequestDoer

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

Doer performs HTTP requests.

The standard http.Client implements this interface.

type ListLocationsJSONRequestBody

type ListLocationsJSONRequestBody = ListLocationsRequestBodyV1

ListLocationsJSONRequestBody defines body for ListLocations for application/json ContentType.

type ListLocationsParams

type ListLocationsParams struct {
	// NextToken Token from a previous request. Use in conjunction with the `maxResults` parameter to control pagination of the returned array.
	NextToken *string `form:"nextToken,omitempty" json:"nextToken,omitempty"`

	// MaxResults Sets the number of locations in the returned array. Use in conjunction with the `nextToken` parameter to control pagination. The range for maxResults is [1,2000] with default as 10. For example, supplying maxResults=20 with a previously returned token will fetch the next 20 items.
	MaxResults *int `form:"maxResults,omitempty" json:"maxResults,omitempty"`

	// AmazonAdvertisingAPIClientId The identifier of a client associated with a "Login with Amazon" account.
	AmazonAdvertisingAPIClientId string `json:"Amazon-Advertising-API-ClientId"`

	// AmazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use `GET` method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header.
	AmazonAdvertisingAPIScope string `json:"Amazon-Advertising-API-Scope"`
}

ListLocationsParams defines parameters for ListLocations.

type ListLocationsRequestBodyV1

type ListLocationsRequestBodyV1 struct {
	Filters *[]LocationFilterV1 `json:"filters,omitempty"`
}

ListLocationsRequestBodyV1 Resulting locations will match all specified filters

type ListLocationsResp

type ListLocationsResp struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *struct {
		Locations *[]LocationV1 `json:"locations,omitempty"`

		// NextToken Token used in following requests for pagination.
		NextToken *string `json:"nextToken,omitempty"`
	}
	JSON400 *HexgateBadRequestV1
	JSON401 *HexgateUnauthorizedV1
	JSON403 *HexgateForbiddenV1
	JSON404 *HexgateNotFoundV1
	JSON429 *HexgateTooManyRequestsV1
	JSON500 *HexgateInternalServerErrorV1
}

func ParseListLocationsResp

func ParseListLocationsResp(rsp *http.Response) (*ListLocationsResp, error)

ParseListLocationsResp parses an HTTP response from a ListLocationsWithResponse call

func (ListLocationsResp) Status

func (r ListLocationsResp) Status() string

Status returns HTTPResponse.Status

func (ListLocationsResp) StatusCode

func (r ListLocationsResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type LocationCategoryV1

type LocationCategoryV1 string

LocationCategoryV1 The location category.

const (
	CITY       LocationCategoryV1 = "CITY"
	COUNTRY    LocationCategoryV1 = "COUNTRY"
	DMA        LocationCategoryV1 = "DMA"
	POSTALCODE LocationCategoryV1 = "POSTAL_CODE"
	STATE      LocationCategoryV1 = "STATE"
)

Defines values for LocationCategoryV1.

type LocationFilterV1

type LocationFilterV1 struct {
	// Field Field to filter by. Supported enums are 'locationId', 'name', and 'category'. The 'name' filter is a fuzzy search. If 'category' is specified, the values must match either 'CITY', 'STATE', 'DMA', 'COUNTRY', or 'POSTAL_CODE'.
	Field  *LocationFilterV1Field `json:"field,omitempty"`
	Values *[]string              `json:"values,omitempty"`
}

LocationFilterV1 defines model for LocationFilterV1.

type LocationFilterV1Field

type LocationFilterV1Field string

LocationFilterV1Field Field to filter by. Supported enums are 'locationId', 'name', and 'category'. The 'name' filter is a fuzzy search. If 'category' is specified, the values must match either 'CITY', 'STATE', 'DMA', 'COUNTRY', or 'POSTAL_CODE'.

const (
	Category   LocationFilterV1Field = "category"
	LocationId LocationFilterV1Field = "locationId"
	Name       LocationFilterV1Field = "name"
)

Defines values for LocationFilterV1Field.

type LocationIdV1

type LocationIdV1 = string

LocationIdV1 The identifier of the location.

type LocationV1

type LocationV1 struct {
	// Category The location category.
	Category *LocationCategoryV1 `json:"category,omitempty"`

	// LocationId The identifier of the location.
	LocationId *LocationIdV1 `json:"locationId,omitempty"`

	// Name The location name.
	Name *string `json:"name,omitempty"`
}

LocationV1 defines model for LocationV1.

type RequestEditorFn

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

RequestEditorFn is the function signature for the RequestEditor callback function

type ResponseEditorFn added in v0.0.2

type ResponseEditorFn func(ctx context.Context, rsp *http.Response) error

ResponseEditorFn is the function signature for the ResponseEditor callback function

type SubError

type SubError struct {
	ErrorType string  `json:"errorType"`
	FieldName *string `json:"fieldName,omitempty"`
	Message   string  `json:"message"`
}

SubError The sub error object.

Jump to

Keyboard shortcuts

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