feeds

package
v0.0.0-...-1bcf55c Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package feeds provides primitives to interact the openapi HTTP API.

Code generated by go-sdk-codegen DO NOT EDIT.

Package feeds provides primitives to interact the openapi HTTP API.

Code generated by go-sdk-codegen DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCancelFeedRequest

func NewCancelFeedRequest(endpoint string, feedId string) (*http.Request, error)

NewCancelFeedRequest generates requests for CancelFeed

func NewCreateFeedDocumentRequest

func NewCreateFeedDocumentRequest(endpoint string, body CreateFeedDocumentJSONRequestBody) (*http.Request, error)

NewCreateFeedDocumentRequest calls the generic CreateFeedDocument builder with application/json body

func NewCreateFeedDocumentRequestWithBody

func NewCreateFeedDocumentRequestWithBody(endpoint string, contentType string, body io.Reader) (*http.Request, error)

NewCreateFeedDocumentRequestWithBody generates requests for CreateFeedDocument with any type of body

func NewCreateFeedRequest

func NewCreateFeedRequest(endpoint string, body CreateFeedJSONRequestBody) (*http.Request, error)

NewCreateFeedRequest calls the generic CreateFeed builder with application/json body

func NewCreateFeedRequestWithBody

func NewCreateFeedRequestWithBody(endpoint string, contentType string, body io.Reader) (*http.Request, error)

NewCreateFeedRequestWithBody generates requests for CreateFeed with any type of body

func NewGetFeedDocumentRequest

func NewGetFeedDocumentRequest(endpoint string, feedDocumentId string) (*http.Request, error)

NewGetFeedDocumentRequest generates requests for GetFeedDocument

func NewGetFeedRequest

func NewGetFeedRequest(endpoint string, feedId string) (*http.Request, error)

NewGetFeedRequest generates requests for GetFeed

func NewGetFeedsRequest

func NewGetFeedsRequest(endpoint string, params *GetFeedsParams) (*http.Request, error)

NewGetFeedsRequest generates requests for GetFeeds

Types

type CancelFeedResp

type CancelFeedResp struct {
	Body         []byte
	HTTPResponse *http.Response
	Model        *CancelFeedResponse
}

func ParseCancelFeedResp

func ParseCancelFeedResp(rsp *http.Response) (*CancelFeedResp, error)

ParseCancelFeedResp parses an HTTP response from a CancelFeedWithResponse call

func (CancelFeedResp) Status

func (r CancelFeedResp) Status() string

Status returns HTTPResponse.Status

func (CancelFeedResp) StatusCode

func (r CancelFeedResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CancelFeedResponse

type CancelFeedResponse struct {

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

CancelFeedResponse defines model for CancelFeedResponse.

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

func (c *Client) CancelFeed(ctx context.Context, feedId string) (*http.Response, error)

func (*Client) CreateFeed

func (c *Client) CreateFeed(ctx context.Context, body CreateFeedJSONRequestBody) (*http.Response, error)

func (*Client) CreateFeedDocument

func (c *Client) CreateFeedDocument(ctx context.Context, body CreateFeedDocumentJSONRequestBody) (*http.Response, error)

func (*Client) CreateFeedDocumentWithBody

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

func (*Client) CreateFeedWithBody

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

func (*Client) GetFeed

func (c *Client) GetFeed(ctx context.Context, feedId string) (*http.Response, error)

func (*Client) GetFeedDocument

func (c *Client) GetFeedDocument(ctx context.Context, feedDocumentId string) (*http.Response, error)

func (*Client) GetFeeds

func (c *Client) GetFeeds(ctx context.Context, params *GetFeedsParams) (*http.Response, error)

type ClientInterface

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

	CreateFeedDocument(ctx context.Context, body CreateFeedDocumentJSONRequestBody) (*http.Response, error)

	// GetFeedDocument request
	GetFeedDocument(ctx context.Context, feedDocumentId string) (*http.Response, error)

	// GetFeeds request
	GetFeeds(ctx context.Context, params *GetFeedsParams) (*http.Response, error)

	// CreateFeed request  with any body
	CreateFeedWithBody(ctx context.Context, contentType string, body io.Reader) (*http.Response, error)

	CreateFeed(ctx context.Context, body CreateFeedJSONRequestBody) (*http.Response, error)

	// CancelFeed request
	CancelFeed(ctx context.Context, feedId string) (*http.Response, error)

	// GetFeed request
	GetFeed(ctx context.Context, feedId string) (*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 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) CancelFeedWithResponse

func (c *ClientWithResponses) CancelFeedWithResponse(ctx context.Context, feedId string) (*CancelFeedResp, error)

CancelFeedWithResponse request returning *CancelFeedResponse

func (*ClientWithResponses) CreateFeedDocumentWithBodyWithResponse

func (c *ClientWithResponses) CreateFeedDocumentWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*CreateFeedDocumentResp, error)

CreateFeedDocumentWithBodyWithResponse request with arbitrary body returning *CreateFeedDocumentResponse

func (*ClientWithResponses) CreateFeedDocumentWithResponse

func (c *ClientWithResponses) CreateFeedDocumentWithResponse(ctx context.Context, body CreateFeedDocumentJSONRequestBody) (*CreateFeedDocumentResp, error)

func (*ClientWithResponses) CreateFeedWithBodyWithResponse

func (c *ClientWithResponses) CreateFeedWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*CreateFeedResp, error)

