swagger

package
v0.0.0-...-c324a2f Latest Latest
Warning

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

Go to latest
Published: May 6, 2023 License: MIT Imports: 21 Imported by: 0

README

Go API client for swagger

The Selling Partner API for Feeds lets you upload data to Amazon on behalf of a selling partner.

Overview

This API client was generated by the swagger-codegen project. By using the swagger-spec from a remote server, you can easily generate an API client.

Installation

Put the package under your project folder and add the following in import:

import "./swagger"

Documentation for API Endpoints

All URIs are relative to https://sellingpartnerapi-na.amazon.com/

Class Method HTTP request Description
FeedsApi CancelFeed Delete /feeds/2021-06-30/feeds/{feedId}
FeedsApi CreateFeed Post /feeds/2021-06-30/feeds
FeedsApi CreateFeedDocument Post /feeds/2021-06-30/documents
FeedsApi GetFeed Get /feeds/2021-06-30/feeds/{feedId}
FeedsApi GetFeedDocument Get /feeds/2021-06-30/documents/{feedDocumentId}
FeedsApi GetFeeds Get /feeds/2021-06-30/feeds

Documentation For Models

Documentation For Authorization

Endpoints do not require authorization.

Author

Documentation

Overview

* Selling Partner API for Feeds * * The Selling Partner API for Feeds lets you upload data to Amazon on behalf of a selling partner. * * API version: 2021-06-30 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Selling Partner API for Feeds * * The Selling Partner API for Feeds lets you upload data to Amazon on behalf of a selling partner. * * API version: 2021-06-30 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Selling Partner API for Feeds * * The Selling Partner API for Feeds lets you upload data to Amazon on behalf of a selling partner. * * API version: 2021-06-30 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Selling Partner API for Feeds * * The Selling Partner API for Feeds lets you upload data to Amazon on behalf of a selling partner. * * API version: 2021-06-30 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Selling Partner API for Feeds * * The Selling Partner API for Feeds lets you upload data to Amazon on behalf of a selling partner. * * API version: 2021-06-30 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Selling Partner API for Feeds * * The Selling Partner API for Feeds lets you upload data to Amazon on behalf of a selling partner. * * API version: 2021-06-30 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Selling Partner API for Feeds * * The Selling Partner API for Feeds lets you upload data to Amazon on behalf of a selling partner. * * API version: 2021-06-30 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Selling Partner API for Feeds * * The Selling Partner API for Feeds lets you upload data to Amazon on behalf of a selling partner. * * API version: 2021-06-30 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Selling Partner API for Feeds * * The Selling Partner API for Feeds lets you upload data to Amazon on behalf of a selling partner. * * API version: 2021-06-30 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Selling Partner API for Feeds * * The Selling Partner API for Feeds lets you upload data to Amazon on behalf of a selling partner. * * API version: 2021-06-30 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Selling Partner API for Feeds * * The Selling Partner API for Feeds lets you upload data to Amazon on behalf of a selling partner. * * API version: 2021-06-30 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Selling Partner API for Feeds * * The Selling Partner API for Feeds lets you upload data to Amazon on behalf of a selling partner. * * API version: 2021-06-30 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Selling Partner API for Feeds * * The Selling Partner API for Feeds lets you upload data to Amazon on behalf of a selling partner. * * API version: 2021-06-30 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

Index

Constants

This section is empty.

Variables

View Source
var (
	// ContextOAuth2 takes a oauth2.TokenSource as authentication for the request.
	ContextOAuth2 = contextKey("token")

	// ContextBasicAuth takes BasicAuth as authentication for the request.
	ContextBasicAuth = contextKey("basic")

	// ContextAccessToken takes a string oauth2 access token as authentication for the request.
	ContextAccessToken = contextKey("accesstoken")

	// ContextAPIKey takes an APIKey as authentication for the request
	ContextAPIKey = contextKey("apikey")
)

Functions

func CacheExpires

func CacheExpires(r *http.Response) time.Time

CacheExpires helper function to determine remaining time before repeating a request.

Types

type APIClient

type APIClient struct {
	FeedsApi *FeedsApiService
	// contains filtered or unexported fields
}

APIClient manages communication with the Selling Partner API for Feeds API v2021-06-30 In most cases there should be only one, shared, APIClient.

func NewAPIClient

func NewAPIClient(cfg *Configuration) *APIClient

