Documentation ¶
Overview ¶
Package tokens20210301 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 ¶
- func NewCreateRestrictedDataTokenRequest(server string, body CreateRestrictedDataTokenJSONRequestBody) (*http.Request, error)
- func NewCreateRestrictedDataTokenRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- type Client
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- func (c *ClientWithResponses) CreateRestrictedDataTokenWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*CreateRestrictedDataTokenResp, error)
- func (c *ClientWithResponses) CreateRestrictedDataTokenWithResponse(ctx context.Context, body CreateRestrictedDataTokenJSONRequestBody) (*CreateRestrictedDataTokenResp, error)
- type ClientWithResponsesInterface
- type CreateRestrictedDataTokenJSONRequestBody
- type CreateRestrictedDataTokenRequest
- type CreateRestrictedDataTokenResp
- type CreateRestrictedDataTokenResponse
- type Error
- type ErrorList
- type HttpRequestDoer
- type RequestEditorFn
- type ResponseEditorFn
- type RestrictedResource
- type RestrictedResourceMethod
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCreateRestrictedDataTokenRequest ¶
func NewCreateRestrictedDataTokenRequest(server string, body CreateRestrictedDataTokenJSONRequestBody) (*http.Request, error)
NewCreateRestrictedDataTokenRequest calls the generic CreateRestrictedDataToken builder with application/json 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) CreateRestrictedDataToken ¶
type ClientInterface ¶
type ClientInterface interface { // CreateRestrictedDataTokenWithBody request with any body CreateRestrictedDataTokenWithBody(ctx context.Context, contentType string, body io.Reader) (*http.Response, error) CreateRestrictedDataToken(ctx context.Context, body CreateRestrictedDataTokenJSONRequestBody) (*http.Response, error) }
The interface specification for the client above.
type ClientOption ¶
ClientOption allows setting custom parameters during construction
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) CreateRestrictedDataTokenWithBodyWithResponse ¶
func (c *ClientWithResponses) CreateRestrictedDataTokenWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*CreateRestrictedDataTokenResp, error)
CreateRestrictedDataTokenWithBodyWithResponse request with arbitrary body returning *CreateRestrictedDataTokenResp
func (*ClientWithResponses) CreateRestrictedDataTokenWithResponse ¶
func (c *ClientWithResponses) CreateRestrictedDataTokenWithResponse(ctx context.Context, body CreateRestrictedDataTokenJSONRequestBody) (*CreateRestrictedDataTokenResp, error)
type ClientWithResponsesInterface ¶
type ClientWithResponsesInterface interface { // CreateRestrictedDataTokenWithBodyWithResponse request with any body CreateRestrictedDataTokenWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*CreateRestrictedDataTokenResp, error) CreateRestrictedDataTokenWithResponse(ctx context.Context, body CreateRestrictedDataTokenJSONRequestBody) (*CreateRestrictedDataTokenResp, error) }
ClientWithResponsesInterface is the interface specification for the client with responses above.
type CreateRestrictedDataTokenJSONRequestBody ¶
type CreateRestrictedDataTokenJSONRequestBody = CreateRestrictedDataTokenRequest
CreateRestrictedDataTokenJSONRequestBody defines body for CreateRestrictedDataToken for application/json ContentType.
type CreateRestrictedDataTokenRequest ¶
type CreateRestrictedDataTokenRequest struct { // RestrictedResources A list of restricted resources. // Maximum: 50 RestrictedResources []RestrictedResource `json:"restrictedResources"` // TargetApplication The application ID for the target application to which access is being delegated. TargetApplication *string `json:"targetApplication,omitempty"` }
CreateRestrictedDataTokenRequest The request schema for the createRestrictedDataToken operation.
type CreateRestrictedDataTokenResp ¶
type CreateRestrictedDataTokenResp struct { Body []byte HTTPResponse *http.Response JSON200 *CreateRestrictedDataTokenResponse JSON400 *ErrorList JSON401 *ErrorList JSON403 *ErrorList JSON404 *ErrorList JSON415 *ErrorList JSON429 *ErrorList JSON500 *ErrorList JSON503 *ErrorList }
func ParseCreateRestrictedDataTokenResp ¶
func ParseCreateRestrictedDataTokenResp(rsp *http.Response) (*CreateRestrictedDataTokenResp, error)
ParseCreateRestrictedDataTokenResp parses an HTTP response from a CreateRestrictedDataTokenWithResponse call
func (CreateRestrictedDataTokenResp) Status ¶
func (r CreateRestrictedDataTokenResp) Status() string
Status returns HTTPResponse.Status
func (CreateRestrictedDataTokenResp) StatusCode ¶
func (r CreateRestrictedDataTokenResp) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type CreateRestrictedDataTokenResponse ¶
type CreateRestrictedDataTokenResponse struct { // ExpiresIn The lifetime of the Restricted Data Token, in seconds. ExpiresIn *int `json:"expiresIn,omitempty"` // RestrictedDataToken A Restricted Data Token (RDT). This is a short-lived access token that authorizes calls to restricted operations. Pass this value with the x-amz-access-token header when making subsequent calls to these restricted resources. RestrictedDataToken *string `json:"restrictedDataToken,omitempty"` }
CreateRestrictedDataTokenResponse The response schema for the createRestrictedDataToken operation.
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. Message string `json:"message"` }
Error An error response returned when the request is unsuccessful.
type ErrorList ¶
type ErrorList struct {
Errors *[]Error `json:"errors,omitempty"`
}
ErrorList A list of error responses returned when a request is unsuccessful.
type HttpRequestDoer ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.
type RequestEditorFn ¶
RequestEditorFn is the function signature for the RequestEditor callback function
type ResponseEditorFn ¶
ResponseEditorFn is the function signature for the ResponseEditor callback function
type RestrictedResource ¶
type RestrictedResource struct { // DataElements Indicates the type of Personally Identifiable Information requested. This parameter is required only when getting an RDT for use with the getOrder, getOrders, or getOrderItems operation of the Orders API. For more information, see the [Tokens API Use Case Guide](doc:tokens-api-use-case-guide). Possible values include: // - **buyerInfo**. On the order level this includes general identifying information about the buyer and tax-related information. On the order item level this includes gift wrap information and custom order information, if available. // - **shippingAddress**. This includes information for fulfilling orders. // - **buyerTaxInformation**. This includes information for issuing tax invoices. DataElements *[]string `json:"dataElements,omitempty"` // Method The HTTP method in the restricted resource. Method RestrictedResourceMethod `json:"method"` // Path The path in the restricted resource. Here are some path examples: // - “`/orders/v0/orders“`. For getting an RDT for the getOrders operation of the Orders API. For bulk orders. // - “`/orders/v0/orders/123-1234567-1234567“`. For getting an RDT for the getOrder operation of the Orders API. For a specific order. // - “`/orders/v0/orders/123-1234567-1234567/orderItems“`. For getting an RDT for the getOrderItems operation of the Orders API. For the order items in a specific order. // - “`/mfn/v0/shipments/FBA1234ABC5D“`. For getting an RDT for the getShipment operation of the Shipping API. For a specific shipment. // - “`/mfn/v0/shipments/{shipmentId}“`. For getting an RDT for the getShipment operation of the Shipping API. For any of a selling partner's shipments that you specify when you call the getShipment operation. Path string `json:"path"` }
RestrictedResource Model of a restricted resource.
type RestrictedResourceMethod ¶
type RestrictedResourceMethod string
RestrictedResourceMethod The HTTP method in the restricted resource.
const ( DELETE RestrictedResourceMethod = "DELETE" GET RestrictedResourceMethod = "GET" POST RestrictedResourceMethod = "POST" PUT RestrictedResourceMethod = "PUT" )
Defines values for RestrictedResourceMethod.