CreateFeedWithBodyWithResponse request with arbitrary body returning *CreateFeedResponse

func (*ClientWithResponses) CreateFeedWithResponse

func (c *ClientWithResponses) CreateFeedWithResponse(ctx context.Context, body CreateFeedJSONRequestBody) (*CreateFeedResp, error)

func (*ClientWithResponses) GetFeedDocumentWithResponse

func (c *ClientWithResponses) GetFeedDocumentWithResponse(ctx context.Context, feedDocumentId string) (*GetFeedDocumentResp, error)

GetFeedDocumentWithResponse request returning *GetFeedDocumentResponse

func (*ClientWithResponses) GetFeedWithResponse

func (c *ClientWithResponses) GetFeedWithResponse(ctx context.Context, feedId string) (*GetFeedResp, error)

GetFeedWithResponse request returning *GetFeedResponse

func (*ClientWithResponses) GetFeedsWithResponse

func (c *ClientWithResponses) GetFeedsWithResponse(ctx context.Context, params *GetFeedsParams) (*GetFeedsResp, error)

GetFeedsWithResponse request returning *GetFeedsResponse

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// CreateFeedDocument request  with any body
	CreateFeedDocumentWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*CreateFeedDocumentResp, error)

	CreateFeedDocumentWithResponse(ctx context.Context, body CreateFeedDocumentJSONRequestBody) (*CreateFeedDocumentResp, error)

	// GetFeedDocument request
	GetFeedDocumentWithResponse(ctx context.Context, feedDocumentId string) (*GetFeedDocumentResp, error)

	// GetFeeds request
	GetFeedsWithResponse(ctx context.Context, params *GetFeedsParams) (*GetFeedsResp, error)

	// CreateFeed request  with any body
	CreateFeedWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*CreateFeedResp, error)

	CreateFeedWithResponse(ctx context.Context, body CreateFeedJSONRequestBody) (*CreateFeedResp, error)

	// CancelFeed request
	CancelFeedWithResponse(ctx context.Context, feedId string) (*CancelFeedResp, error)

	// GetFeed request
	GetFeedWithResponse(ctx context.Context, feedId string) (*GetFeedResp, error)
}

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

type CreateFeedDocumentJSONBody

type CreateFeedDocumentJSONBody CreateFeedDocumentSpecification

CreateFeedDocumentJSONBody defines parameters for CreateFeedDocument.

type CreateFeedDocumentJSONRequestBody

type CreateFeedDocumentJSONRequestBody CreateFeedDocumentJSONBody

CreateFeedDocumentRequestBody defines body for CreateFeedDocument for application/json ContentType.

type CreateFeedDocumentResp

type CreateFeedDocumentResp struct {
	Body         []byte
	HTTPResponse *http.Response
	Model        *CreateFeedDocumentResponse
}

func ParseCreateFeedDocumentResp

func ParseCreateFeedDocumentResp(rsp *http.Response) (*CreateFeedDocumentResp, error)

ParseCreateFeedDocumentResp parses an HTTP response from a CreateFeedDocumentWithResponse call

func (CreateFeedDocumentResp) Status

func (r CreateFeedDocumentResp) Status() string

Status returns HTTPResponse.Status

func (CreateFeedDocumentResp) StatusCode

