uploads

package
v0.0.0-...-0593bef Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package uploads provides primitives to interact the openapi HTTP API.

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

Package uploads 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 NewCreateUploadDestinationForResourceRequest

func NewCreateUploadDestinationForResourceRequest(endpoint string, resource string, params *CreateUploadDestinationForResourceParams) (*http.Request, error)

NewCreateUploadDestinationForResourceRequest generates requests for CreateUploadDestinationForResource

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

func (c *Client) CreateUploadDestinationForResource(ctx context.Context, resource string, params *CreateUploadDestinationForResourceParams) (*http.Response, error)

type ClientInterface

type ClientInterface interface {
	// CreateUploadDestinationForResource request
	CreateUploadDestinationForResource(ctx context.Context, resource string, params *CreateUploadDestinationForResourceParams) (*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) CreateUploadDestinationForResourceWithResponse

func (c *ClientWithResponses) CreateUploadDestinationForResourceWithResponse(ctx context.Context, resource string, params *CreateUploadDestinationForResourceParams) (*CreateUploadDestinationForResourceResp, error)

CreateUploadDestinationForResourceWithResponse request returning *CreateUploadDestinationForResourceResponse

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// CreateUploadDestinationForResource request
	CreateUploadDestinationForResourceWithResponse(ctx context.Context, resource string, params *CreateUploadDestinationForResourceParams) (*CreateUploadDestinationForResourceResp, error)
}

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

type CreateUploadDestinationForResourceParams

type CreateUploadDestinationForResourceParams struct {

	// A list of marketplace identifiers. This specifies the marketplaces where the upload will be available. Only one marketplace can be specified.
	MarketplaceIds []string `json:"marketplaceIds"`

	// An MD5 hash of the content to be submitted to the upload destination. This value is used to determine if the data has been corrupted or tampered with during transit.
	ContentMD5 string `json:"contentMD5"`

	// The content type of the file to be uploaded.
	ContentType *string `json:"contentType,omitempty"`
}

CreateUploadDestinationForResourceParams defines parameters for CreateUploadDestinationForResource.

type CreateUploadDestinationForResourceResp

type CreateUploadDestinationForResourceResp struct {
	Body         []byte
	HTTPResponse *http.Response
	Model        *CreateUploadDestinationResponse
}

func ParseCreateUploadDestinationForResourceResp

func ParseCreateUploadDestinationForResourceResp(rsp *http.Response) (*CreateUploadDestinationForResourceResp, error)

ParseCreateUploadDestinationForResourceResp parses an HTTP response from a CreateUploadDestinationForResourceWithResponse call

func (CreateUploadDestinationForResourceResp) Status

Status returns HTTPResponse.Status

func (CreateUploadDestinationForResourceResp) StatusCode

StatusCode returns HTTPResponse.StatusCode

type CreateUploadDestinationResponse

type CreateUploadDestinationResponse struct {

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

	// Information about an upload destination.
	Payload *UploadDestination `json:"payload,omitempty"`
}

CreateUploadDestinationResponse defines model for CreateUploadDestinationResponse.

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

type UploadDestination

type UploadDestination struct {

	// The headers to include in the upload request.
	Headers *map[string]interface{} `json:"headers,omitempty"`

	// The unique identifier for the upload destination.
	UploadDestinationId *string `json:"uploadDestinationId,omitempty"`

	// The URL for the upload destination.
	Url *string `json:"url,omitempty"`
}

UploadDestination defines model for UploadDestination.

Jump to

Keyboard shortcuts

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