authorizationv1

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

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

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGetAuthorizationCodeRequest

func NewGetAuthorizationCodeRequest(server string, params *GetAuthorizationCodeParams) (*http.Request, error)

NewGetAuthorizationCodeRequest generates requests for GetAuthorizationCode

Types

type AuthorizationCode

type AuthorizationCode struct {
	// AuthorizationCode A Login with Amazon (LWA) authorization code that can be exchanged for a refresh token and access token that authorize you to make calls to a Selling Partner API.
	AuthorizationCode *string `json:"authorizationCode,omitempty"`
}

AuthorizationCode A Login with Amazon (LWA) authorization code.

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

func (c *Client) GetAuthorizationCode(ctx context.Context, params *GetAuthorizationCodeParams) (*http.Response, error)

type ClientInterface

type ClientInterface interface {
	// GetAuthorizationCode request
	GetAuthorizationCode(ctx context.Context, params *GetAuthorizationCodeParams) (*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

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

func (c *ClientWithResponses) GetAuthorizationCodeWithResponse(ctx context.Context, params *GetAuthorizationCodeParams) (*GetAuthorizationCodeResp, error)

GetAuthorizationCodeWithResponse request returning *GetAuthorizationCodeResp

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// GetAuthorizationCodeWithResponse request
	GetAuthorizationCodeWithResponse(ctx context.Context, params *GetAuthorizationCodeParams) (*GetAuthorizationCodeResp, error)
}

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

type Error

type Error struct {
	// Code An error code that identifies the type of error that occurred.
	Code string `json:"code"`

	// Details Additional details that can help the caller understand or fix the issue.
	Details *string `json:"details,omitempty"`

	// Message A message that describes the error condition in a human-readable form.
	Message string `json:"message"`
}

Error Error response returned when the request is unsuccessful.

type ErrorList

type ErrorList = []Error

ErrorList A list of error responses returned when a request is unsuccessful.

type GetAuthorizationCodeParams

type GetAuthorizationCodeParams struct {
	// SellingPartnerId The seller ID of the seller for whom you are requesting Selling Partner API authorization. This must be the seller ID of the seller who authorized your application on the Marketplace Appstore.
	SellingPartnerId string `form:"sellingPartnerId" json:"sellingPartnerId"`

	// DeveloperId Your developer ID. This must be one of the developer ID values that you provided when you registered your application in Developer Central.
	DeveloperId string `form:"developerId" json:"developerId"`

	// MwsAuthToken The MWS Auth Token that was generated when the seller authorized your application on the Marketplace Appstore.
	MwsAuthToken string `form:"mwsAuthToken" json:"mwsAuthToken"`
}

GetAuthorizationCodeParams defines parameters for GetAuthorizationCode.

type GetAuthorizationCodeResp

func ParseGetAuthorizationCodeResp

func ParseGetAuthorizationCodeResp(rsp *http.Response) (*GetAuthorizationCodeResp, error)

ParseGetAuthorizationCodeResp parses an HTTP response from a GetAuthorizationCodeWithResponse call

func (GetAuthorizationCodeResp) Status

func (r GetAuthorizationCodeResp) Status() string

Status returns HTTPResponse.Status

func (GetAuthorizationCodeResp) StatusCode

func (r GetAuthorizationCodeResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetAuthorizationCodeResponse

type GetAuthorizationCodeResponse struct {
	// Errors A list of error responses returned when a request is unsuccessful.
	Errors *ErrorList `json:"errors,omitempty"`

	// Payload A Login with Amazon (LWA) authorization code.
	Payload *AuthorizationCode `json:"payload,omitempty"`
}

GetAuthorizationCodeResponse The response schema for the GetAuthorizationCode operation.

type HttpRequestDoer

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

Doer performs HTTP requests.

The standard http.Client implements this interface.

type RequestEditorFn

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

RequestEditorFn is the function signature for the RequestEditor callback function

type ResponseEditorFn

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

ResponseEditorFn is the function signature for the ResponseEditor callback function

Jump to

Keyboard shortcuts

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