Documentation ¶
Overview ¶
Package listings provides primitives to interact the openapi HTTP API.
Code generated by go-sdk-codegen DO NOT EDIT.
Package listings provides primitives to interact the openapi HTTP API.
Code generated by go-sdk-codegen DO NOT EDIT.
Index ¶
- func NewGetListingsRestrictionsRequest(endpoint string, params *GetListingsRestrictionsParams) (*http.Request, error)
- type Client
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- type ClientWithResponsesInterface
- type Error
- type ErrorList
- type GetListingsRestrictionsParams
- type GetListingsRestrictionsResp
- type HttpRequestDoer
- type Link
- type Reason
- type RequestBeforeFn
- type ResponseAfterFn
- type Restriction
- type RestrictionList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGetListingsRestrictionsRequest ¶
func NewGetListingsRestrictionsRequest(endpoint string, params *GetListingsRestrictionsParams) (*http.Request, error)
NewGetListingsRestrictionsRequest generates requests for GetListingsRestrictions
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. Endpoint string // Doer for performing requests, typically a *http.Client with any // customized settings, such as certificate chains. Client HttpRequestDoer // A callback for modifying requests which are generated before sending over // the network. RequestBefore RequestBeforeFn // A callback for modifying response which are generated before sending over // the network. ResponseAfter ResponseAfterFn // 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(endpoint string, opts ...ClientOption) (*Client, error)
Creates a new Client, with reasonable defaults
func (*Client) GetListingsRestrictions ¶
type ClientInterface ¶
type ClientInterface interface { // GetListingsRestrictions request GetListingsRestrictions(ctx context.Context, params *GetListingsRestrictionsParams) (*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 WithRequestBefore ¶
func WithRequestBefore(fn RequestBeforeFn) ClientOption
WithRequestBefore allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.
func WithResponseAfter ¶
func WithResponseAfter(fn ResponseAfterFn) ClientOption
WithResponseAfter allows setting up a callback function, which will be called right after get response the request. This can be used to log.
func WithUserAgent ¶
func WithUserAgent(userAgent string) ClientOption
WithUserAgent set up useragent add user agent to every request automatically
type ClientWithResponses ¶
type ClientWithResponses struct {
ClientInterface
}
ClientWithResponses builds on ClientInterface to offer response payloads
func NewClientWithResponses ¶
func NewClientWithResponses(endpoint string, opts ...ClientOption) (*ClientWithResponses, error)
NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling
func (*ClientWithResponses) GetListingsRestrictionsWithResponse ¶
func (c *ClientWithResponses) GetListingsRestrictionsWithResponse(ctx context.Context, params *GetListingsRestrictionsParams) (*GetListingsRestrictionsResp, error)
GetListingsRestrictionsWithResponse request returning *GetListingsRestrictionsResponse
type ClientWithResponsesInterface ¶
type ClientWithResponsesInterface interface { // GetListingsRestrictions request GetListingsRestrictionsWithResponse(ctx context.Context, params *GetListingsRestrictionsParams) (*GetListingsRestrictionsResp, error) }
ClientWithResponsesInterface is the interface specification for the client with responses above.
type Error ¶
type Error struct { // An error code that identifies the type of error that occurred. Code string `json:"code"` // Additional details that can help the caller understand or fix the issue. Details *string `json:"details,omitempty"` // A message that describes the error condition. Message string `json:"message"` }
Error defines model for Error.
type GetListingsRestrictionsParams ¶
type GetListingsRestrictionsParams struct { // The Amazon Standard Identification Number (ASIN) of the item. Asin string `json:"asin"` // The condition used to filter restrictions. ConditionType *string `json:"conditionType,omitempty"` // A selling partner identifier, such as a merchant account. SellerId string `json:"sellerId"` // A comma-delimited list of Amazon marketplace identifiers for the request. MarketplaceIds []string `json:"marketplaceIds"` // A locale for reason text localization. When not provided, the default language code of the first marketplace is used. Examples: "en_US", "fr_CA", "fr_FR". Localized messages default to "en_US" when a localization is not available in the specified locale. ReasonLocale *string `json:"reasonLocale,omitempty"` }
GetListingsRestrictionsParams defines parameters for GetListingsRestrictions.
type GetListingsRestrictionsResp ¶
type GetListingsRestrictionsResp struct { Body []byte HTTPResponse *http.Response JSON200 *RestrictionList JSON400 *ErrorList JSON403 *ErrorList JSON404 *ErrorList JSON413 *ErrorList JSON415 *ErrorList JSON429 *ErrorList JSON500 *ErrorList JSON503 *ErrorList }
func ParseGetListingsRestrictionsResp ¶
func ParseGetListingsRestrictionsResp(rsp *http.Response) (*GetListingsRestrictionsResp, error)
ParseGetListingsRestrictionsResp parses an HTTP response from a GetListingsRestrictionsWithResponse call
func (GetListingsRestrictionsResp) Status ¶
func (r GetListingsRestrictionsResp) Status() string
Status returns HTTPResponse.Status
func (GetListingsRestrictionsResp) StatusCode ¶
func (r GetListingsRestrictionsResp) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type HttpRequestDoer ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.
type Link ¶
type Link struct { // The URI of the related resource. Resource string `json:"resource"` // The title of the related resource. Title *string `json:"title,omitempty"` // The media type of the related resource. Type *string `json:"type,omitempty"` // The HTTP verb used to interact with the related resource. Verb string `json:"verb"` }
Link defines model for Link.
type Reason ¶
type Reason struct { // A list of path forward links that may allow Selling Partners to remove the restriction. Links *[]Link `json:"links,omitempty"` // A message describing the reason for the restriction. Message string `json:"message"` // A code indicating why the listing is restricted. ReasonCode *string `json:"reasonCode,omitempty"` }
Reason defines model for Reason.
type RequestBeforeFn ¶
RequestBeforeFn is the function signature for the RequestBefore callback function
type ResponseAfterFn ¶
ResponseAfterFn is the function signature for the ResponseAfter callback function
type Restriction ¶
type Restriction struct { // The condition that applies to the restriction. ConditionType *string `json:"conditionType,omitempty"` // A marketplace identifier. Identifies the Amazon marketplace where the restriction is enforced. MarketplaceId string `json:"marketplaceId"` // A list of reasons for the restriction. Reasons *[]Reason `json:"reasons,omitempty"` }
Restriction defines model for Restriction.
type RestrictionList ¶
type RestrictionList struct {
Restrictions []Restriction `json:"restrictions"`
}
RestrictionList defines model for RestrictionList.