productselector

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 productselector 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 NewProductMetadataRequestWithApplicationVndProductmetadatarequestV1PlusJSONBody

func NewProductMetadataRequestWithApplicationVndProductmetadatarequestV1PlusJSONBody(server string, params *ProductMetadataParams, body ProductMetadataApplicationVndProductmetadatarequestV1PlusJSONRequestBody) (*http.Request, error)

NewProductMetadataRequestWithApplicationVndProductmetadatarequestV1PlusJSONBody calls the generic ProductMetadata builder with application/vnd.productmetadatarequest.v1+json body

func NewProductMetadataRequestWithBody

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

NewProductMetadataRequestWithBody generates requests for ProductMetadata with any type of body

Types

type BasisPrice

type BasisPrice struct {
	// Amount Price amount
	Amount *float32 `json:"amount,omitempty"`

	// Currency Currency of the price
	Currency *string `json:"currency,omitempty"`
}

BasisPrice The basis price before the savings are calculated

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

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

type ClientInterface

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

	ProductMetadataWithApplicationVndProductmetadatarequestV1PlusJSONBody(ctx context.Context, params *ProductMetadataParams, body ProductMetadataApplicationVndProductmetadatarequestV1PlusJSONRequestBody) (*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) ProductMetadataWithBodyWithResponse

func (c *ClientWithResponses) ProductMetadataWithBodyWithResponse(ctx context.Context, params *ProductMetadataParams, contentType string, body io.Reader) (*ProductMetadataResp, error)

ProductMetadataWithBodyWithResponse request with arbitrary body returning *ProductMetadataResp

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// ProductMetadataWithBodyWithResponse request with any body
	ProductMetadataWithBodyWithResponse(ctx context.Context, params *ProductMetadataParams, contentType string, body io.Reader) (*ProductMetadataResp, error)

	ProductMetadataWithApplicationVndProductmetadatarequestV1PlusJSONBodyWithResponse(ctx context.Context, params *ProductMetadataParams, body ProductMetadataApplicationVndProductmetadatarequestV1PlusJSONRequestBody) (*ProductMetadataResp, error)
}

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

type Error

type Error struct {
	// Code Enumerated error type.
	Code *string `json:"code,omitempty"`

	// Details A human-readable description of the response.
	Details *string `json:"details,omitempty"`
}

Error 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 PriceToPay

type PriceToPay struct {
	// Amount Price amount
	Amount *float32 `json:"amount,omitempty"`

	// Currency Currency of the price
	Currency *string `json:"currency,omitempty"`
}

PriceToPay The price customer would pay for the buying option

type ProductMetadataApplicationVndProductmetadatarequestV1PlusJSONRequestBody

type ProductMetadataApplicationVndProductmetadatarequestV1PlusJSONRequestBody = ProductMetadataRequest

ProductMetadataApplicationVndProductmetadatarequestV1PlusJSONRequestBody defines body for ProductMetadata for application/vnd.productmetadatarequest.v1+json ContentType.

type ProductMetadataModel

type ProductMetadataModel struct {
	// Asin ASIN of the item
	Asin *string `json:"asin,omitempty"`

	// Availability Stock availability:
	//  * IN_STOCK - The item is in stock.
	//  * IN_STOCK_SCARCE - The item is in stock, but stock levels are limited.
	//  * OUT_OF_STOCK - The item is currently out of stock.
	//  * PREORDER - The item is not yet available, but can be pre-ordered.
	//  * LEADTIME - The item is only available after some amount of lead time.
	//  * AVAILABLE_DATE - The item is not available, but will be available on a future date.
	Availability *string `json:"availability,omitempty"`

	// BasisPrice The basis price before the savings are calculated
	BasisPrice *BasisPrice `json:"basisPrice,omitempty"`

	// BestSellerRank Best seller rank position in the category
	BestSellerRank *string `json:"bestSellerRank,omitempty"`

	// Brand Brand name of the item
	Brand *string `json:"brand,omitempty"`

	// Category Category (browse node) name of the ASIN
	Category *string `json:"category,omitempty"`

	// CreatedDate Date the item was first available on Amazon
	CreatedDate *string `json:"createdDate,omitempty"`

	// EligibilityStatus Eligibility status for advertising:
	//  * ELIGIBLE - Eligible for advertising
	//  * INELIGIBLE - Ineligible for advertising
	EligibilityStatus *string `json:"eligibilityStatus,omitempty"`

	// ImageUrl Url to the product image
	ImageUrl *string `json:"imageUrl,omitempty"`

	// IneligibilityCodes List of ineligible status identifier
	IneligibilityCodes *[]string `json:"ineligibilityCodes,omitempty"`

	// IneligibilityReasons List of reasons that made this item ineligible to be advertised
	IneligibilityReasons *[]string `json:"ineligibilityReasons,omitempty"`

	// PriceToPay The price customer would pay for the buying option
	PriceToPay *PriceToPay `json:"priceToPay,omitempty"`

	// Sku sku of the item
	Sku *string `json:"sku,omitempty"`

	// Title Product title of the item
	Title *string `json:"title,omitempty"`

	// VariationList List of ASIN variations of the current item
	VariationList *[]string `json:"variationList,omitempty"`
}

ProductMetadataModel defines model for ProductMetadataModel.