NewAPIClient creates a new API client. Requires a userAgent string describing your application. optionally a custom http.Client to allow for advanced features such as caching.

func (*APIClient) ChangeBasePath

func (c *APIClient) ChangeBasePath(path string)

Change base path to allow switching to mocks

type APIKey

type APIKey struct {
	Key    string
	Prefix string
}

APIKey provides API key based authentication to a request passed via context using ContextAPIKey

type APIResponse

type APIResponse struct {
	*http.Response `json:"-"`
	Message        string `json:"message,omitempty"`
	// Operation is the name of the swagger operation.
	Operation string `json:"operation,omitempty"`
	// RequestURL is the request URL. This value is always available, even if the
	// embedded *http.Response is nil.
	RequestURL string `json:"url,omitempty"`
	// Method is the HTTP method used for the request.  This value is always
	// available, even if the embedded *http.Response is nil.
	Method string `json:"method,omitempty"`
	// Payload holds the contents of the response body (which may be nil or empty).
	// This is provided here as the raw response.Body() reader will have already
	// been drained.
	Payload []byte `json:"-"`
}

func NewAPIResponse

func NewAPIResponse(r *http.Response) *APIResponse

func NewAPIResponseWithError

func NewAPIResponseWithError(errorMessage string) *APIResponse

type BasicAuth

type BasicAuth struct {
	UserName string `json:"userName,omitempty"`
	Password string `json:"password,omitempty"`
}

BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth

type Configuration

type Configuration struct {
	BasePath      string            `json:"basePath,omitempty"`
	Host          string            `json:"host,omitempty"`
	Scheme        string            `json:"scheme,omitempty"`
	DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
	UserAgent     string            `json:"userAgent,omitempty"`
	HTTPClient    *http.Client
}

func NewConfiguration

func NewConfiguration() *Configuration

func (*Configuration) AddDefaultHeader

func (c *Configuration) AddDefaultHeader(key string, value string)

type CreateFeedDocumentResponse

type CreateFeedDocumentResponse struct {
	// The identifier of the feed document.
	FeedDocumentId string `json:"feedDocumentId"`
	// The presigned URL for uploading the feed contents. This URL expires after 5 minutes.
	Url string `json:"url"`
}

Information required to upload a feed document's contents.

type CreateFeedDocumentSpecification

type CreateFeedDocumentSpecification struct {
	// The content type of the feed.
	ContentType string `json:"contentType"`
}

Specifies the content type for the createFeedDocument operation.

type CreateFeedResponse

type CreateFeedResponse struct {
	// The identifier for the feed. This identifier is unique only in combination with a seller ID.
	FeedId string `json:"feedId"`
}

Response schema.

type CreateFeedSpecification

type CreateFeedSpecification struct {
	// The feed type.
	FeedType string `json:"feedType"`
	// A list of identifiers for marketplaces that you want the feed to be applied to.
	MarketplaceIds []string `json:"marketplaceIds"`
	// The document identifier returned by the createFeedDocument operation. Upload the feed document contents before calling the createFeed operation.
	InputFeedDocumentId string             `json:"inputFeedDocumentId"`
	FeedOptions         *map[string]string `json:"feedOptions,omitempty"`
}

Information required to create the feed.

type ErrorList

type ErrorList struct {
	Errors []ModelError `json:"errors"`
}

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

type Feed

type Feed struct {
	// The identifier for the feed. This identifier is unique only in combination with a seller ID.
	FeedId string `json:"feedId"`
	// The feed type.
	FeedType string `json:"feedType"`
	// A list of identifiers for the marketplaces that the feed is applied to.
	MarketplaceIds []string `json:"marketplaceIds,omitempty"`
	// The date and time when the feed was created, in ISO 8601 date time format.
	CreatedTime time.Time `json:"createdTime"`
	// The processing status of the feed.
	ProcessingStatus string `json:"processingStatus"`
	// The date and time when feed processing started, in ISO 8601 date time format.
	ProcessingStartTime time.Time `json:"processingStartTime,omitempty"`
	// The date and time when feed processing completed, in ISO 8601 date time format.
	ProcessingEndTime time.Time `json:"processingEndTime,omitempty"`
	// The identifier for the feed document. This identifier is unique only in combination with a seller ID.
	ResultFeedDocumentId string `json:"resultFeedDocumentId,omitempty"`
}