func (r CreateFeedDocumentResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CreateFeedDocumentResponse

type CreateFeedDocumentResponse struct {

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

	// Information required to encrypt and upload a feed document's contents.
	Payload *CreateFeedDocumentResult `json:"payload,omitempty"`
}

CreateFeedDocumentResponse defines model for CreateFeedDocumentResponse.

type CreateFeedDocumentResult

type CreateFeedDocumentResult struct {

	// Encryption details for required client-side encryption and decryption of document contents.
	EncryptionDetails FeedDocumentEncryptionDetails `json:"encryptionDetails"`

	// 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"`
}

CreateFeedDocumentResult defines model for CreateFeedDocumentResult.

type CreateFeedDocumentSpecification

type CreateFeedDocumentSpecification struct {

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

CreateFeedDocumentSpecification defines model for CreateFeedDocumentSpecification.

type CreateFeedJSONBody

type CreateFeedJSONBody CreateFeedSpecification

CreateFeedJSONBody defines parameters for CreateFeed.

type CreateFeedJSONRequestBody

type CreateFeedJSONRequestBody CreateFeedJSONBody

CreateFeedRequestBody defines body for CreateFeed for application/json ContentType.

type CreateFeedResp

type CreateFeedResp struct {
	Body         []byte
	HTTPResponse *http.Response
	Model        *CreateFeedResponse
}

func ParseCreateFeedResp

func ParseCreateFeedResp(rsp *http.Response) (*CreateFeedResp, error)

ParseCreateFeedResp parses an HTTP response from a CreateFeedWithResponse call

func (CreateFeedResp) Status

func (r CreateFeedResp) Status() string

Status returns HTTPResponse.Status

func (CreateFeedResp) StatusCode

func (r CreateFeedResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CreateFeedResponse

type CreateFeedResponse struct {

	// A list of error responses returned when a request is unsuccessful.
	Errors  *ErrorList        `json:"errors,omitempty"`
	Payload *CreateFeedResult `json:"payload,omitempty"`
}

CreateFeedResponse defines model for CreateFeedResponse.

type CreateFeedResult

type CreateFeedResult struct {

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

CreateFeedResult defines model for CreateFeedResult.

type CreateFeedSpecification

type CreateFeedSpecification struct {

	// Additional options to control the feed. These vary by feed type.
	FeedOptions *FeedOptions `json:"feedOptions,omitempty"`

	// The feed type.
	FeedType string `json:"feedType"`

	// The document identifier returned by the createFeedDocument operation. Encrypt and upload the feed document contents before calling the createFeed operation.
	InputFeedDocumentId string `json:"inputFeedDocumentId"`

	// A list of identifiers for marketplaces that you want the feed to be applied to.
	MarketplaceIds []string `json:"marketplaceIds"`
}

CreateFeedSpecification defines model for CreateFeedSpecification.

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 in a human-readable form.
	Message string `json:"message"`
}

Error defines model for Error.

type ErrorList

type ErrorList []Error

ErrorList defines model for ErrorList.

type Feed

type Feed struct {

	// The date and time when the feed was created, in ISO 8601 date time format.
	CreatedTime time.Time `json:"createdTime"`

	// 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 feed processing completed, in ISO 8601 date time format.
	ProcessingEndTime *time.Time `json:"processingEndTime,omitempty"`

	// The date and time when feed processing started, in ISO 8601 date time format.
	ProcessingStartTime *time.Time `json:"processingStartTime,omitempty"`

	// The processing status of the feed.
	ProcessingStatus string `json:"processingStatus"`

	// The identifier for the feed document. This identifier is unique only in combination with a seller ID.
	ResultFeedDocumentId *string `json:"resultFeedDocumentId,omitempty"`
}

Feed defines model for Feed.

type FeedDocument

type FeedDocument struct {

	// If present, the feed document contents are compressed using the indicated algorithm.
	CompressionAlgorithm *string `json:"compressionAlgorithm,omitempty"`

	// Encryption details for required client-side encryption and decryption of document contents.
	EncryptionDetails FeedDocumentEncryptionDetails `json:"encryptionDetails"`

	// 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. This URL expires after 5 minutes.
	Url string `json:"url"`
}

FeedDocument defines model for FeedDocument.

type FeedDocumentEncryptionDetails

type FeedDocumentEncryptionDetails struct {

	// The vector to encrypt or decrypt the document contents using Cipher Block Chaining (CBC).
	InitializationVector string `json:"initializationVector"`

	// The encryption key used to encrypt or decrypt the document contents.
	Key string `json:"key"`

	// The encryption standard required to encrypt or decrypt the document contents.
	Standard string `json:"standard"`
}

FeedDocumentEncryptionDetails defines model for FeedDocumentEncryptionDetails.

type FeedList

type FeedList []Feed

FeedList defines model for FeedList.

type FeedOptions

type FeedOptions struct {
	AdditionalProperties map[string]string `json:"-"`
}

FeedOptions defines model for FeedOptions.

func (FeedOptions) Get

func (a FeedOptions) Get(fieldName string) (value string, found bool)

Getter for additional properties for FeedOptions. Returns the specified element and whether it was found

func (FeedOptions) MarshalJSON

func (a FeedOptions) MarshalJSON() ([]byte, error)

Override default JSON handling for FeedOptions to handle AdditionalProperties

func (*FeedOptions) Set

func (a *FeedOptions) Set(fieldName string, value string)

Setter for additional properties for FeedOptions

func (*FeedOptions) UnmarshalJSON

func (a *FeedOptions) UnmarshalJSON(b []byte) error

Override default JSON handling for FeedOptions to handle AdditionalProperties

type GetFeedDocumentResp

type GetFeedDocumentResp struct {
	Body         []byte
	HTTPResponse *http.Response
	Model        *GetFeedDocumentResponse
}

func ParseGetFeedDocumentResp

func ParseGetFeedDocumentResp(rsp *http.Response) (*GetFeedDocumentResp, error)

ParseGetFeedDocumentResp parses an HTTP response from a GetFeedDocumentWithResponse call

func (GetFeedDocumentResp) Status

func (r GetFeedDocumentResp) Status() string

Status returns HTTPResponse.Status

func (GetFeedDocumentResp) StatusCode

func (r GetFeedDocumentResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetFeedDocumentResponse

type GetFeedDocumentResponse struct {

	// A list of error responses returned when a request is unsuccessful.
	Errors  *ErrorList    `json:"errors,omitempty"`
	Payload *FeedDocument `json:"payload,omitempty"`
}

GetFeedDocumentResponse defines model for GetFeedDocumentResponse.

type GetFeedResp

type GetFeedResp struct {
	Body         []byte
	HTTPResponse *http.Response
	Model        *GetFeedResponse
}

func ParseGetFeedResp

func ParseGetFeedResp(rsp *http.Response) (*GetFeedResp, error)

ParseGetFeedResp parses an HTTP response from a GetFeedWithResponse call

func (GetFeedResp) Status

func (r GetFeedResp) Status() string

Status returns HTTPResponse.Status

func (GetFeedResp) StatusCode

func (r GetFeedResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetFeedResponse

type GetFeedResponse struct {

	// A list of error responses returned when a request is unsuccessful.
	Errors  *ErrorList `json:"errors,omitempty"`
	Payload *Feed      `json:"payload,omitempty"`
}

GetFeedResponse defines model for GetFeedResponse.

type GetFeedsParams

type GetFeedsParams struct {

	// A list of feed types used to filter feeds. When feedTypes is provided, the other filter parameters (processingStatuses, marketplaceIds, createdSince, createdUntil) and pageSize may also be provided. Either feedTypes or nextToken is required.
	FeedTypes *[]string `json:"feedTypes,omitempty"`

	// A list of marketplace identifiers used to filter feeds. The feeds returned will match at least one of the marketplaces that you specify.
	MarketplaceIds *[]string `json:"marketplaceIds,omitempty"`

	// The maximum number of feeds to return in a single call.
	PageSize *int `json:"pageSize,omitempty"`

	// A list of processing statuses used to filter feeds.
	ProcessingStatuses *[]string `json:"processingStatuses,omitempty"`

	// The earliest feed creation date and time for feeds included in the response, in ISO 8601 format. The default is 90 days ago. Feeds are retained for a maximum of 90 days.
	CreatedSince *time.Time `json:"createdSince,omitempty"`

	// The latest feed creation date and time for feeds included in the response, in ISO 8601 format. The default is now.
	CreatedUntil *time.Time `json:"createdUntil,omitempty"`

	// A string token returned in the response to your previous request. nextToken is returned when the number of results exceeds the specified pageSize value. To get the next page of results, call the getFeeds operation and include this token as the only parameter. Specifying nextToken with any other parameters will cause the request to fail.
	NextToken *string `json:"nextToken,omitempty"`
}

GetFeedsParams defines parameters for GetFeeds.

type GetFeedsResp

type GetFeedsResp struct {
	Body         []byte
	HTTPResponse *http.Response
	Model        *GetFeedsResponse
}

func ParseGetFeedsResp

func ParseGetFeedsResp(rsp *http.Response) (*GetFeedsResp, error)

ParseGetFeedsResp parses an HTTP response from a GetFeedsWithResponse call

func (GetFeedsResp) Status

func (r GetFeedsResp) Status() string

Status returns HTTPResponse.Status

func (GetFeedsResp) StatusCode

func (r GetFeedsResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetFeedsResponse

type GetFeedsResponse struct {

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

	// 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"`
	Payload   *FeedList `json:"payload,omitempty"`
}

GetFeedsResponse defines model for GetFeedsResponse.

type HttpRequestDoer

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

Doer performs HTTP requests.

The standard http.Client implements this interface.

type RequestBeforeFn

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

RequestBeforeFn is the function signature for the RequestBefore callback function

type ResponseAfterFn

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

ResponseAfterFn is the function signature for the ResponseAfter callback function

Jump to

Keyboard shortcuts

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