type ProductMetadataParams

type ProductMetadataParams struct {
	// 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 and choose profile id `profileId` from the response to pass it as input.
	AmazonAdvertisingAPIScope string `json:"Amazon-Advertising-API-Scope"`
}

ProductMetadataParams defines parameters for ProductMetadata.

type ProductMetadataRequest

type ProductMetadataRequest struct {
	// AdType Program type. Required if checks advertising eligibility:
	//  * SP - Sponsored Product
	//  * SB - Sponsored Brand
	//  * SD - Sponsored Display
	AdType *ProductMetadataRequestAdType `json:"adType,omitempty"`

	// Asins Specific asins to search for in the advertiser's inventory. Cannot use together with skus or searchStr input types.
	Asins *[]string `json:"asins,omitempty"`

	// CheckEligibility Whether advertising eligibility info is required
	CheckEligibility *bool `json:"checkEligibility,omitempty"`

	// CheckItemDetails Whether item details such as name, image, and price is required.
	CheckItemDetails *bool `json:"checkItemDetails,omitempty"`

	// CursorToken Pagination token used for the suggested sort type or for author merchant
	CursorToken *string `json:"cursorToken,omitempty"`

	// Locale Optional locale for detail and eligibility response strings. Default to the marketplace locale.
	Locale *string `json:"locale,omitempty"`

	// PageIndex Index of the page to be returned; For author, this value will be ignored, should use cursorToken instead. For seller, results are capped at 10k(pageIndex * pageSize). For vendor, results are capped at 50k.
	PageIndex int32 `json:"pageIndex"`

	// PageSize Number of items to be returned on this page index.
	PageSize int32 `json:"pageSize"`

	// SearchStr Specific string in the item title to search for in the advertiser's inventory. Case insensitive. Cannot use together with asins or skus input types.
	SearchStr *string `json:"searchStr,omitempty"`

	// Skus Specific SKUs to search for in the advertiser's inventory. Currently only support SP program type for sellers. Cannot use together with asins or searchStr input types.
	Skus *[]string `json:"skus,omitempty"`

	// SortBy Sort option for the result. Currently only support SP program type for sellers:
	//  * SUGGESTED - Suggested products are those most likely to engage customers, and have a higher chance of generating clicks if advertised.
	//  * CREATED_DATE - Date the item listing was created
	SortBy *ProductMetadataRequestSortBy `json:"sortBy,omitempty"`

	// SortOrder Sort order (has to be DESC for the suggested sort type):
	//  * ASC - Ascending, from A to Z
	//  * DESC - Descending, from Z to A
	SortOrder *ProductMetadataRequestSortOrder `json:"sortOrder,omitempty"`
}

ProductMetadataRequest defines model for ProductMetadataRequest.

type ProductMetadataRequestAdType

type ProductMetadataRequestAdType string

ProductMetadataRequestAdType Program type. Required if checks advertising eligibility:

  • SP - Sponsored Product
  • SB - Sponsored Brand
  • SD - Sponsored Display

Defines values for ProductMetadataRequestAdType.

type ProductMetadataRequestSortBy

type ProductMetadataRequestSortBy string

ProductMetadataRequestSortBy Sort option for the result. Currently only support SP program type for sellers:

  • SUGGESTED - Suggested products are those most likely to engage customers, and have a higher chance of generating clicks if advertised.
  • CREATED_DATE - Date the item listing was created
const (
	CREATEDDATE ProductMetadataRequestSortBy = "CREATED_DATE"
	SUGGESTED   ProductMetadataRequestSortBy = "SUGGESTED"
)

Defines values for ProductMetadataRequestSortBy.

type ProductMetadataRequestSortOrder

type ProductMetadataRequestSortOrder string

ProductMetadataRequestSortOrder Sort order (has to be DESC for the suggested sort type):

  • ASC - Ascending, from A to Z
  • DESC - Descending, from Z to A

Defines values for ProductMetadataRequestSortOrder.

type ProductMetadataResp

type ProductMetadataResp struct {
	Body                                           []byte
	HTTPResponse                                   *http.Response
	ApplicationvndProductmetadataresponseV1JSON200 *ProductMetadataResponse
	JSON400                                        *Error
	JSON401                                        *Error
	JSON403                                        *Error
	JSON404                                        *Error
	JSON429                                        *Error
	JSON500                                        *Error
}

func ParseProductMetadataResp

func ParseProductMetadataResp(rsp *http.Response) (*ProductMetadataResp, error)

ParseProductMetadataResp parses an HTTP response from a ProductMetadataWithResponse call

func (ProductMetadataResp) Status

func (r ProductMetadataResp) Status() string

Status returns HTTPResponse.Status

func (ProductMetadataResp) StatusCode

func (r ProductMetadataResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ProductMetadataResponse

type ProductMetadataResponse struct {
	ProductMetadataList *[]ProductMetadataModel `json:"ProductMetadataList,omitempty"`

	// CursorToken Pagination token for later requests with specific sort type to use as the page index instead. Empty cursorToken means no further data is present at Server side.
	CursorToken *string `json:"cursorToken,omitempty"`
}

ProductMetadataResponse defines model for ProductMetadataResponse.

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

Jump to

Keyboard shortcuts

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