Detailed information about the feed.

type FeedDocument

type FeedDocument struct {
	// The identifier for the feed document. This identifier is unique only in combination with a seller ID.
	FeedDocumentId string `json:"feedDocumentId"`
	// A presigned URL for the feed document. If `compressionAlgorithm` is not returned, you can download the feed directly from this URL. This URL expires after 5 minutes.
	Url string `json:"url"`
	// If the feed document contents have been compressed, the compression algorithm used is returned in this property and you must decompress the feed when you download. Otherwise, you can download the feed directly. Refer to [Step 7. Download the feed processing report](doc:feeds-api-v2021-06-30-use-case-guide#step-7-download-the-feed-processing-report) in the use case guide, where sample code is provided.
	CompressionAlgorithm string `json:"compressionAlgorithm,omitempty"`
}

Information required for the feed document.

type FeedsApiGetFeedsOpts

type FeedsApiGetFeedsOpts struct {
	FeedTypes          optional.Interface
	MarketplaceIds     optional.Interface
	PageSize           optional.Int32
	ProcessingStatuses optional.Interface
	CreatedSince       optional.Time
	CreatedUntil       optional.Time
	NextToken          optional.String
}

type FeedsApiService

type FeedsApiService service

func (*FeedsApiService) CancelFeed

func (a *FeedsApiService) CancelFeed(ctx context.Context, feedId string) (*http.Response, error)

FeedsApiService Cancels the feed that you specify. Only feeds with processingStatus=IN_QUEUE can be cancelled. Cancelled feeds are returned in subsequent calls to the getFeed and getFeeds operations. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param feedId The identifier for the feed. This identifier is unique only in combination with a seller ID.

func (*FeedsApiService) CreateFeed

FeedsApiService Creates a feed. Upload the contents of the feed document before calling this operation. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0083 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param body

@return CreateFeedResponse

func (*FeedsApiService) CreateFeedDocument

FeedsApiService Creates a feed document for the feed type that you specify. This operation returns a presigned URL for uploading the feed document contents. It also returns a feedDocumentId value that you can pass in with a subsequent call to the createFeed operation. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param body

@return CreateFeedDocumentResponse

func (*FeedsApiService) GetFeed

func (a *FeedsApiService) GetFeed(ctx context.Context, feedId string) (Feed, *http.Response, error)

FeedsApiService Returns feed details (including the resultDocumentId, if available) for the feed that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 15 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param feedId The identifier for the feed. This identifier is unique only in combination with a seller ID.

@return Feed

func (*FeedsApiService) GetFeedDocument

func (a *FeedsApiService) GetFeedDocument(ctx context.Context, feedDocumentId string) (FeedDocument, *http.Response, error)

FeedsApiService Returns the information required for retrieving a feed document's contents. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0222 | 10 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param feedDocumentId The identifier of the feed document.

@return FeedDocument

func (*FeedsApiService) GetFeeds

func (a *FeedsApiService) GetFeeds(ctx context.Context, localVarOptionals *FeedsApiGetFeedsOpts) (GetFeedsResponse, *http.Response, error)

type GenericSwaggerError

type GenericSwaggerError struct {
	// contains filtered or unexported fields
}

GenericSwaggerError Provides access to the body, error and model on returned errors.

func (GenericSwaggerError) Body

func (e GenericSwaggerError) Body() []byte

Body returns the raw bytes of the response

func (GenericSwaggerError) Error

func (e GenericSwaggerError) Error() string

Error returns non-empty string if there was an error.

func (GenericSwaggerError) Model

func (e GenericSwaggerError) Model() interface{}

Model returns the unpacked model of the error

type GetFeedsResponse

type GetFeedsResponse struct {
	Feeds *[]Feed `json:"feeds"`
	// Returned when the number of results exceeds pageSize. To get the next page of results, call the getFeeds operation with this token as the only parameter.
	NextToken string `json:"nextToken,omitempty"`
}

Response schema.

type ModelError

type ModelError struct {
	// An error code that identifies the type of error that occurred.
	Code string `json:"code"`
	// A message that describes the error condition in a human-readable form.
	Message string `json:"message"`
	// Additional details that can help the caller understand or fix the issue.
	Details string `json:"details,omitempty"`
}

An error response returned when the request is unsuccessful.

Jump to

Keyboard shortcuts

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