shipping

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: 12 Imported by: 0

Documentation

Overview

Package shipping provides primitives to interact the openapi HTTP API.

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

Package shipping 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 NewCancelShipmentRequest

func NewCancelShipmentRequest(endpoint string, shipmentId string) (*http.Request, error)

NewCancelShipmentRequest generates requests for CancelShipment

func NewCreateShipmentRequest

func NewCreateShipmentRequest(endpoint string, body CreateShipmentJSONRequestBody) (*http.Request, error)

NewCreateShipmentRequest calls the generic CreateShipment builder with application/json body

func NewCreateShipmentRequestWithBody

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

NewCreateShipmentRequestWithBody generates requests for CreateShipment with any type of body

func NewGetAccountRequest

func NewGetAccountRequest(endpoint string) (*http.Request, error)

NewGetAccountRequest generates requests for GetAccount

func NewGetRatesRequest

func NewGetRatesRequest(endpoint string, body GetRatesJSONRequestBody) (*http.Request, error)

NewGetRatesRequest calls the generic GetRates builder with application/json body

func NewGetRatesRequestWithBody

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

NewGetRatesRequestWithBody generates requests for GetRates with any type of body

func NewGetShipmentRequest

func NewGetShipmentRequest(endpoint string, shipmentId string) (*http.Request, error)

NewGetShipmentRequest generates requests for GetShipment

func NewGetTrackingInformationRequest

func NewGetTrackingInformationRequest(endpoint string, trackingId string) (*http.Request, error)

NewGetTrackingInformationRequest generates requests for GetTrackingInformation

func NewPurchaseLabelsRequest

func NewPurchaseLabelsRequest(endpoint string, shipmentId string, body PurchaseLabelsJSONRequestBody) (*http.Request, error)

NewPurchaseLabelsRequest calls the generic PurchaseLabels builder with application/json body

func NewPurchaseLabelsRequestWithBody

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

NewPurchaseLabelsRequestWithBody generates requests for PurchaseLabels with any type of body

func NewPurchaseShipmentRequest

func NewPurchaseShipmentRequest(endpoint string, body PurchaseShipmentJSONRequestBody) (*http.Request, error)

NewPurchaseShipmentRequest calls the generic PurchaseShipment builder with application/json body

func NewPurchaseShipmentRequestWithBody

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

NewPurchaseShipmentRequestWithBody generates requests for PurchaseShipment with any type of body

func NewRetrieveShippingLabelRequest

func NewRetrieveShippingLabelRequest(endpoint string, shipmentId string, trackingId string, body RetrieveShippingLabelJSONRequestBody) (*http.Request, error)

NewRetrieveShippingLabelRequest calls the generic RetrieveShippingLabel builder with application/json body

func NewRetrieveShippingLabelRequestWithBody

func NewRetrieveShippingLabelRequestWithBody(endpoint string, shipmentId string, trackingId string, contentType string, body io.Reader) (*http.Request, error)

NewRetrieveShippingLabelRequestWithBody generates requests for RetrieveShippingLabel with any type of body

Types

type AcceptedRate

type AcceptedRate struct {

	// The weight.
	BilledWeight *Weight `json:"billedWeight,omitempty"`

	// The promised delivery time and pickup time.
	Promise *ShippingPromiseSet `json:"promise,omitempty"`

	// The type of shipping service that will be used for the service offering.
	ServiceType *ServiceType `json:"serviceType,omitempty"`

	// The total value of all items in the container.
	TotalCharge *Currency `json:"totalCharge,omitempty"`
}

AcceptedRate defines model for AcceptedRate.

type Account

type Account struct {

	// This is the Amazon Shipping account id generated during the Amazon Shipping onboarding process.
	AccountId AccountId `json:"accountId"`
}

Account defines model for Account.

type AccountId

type AccountId string

AccountId defines model for AccountId.

type Address

type Address struct {

	// First line of that address.
	AddressLine1 string `json:"addressLine1"`

	// Additional address information, if required.
	AddressLine2 *string `json:"addressLine2,omitempty"`

	// Additional address information, if required.
	AddressLine3 *string `json:"addressLine3,omitempty"`

	// The city where the person, business or institution is located.
	City City `json:"city"`

	// The email cc addresses of the contact associated with the address.
	CopyEmails *[]string `json:"copyEmails,omitempty"`

	// The two digit country code. In ISO 3166-1 alpha-2 format.
	CountryCode CountryCode `json:"countryCode"`

	// The email address of the contact associated with the address.
	Email *string `json:"email,omitempty"`

	// The name of the person, business or institution at that address.
	Name string `json:"name"`

	// The phone number of the person, business or institution located at that address.
	PhoneNumber *string `json:"phoneNumber,omitempty"`

	// The postal code of that address. It contains a series of letters or digits or both, sometimes including spaces or punctuation.
	PostalCode PostalCode `json:"postalCode"`

	// The state or region where the person, business or institution is located.
	StateOrRegion StateOrRegion `json:"stateOrRegion"`
}

Address defines model for Address.

type CancelShipmentResp

type CancelShipmentResp struct {
	Body         []byte
	HTTPResponse *http.Response
	Model        *CancelShipmentResponse
}

func ParseCancelShipmentResp

func ParseCancelShipmentResp(rsp *http.Response) (*CancelShipmentResp, error)

ParseCancelShipmentResp parses an HTTP response from a CancelShipmentWithResponse call

func (CancelShipmentResp) Status

func (r CancelShipmentResp) Status() string

Status returns HTTPResponse.Status

func (CancelShipmentResp) StatusCode

func (r CancelShipmentResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CancelShipmentResponse

type CancelShipmentResponse struct {

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

CancelShipmentResponse defines model for CancelShipmentResponse.

type City

type City string

City defines model for City.

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

func (c *Client) CancelShipment(ctx context.Context, shipmentId string) (*http.Response, error)

func (*Client) CreateShipment

func (c *Client) CreateShipment(ctx context.Context, body CreateShipmentJSONRequestBody) (*http.Response, error)

func (*Client) CreateShipmentWithBody

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

func (*Client) GetAccount

func (c *Client) GetAccount(ctx context.Context) (*http.Response, error)

func (*Client) GetRates

func (c *Client) GetRates(ctx context.Context, body GetRatesJSONRequestBody) (*http.Response, error)

func (*Client) GetRatesWithBody

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

func (*Client) GetShipment

func (c *Client) GetShipment(ctx context.Context, shipmentId string) (*http.Response, error)

func (*Client) GetTrackingInformation

func (c *Client) GetTrackingInformation(ctx context.Context, trackingId string) (*http.Response, error)

func (*Client) PurchaseLabels

func (c *Client) PurchaseLabels(ctx context.Context, shipmentId string, body PurchaseLabelsJSONRequestBody) (*http.Response, error)

func (*Client) PurchaseLabelsWithBody

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

func (*Client) PurchaseShipment

func (c *Client) PurchaseShipment(ctx context.Context, body PurchaseShipmentJSONRequestBody) (*http.Response, error)

func (*Client) PurchaseShipmentWithBody

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

func (*Client) RetrieveShippingLabel

func (c *Client) RetrieveShippingLabel(ctx context.Context, shipmentId string, trackingId string, body RetrieveShippingLabelJSONRequestBody) (*http.Response, error)

func (*Client) RetrieveShippingLabelWithBody

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

type ClientInterface

type ClientInterface interface {
	// GetAccount request
	GetAccount(ctx context.Context) (*http.Response, error)

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

	PurchaseShipment(ctx context.Context, body PurchaseShipmentJSONRequestBody) (*http.Response, error)

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

	GetRates(ctx context.Context, body GetRatesJSONRequestBody) (*http.Response, error)

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

	CreateShipment(ctx context.Context, body CreateShipmentJSONRequestBody) (*http.Response, error)

	// GetShipment request
	GetShipment(ctx context.Context, shipmentId string) (*http.Response, error)

	// CancelShipment request
	CancelShipment(ctx context.Context, shipmentId string) (*http.Response, error)

	// RetrieveShippingLabel request  with any body
	RetrieveShippingLabelWithBody(ctx context.Context, shipmentId string, trackingId string, contentType string, body io.Reader) (*http.Response, error)

	RetrieveShippingLabel(ctx context.Context, shipmentId string, trackingId string, body RetrieveShippingLabelJSONRequestBody) (*http.Response, error)

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

	PurchaseLabels(ctx context.Context, shipmentId string, body PurchaseLabelsJSONRequestBody) (*http.Response, error)

	// GetTrackingInformation request
	GetTrackingInformation(ctx context.Context, trackingId 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 ClientReferenceId

type ClientReferenceId string

ClientReferenceId defines model for ClientReferenceId.

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

func (c *ClientWithResponses) CancelShipmentWithResponse(ctx context.Context, shipmentId string) (*CancelShipmentResp, error)

CancelShipmentWithResponse request returning *CancelShipmentResponse

func (*ClientWithResponses) CreateShipmentWithBodyWithResponse

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

CreateShipmentWithBodyWithResponse request with arbitrary body returning *CreateShipmentResponse

func (*ClientWithResponses) CreateShipmentWithResponse

func (c *ClientWithResponses) CreateShipmentWithResponse(ctx context.Context, body CreateShipmentJSONRequestBody) (*CreateShipmentResp, error)

func (*ClientWithResponses) GetAccountWithResponse

func (c *ClientWithResponses) GetAccountWithResponse(ctx context.Context) (*GetAccountResp, error)

GetAccountWithResponse request returning *GetAccountResponse

func (*ClientWithResponses) GetRatesWithBodyWithResponse

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

GetRatesWithBodyWithResponse request with arbitrary body returning *GetRatesResponse

func (*ClientWithResponses) GetRatesWithResponse

func (c *ClientWithResponses) GetRatesWithResponse(ctx context.Context, body GetRatesJSONRequestBody) (*GetRatesResp, error)

func (*ClientWithResponses) GetShipmentWithResponse

func (c *ClientWithResponses) GetShipmentWithResponse(ctx context.Context, shipmentId string) (*GetShipmentResp, error)

GetShipmentWithResponse request returning *GetShipmentResponse

func (*ClientWithResponses) GetTrackingInformationWithResponse

func (c *ClientWithResponses) GetTrackingInformationWithResponse(ctx context.Context, trackingId string) (*GetTrackingInformationResp, error)

GetTrackingInformationWithResponse request returning *GetTrackingInformationResponse

func (*ClientWithResponses) PurchaseLabelsWithBodyWithResponse

func (c *ClientWithResponses) PurchaseLabelsWithBodyWithResponse(ctx context.Context, shipmentId string, contentType string, body io.Reader) (*PurchaseLabelsResp, error)

PurchaseLabelsWithBodyWithResponse request with arbitrary body returning *PurchaseLabelsResponse

func (*ClientWithResponses) PurchaseLabelsWithResponse

func (c *ClientWithResponses) PurchaseLabelsWithResponse(ctx context.Context, shipmentId string, body PurchaseLabelsJSONRequestBody) (*PurchaseLabelsResp, error)

func (*ClientWithResponses) PurchaseShipmentWithBodyWithResponse

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

PurchaseShipmentWithBodyWithResponse request with arbitrary body returning *PurchaseShipmentResponse

func (*ClientWithResponses) PurchaseShipmentWithResponse

func (c *ClientWithResponses) PurchaseShipmentWithResponse(ctx context.Context, body PurchaseShipmentJSONRequestBody) (*PurchaseShipmentResp, error)

func (*ClientWithResponses) RetrieveShippingLabelWithBodyWithResponse

func (c *ClientWithResponses) RetrieveShippingLabelWithBodyWithResponse(ctx context.Context, shipmentId string, trackingId string, contentType string, body io.Reader) (*RetrieveShippingLabelResp, error)

RetrieveShippingLabelWithBodyWithResponse request with arbitrary body returning *RetrieveShippingLabelResponse

func (*ClientWithResponses) RetrieveShippingLabelWithResponse

func (c *ClientWithResponses) RetrieveShippingLabelWithResponse(ctx context.Context, shipmentId string, trackingId string, body RetrieveShippingLabelJSONRequestBody) (*RetrieveShippingLabelResp, error)

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// GetAccount request
	GetAccountWithResponse(ctx context.Context) (*GetAccountResp, error)

	// PurchaseShipment request  with any body
	PurchaseShipmentWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*PurchaseShipmentResp, error)

	PurchaseShipmentWithResponse(ctx context.Context, body PurchaseShipmentJSONRequestBody) (*PurchaseShipmentResp, error)

	// GetRates request  with any body
	GetRatesWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*GetRatesResp, error)

	GetRatesWithResponse(ctx context.Context, body GetRatesJSONRequestBody) (*GetRatesResp, error)

	// CreateShipment request  with any body
	CreateShipmentWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*CreateShipmentResp, error)

	CreateShipmentWithResponse(ctx context.Context, body CreateShipmentJSONRequestBody) (*CreateShipmentResp, error)

	// GetShipment request
	GetShipmentWithResponse(ctx context.Context, shipmentId string) (*GetShipmentResp, error)

	// CancelShipment request
	CancelShipmentWithResponse(ctx context.Context, shipmentId string) (*CancelShipmentResp, error)

	// RetrieveShippingLabel request  with any body
	RetrieveShippingLabelWithBodyWithResponse(ctx context.Context, shipmentId string, trackingId string, contentType string, body io.Reader) (*RetrieveShippingLabelResp, error)

	RetrieveShippingLabelWithResponse(ctx context.Context, shipmentId string, trackingId string, body RetrieveShippingLabelJSONRequestBody) (*RetrieveShippingLabelResp, error)

	// PurchaseLabels request  with any body
	PurchaseLabelsWithBodyWithResponse(ctx context.Context, shipmentId string, contentType string, body io.Reader) (*PurchaseLabelsResp, error)

	PurchaseLabelsWithResponse(ctx context.Context, shipmentId string, body PurchaseLabelsJSONRequestBody) (*PurchaseLabelsResp, error)

	// GetTrackingInformation request
	GetTrackingInformationWithResponse(ctx context.Context, trackingId string) (*GetTrackingInformationResp, error)
}

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

type Container

type Container struct {

	// An identifier for the container. This must be unique within all the containers in the same shipment.
	ContainerReferenceId ContainerReferenceId `json:"containerReferenceId"`

	// The type of physical container being used. (always 'PACKAGE')
	ContainerType *string `json:"containerType,omitempty"`

	// A set of measurements for a three-dimensional object.
	Dimensions Dimensions `json:"dimensions"`

	// A list of the items in the container.
	Items []ContainerItem `json:"items"`

	// The total value of all items in the container.
	Value Currency `json:"value"`

	// The weight.
	Weight Weight `json:"weight"`
}

Container defines model for Container.

type ContainerItem

type ContainerItem struct {

	// The quantity of the items of this type in the container.
	Quantity float32 `json:"quantity"`

	// A descriptive title of the item.
	Title string `json:"title"`

	// The total value of all items in the container.
	UnitPrice Currency `json:"unitPrice"`

	// The weight.
	UnitWeight Weight `json:"unitWeight"`
}

ContainerItem defines model for ContainerItem.

type ContainerList

type ContainerList []Container

ContainerList defines model for ContainerList.

type ContainerReferenceId

type ContainerReferenceId string

ContainerReferenceId defines model for ContainerReferenceId.

type ContainerSpecification

type ContainerSpecification struct {

	// A set of measurements for a three-dimensional object.
	Dimensions Dimensions `json:"dimensions"`

	// The weight.
	Weight Weight `json:"weight"`
}

ContainerSpecification defines model for ContainerSpecification.

type ContainerSpecificationList

type ContainerSpecificationList []ContainerSpecification

ContainerSpecificationList defines model for ContainerSpecificationList.

type CountryCode

type CountryCode string

CountryCode defines model for CountryCode.

type CreateShipmentJSONBody

type CreateShipmentJSONBody CreateShipmentRequest

CreateShipmentJSONBody defines parameters for CreateShipment.

type CreateShipmentJSONRequestBody

type CreateShipmentJSONRequestBody CreateShipmentJSONBody

CreateShipmentRequestBody defines body for CreateShipment for application/json ContentType.

type CreateShipmentRequest

type CreateShipmentRequest struct {

	// Client reference id.
	ClientReferenceId ClientReferenceId `json:"clientReferenceId"`

	// A list of container.
	Containers ContainerList `json:"containers"`

	// The address.
	ShipFrom Address `json:"shipFrom"`

	// The address.
	ShipTo Address `json:"shipTo"`
}

CreateShipmentRequest defines model for CreateShipmentRequest.

type CreateShipmentResp

type CreateShipmentResp struct {
	Body         []byte
	HTTPResponse *http.Response
	Model        *CreateShipmentResponse
}

func ParseCreateShipmentResp

func ParseCreateShipmentResp(rsp *http.Response) (*CreateShipmentResp, error)

ParseCreateShipmentResp parses an HTTP response from a CreateShipmentWithResponse call

func (CreateShipmentResp) Status

func (r CreateShipmentResp) Status() string

Status returns HTTPResponse.Status

func (CreateShipmentResp) StatusCode

func (r CreateShipmentResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CreateShipmentResponse

type CreateShipmentResponse struct {

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

	// The payload schema for the createShipment operation.
	Payload *CreateShipmentResult `json:"payload,omitempty"`
}

CreateShipmentResponse defines model for CreateShipmentResponse.

type CreateShipmentResult

type CreateShipmentResult struct {

	// A list of all the available rates that can be used to send the shipment.
	EligibleRates RateList `json:"eligibleRates"`

	// The unique shipment identifier.
	ShipmentId ShipmentId `json:"shipmentId"`
}

CreateShipmentResult defines model for CreateShipmentResult.

type Currency

type Currency struct {

	// A 3-character currency code.
	Unit string `json:"unit"`

	// The amount of currency.
	Value float32 `json:"value"`
}

Currency defines model for Currency.

type Dimensions

type Dimensions struct {

	// The height of the container.
	Height float32 `json:"height"`

	// The length of the container.
	Length float32 `json:"length"`

	// The unit of these measurements.
	Unit string `json:"unit"`

	// The width of the container.
	Width float32 `json:"width"`
}

Dimensions defines model for Dimensions.

type Error

type Error struct {

	// An error code that identifies the type of error that occured.
	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 Event

type Event struct {

	// The event code of a shipment, such as Departed, Received, and ReadyForReceive.
	EventCode EventCode `json:"eventCode"`

	// The date and time of an event for a shipment.
	EventTime time.Time `json:"eventTime"`

	// The location where the person, business or institution is located.
	Location *Location `json:"location,omitempty"`
}

Event defines model for Event.

type EventCode

type EventCode string

EventCode defines model for EventCode.

type EventList

type EventList []Event

EventList defines model for EventList.

type GetAccountResp

type GetAccountResp struct {
	Body         []byte
	HTTPResponse *http.Response
	Model        *GetAccountResponse
}

func ParseGetAccountResp

func ParseGetAccountResp(rsp *http.Response) (*GetAccountResp, error)

ParseGetAccountResp parses an HTTP response from a GetAccountWithResponse call

func (GetAccountResp) Status

func (r GetAccountResp) Status() string

Status returns HTTPResponse.Status

func (GetAccountResp) StatusCode

func (r GetAccountResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetAccountResponse

type GetAccountResponse struct {

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

	// The account related data.
	Payload *Account `json:"payload,omitempty"`
}

GetAccountResponse defines model for GetAccountResponse.

type GetRatesJSONBody

type GetRatesJSONBody GetRatesRequest

GetRatesJSONBody defines parameters for GetRates.

type GetRatesJSONRequestBody

type GetRatesJSONRequestBody GetRatesJSONBody

GetRatesRequestBody defines body for GetRates for application/json ContentType.

type GetRatesRequest

type GetRatesRequest struct {

	// A list of container specifications.
	ContainerSpecifications ContainerSpecificationList `json:"containerSpecifications"`

	// A list of service types that can be used to send the shipment.
	ServiceTypes ServiceTypeList `json:"serviceTypes"`

	// The start date and time. This defaults to the current date and time.
	ShipDate *time.Time `json:"shipDate,omitempty"`

	// The address.
	ShipFrom Address `json:"shipFrom"`

	// The address.
	ShipTo Address `json:"shipTo"`
}

GetRatesRequest defines model for GetRatesRequest.

type GetRatesResp

type GetRatesResp struct {
	Body         []byte
	HTTPResponse *http.Response
	Model        *GetRatesResponse
}

func ParseGetRatesResp

func ParseGetRatesResp(rsp *http.Response) (*GetRatesResp, error)

ParseGetRatesResp parses an HTTP response from a GetRatesWithResponse call

func (GetRatesResp) Status

func (r GetRatesResp) Status() string

Status returns HTTPResponse.Status

func (GetRatesResp) StatusCode

func (r GetRatesResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetRatesResponse

type GetRatesResponse struct {

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

	// The payload schema for the getRates operation.
	Payload *GetRatesResult `json:"payload,omitempty"`
}

GetRatesResponse defines model for GetRatesResponse.

type GetRatesResult

type GetRatesResult struct {

	// A list of service rates.
	ServiceRates ServiceRateList `json:"serviceRates"`
}

GetRatesResult defines model for GetRatesResult.

type GetShipmentResp

type GetShipmentResp struct {
	Body         []byte
	HTTPResponse *http.Response
	Model        *GetShipmentResponse
}

func ParseGetShipmentResp

func ParseGetShipmentResp(rsp *http.Response) (*GetShipmentResp, error)

ParseGetShipmentResp parses an HTTP response from a GetShipmentWithResponse call

func (GetShipmentResp) Status

func (r GetShipmentResp) Status() string

Status returns HTTPResponse.Status

func (GetShipmentResp) StatusCode

func (r GetShipmentResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetShipmentResponse

type GetShipmentResponse struct {

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

	// The shipment related data.
	Payload *Shipment `json:"payload,omitempty"`
}

GetShipmentResponse defines model for GetShipmentResponse.

type GetTrackingInformationResp

type GetTrackingInformationResp struct {
	Body         []byte
	HTTPResponse *http.Response
	Model        *GetTrackingInformationResponse
}

func ParseGetTrackingInformationResp

func ParseGetTrackingInformationResp(rsp *http.Response) (*GetTrackingInformationResp, error)

ParseGetTrackingInformationResp parses an HTTP response from a GetTrackingInformationWithResponse call

func (GetTrackingInformationResp) Status

Status returns HTTPResponse.Status

func (GetTrackingInformationResp) StatusCode

func (r GetTrackingInformationResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetTrackingInformationResponse

type GetTrackingInformationResponse struct {

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

	// The payload schema for the getTrackingInformation operation.
	Payload *TrackingInformation `json:"payload,omitempty"`
}

GetTrackingInformationResponse defines model for GetTrackingInformationResponse.

type HttpRequestDoer

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

Doer performs HTTP requests.

The standard http.Client implements this interface.

type Label

type Label struct {

	// The label specification info.
	LabelSpecification *LabelSpecification `json:"labelSpecification,omitempty"`

	// Contains binary image data encoded as a base-64 string.
	LabelStream *LabelStream `json:"labelStream,omitempty"`
}

Label defines model for Label.

type LabelResult

type LabelResult struct {

	// An identifier for the container. This must be unique within all the containers in the same shipment.
	ContainerReferenceId *ContainerReferenceId `json:"containerReferenceId,omitempty"`

	// The label details of the container.
	Label *Label `json:"label,omitempty"`

	// The tracking identifier assigned to the container.
	TrackingId *string `json:"trackingId,omitempty"`
}

LabelResult defines model for LabelResult.

type LabelResultList

type LabelResultList []LabelResult

LabelResultList defines model for LabelResultList.

type LabelSpecification

type LabelSpecification struct {

	// The format of the label. Enum of PNG only for now.
	LabelFormat string `json:"labelFormat"`

	// The label stock size specification in length and height. Enum of 4x6 only for now.
	LabelStockSize string `json:"labelStockSize"`
}

LabelSpecification defines model for LabelSpecification.

type LabelStream

type LabelStream string

LabelStream defines model for LabelStream.

type Location

type Location struct {

	// The city where the person, business or institution is located.
	City *City `json:"city,omitempty"`

	// The two digit country code. In ISO 3166-1 alpha-2 format.
	CountryCode *CountryCode `json:"countryCode,omitempty"`

	// The postal code of that address. It contains a series of letters or digits or both, sometimes including spaces or punctuation.
	PostalCode *PostalCode `json:"postalCode,omitempty"`

	// The state or region where the person, business or institution is located.
	StateOrRegion *StateOrRegion `json:"stateOrRegion,omitempty"`
}

Location defines model for Location.

type Party

type Party struct {

	// This is the Amazon Shipping account id generated during the Amazon Shipping onboarding process.
	AccountId *AccountId `json:"accountId,omitempty"`
}

Party defines model for Party.

type PostalCode

type PostalCode string

PostalCode defines model for PostalCode.

type PromisedDeliveryDate

type PromisedDeliveryDate time.Time

PromisedDeliveryDate defines model for PromisedDeliveryDate.

type PurchaseLabelsJSONBody

type PurchaseLabelsJSONBody PurchaseLabelsRequest

PurchaseLabelsJSONBody defines parameters for PurchaseLabels.

type PurchaseLabelsJSONRequestBody

type PurchaseLabelsJSONRequestBody PurchaseLabelsJSONBody

PurchaseLabelsRequestBody defines body for PurchaseLabels for application/json ContentType.

type PurchaseLabelsRequest

type PurchaseLabelsRequest struct {

	// The label specification info.
	LabelSpecification LabelSpecification `json:"labelSpecification"`

	// An identifier for the rating.
	RateId RateId `json:"rateId"`
}

PurchaseLabelsRequest defines model for PurchaseLabelsRequest.

type PurchaseLabelsResp

type PurchaseLabelsResp struct {
	Body         []byte
	HTTPResponse *http.Response
	Model        *PurchaseLabelsResponse
}

func ParsePurchaseLabelsResp

func ParsePurchaseLabelsResp(rsp *http.Response) (*PurchaseLabelsResp, error)

ParsePurchaseLabelsResp parses an HTTP response from a PurchaseLabelsWithResponse call

func (PurchaseLabelsResp) Status

func (r PurchaseLabelsResp) Status() string

Status returns HTTPResponse.Status

func (PurchaseLabelsResp) StatusCode

func (r PurchaseLabelsResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type PurchaseLabelsResponse

type PurchaseLabelsResponse struct {

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

	// The payload schema for the purchaseLabels operation.
	Payload *PurchaseLabelsResult `json:"payload,omitempty"`
}

PurchaseLabelsResponse defines model for PurchaseLabelsResponse.

type PurchaseLabelsResult

type PurchaseLabelsResult struct {

	// The specific rate purchased for the shipment, or null if unpurchased.
	AcceptedRate AcceptedRate `json:"acceptedRate"`

	// Client reference id.
	ClientReferenceId *ClientReferenceId `json:"clientReferenceId,omitempty"`

	// A list of label results
	LabelResults LabelResultList `json:"labelResults"`

	// The unique shipment identifier.
	ShipmentId ShipmentId `json:"shipmentId"`
}

PurchaseLabelsResult defines model for PurchaseLabelsResult.

type PurchaseShipmentJSONBody

type PurchaseShipmentJSONBody PurchaseShipmentRequest

PurchaseShipmentJSONBody defines parameters for PurchaseShipment.

type PurchaseShipmentJSONRequestBody

type PurchaseShipmentJSONRequestBody PurchaseShipmentJSONBody

PurchaseShipmentRequestBody defines body for PurchaseShipment for application/json ContentType.

type PurchaseShipmentRequest

type PurchaseShipmentRequest struct {

	// Client reference id.
	ClientReferenceId ClientReferenceId `json:"clientReferenceId"`

	// A list of container.
	Containers ContainerList `json:"containers"`

	// The label specification info.
	LabelSpecification LabelSpecification `json:"labelSpecification"`

	// The type of shipping service that will be used for the service offering.
	ServiceType ServiceType `json:"serviceType"`

	// The start date and time. This defaults to the current date and time.
	ShipDate *time.Time `json:"shipDate,omitempty"`

	// The address.
	ShipFrom Address `json:"shipFrom"`

	// The address.
	ShipTo Address `json:"shipTo"`
}

PurchaseShipmentRequest defines model for PurchaseShipmentRequest.

type PurchaseShipmentResp

type PurchaseShipmentResp struct {
	Body         []byte
	HTTPResponse *http.Response
	Model        *PurchaseShipmentResponse
}

func ParsePurchaseShipmentResp

func ParsePurchaseShipmentResp(rsp *http.Response) (*PurchaseShipmentResp, error)

ParsePurchaseShipmentResp parses an HTTP response from a PurchaseShipmentWithResponse call

func (PurchaseShipmentResp) Status

func (r PurchaseShipmentResp) Status() string

Status returns HTTPResponse.Status

func (PurchaseShipmentResp) StatusCode

func (r PurchaseShipmentResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type PurchaseShipmentResponse

type PurchaseShipmentResponse struct {

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

	// The payload schema for the purchaseShipment operation.
	Payload *PurchaseShipmentResult `json:"payload,omitempty"`
}

PurchaseShipmentResponse defines model for PurchaseShipmentResponse.

type PurchaseShipmentResult

type PurchaseShipmentResult struct {

	// A list of label results
	LabelResults LabelResultList `json:"labelResults"`

	// The specific rate for a shipping service, or null if no service available.
	ServiceRate ServiceRate `json:"serviceRate"`

	// The unique shipment identifier.
	ShipmentId ShipmentId `json:"shipmentId"`
}

PurchaseShipmentResult defines model for PurchaseShipmentResult.

type Rate

type Rate struct {

	// The weight.
	BilledWeight *Weight `json:"billedWeight,omitempty"`

	// The time after which the offering will expire.
	ExpirationTime *time.Time `json:"expirationTime,omitempty"`

	// The promised delivery time and pickup time.
	Promise *ShippingPromiseSet `json:"promise,omitempty"`

	// An identifier for the rate.
	RateId *string `json:"rateId,omitempty"`

	// The type of shipping service that will be used for the service offering.
	ServiceType *ServiceType `json:"serviceType,omitempty"`

	// The total value of all items in the container.
	TotalCharge *Currency `json:"totalCharge,omitempty"`
}

Rate defines model for Rate.

type RateId

type RateId string

RateId defines model for RateId.

type RateList

type RateList []Rate

RateList defines model for RateList.

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 RetrieveShippingLabelJSONBody

type RetrieveShippingLabelJSONBody RetrieveShippingLabelRequest

RetrieveShippingLabelJSONBody defines parameters for RetrieveShippingLabel.

type RetrieveShippingLabelJSONRequestBody

type RetrieveShippingLabelJSONRequestBody RetrieveShippingLabelJSONBody

RetrieveShippingLabelRequestBody defines body for RetrieveShippingLabel for application/json ContentType.

type RetrieveShippingLabelRequest

type RetrieveShippingLabelRequest struct {

	// The label specification info.
	LabelSpecification LabelSpecification `json:"labelSpecification"`
}

RetrieveShippingLabelRequest defines model for RetrieveShippingLabelRequest.

type RetrieveShippingLabelResp

type RetrieveShippingLabelResp struct {
	Body         []byte
	HTTPResponse *http.Response
	Model        *RetrieveShippingLabelResponse
}

func ParseRetrieveShippingLabelResp

func ParseRetrieveShippingLabelResp(rsp *http.Response) (*RetrieveShippingLabelResp, error)

ParseRetrieveShippingLabelResp parses an HTTP response from a RetrieveShippingLabelWithResponse call

func (RetrieveShippingLabelResp) Status

func (r RetrieveShippingLabelResp) Status() string

Status returns HTTPResponse.Status

func (RetrieveShippingLabelResp) StatusCode

func (r RetrieveShippingLabelResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type RetrieveShippingLabelResponse

type RetrieveShippingLabelResponse struct {

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

	// The payload schema for the retrieveShippingLabel operation.
	Payload *RetrieveShippingLabelResult `json:"payload,omitempty"`
}

RetrieveShippingLabelResponse defines model for RetrieveShippingLabelResponse.

type RetrieveShippingLabelResult

type RetrieveShippingLabelResult struct {

	// The label specification info.
	LabelSpecification LabelSpecification `json:"labelSpecification"`

	// Contains binary image data encoded as a base-64 string.
	LabelStream LabelStream `json:"labelStream"`
}

RetrieveShippingLabelResult defines model for RetrieveShippingLabelResult.

type ServiceRate

type ServiceRate struct {

	// The weight.
	BillableWeight Weight `json:"billableWeight"`

	// The promised delivery time and pickup time.
	Promise ShippingPromiseSet `json:"promise"`

	// The type of shipping service that will be used for the service offering.
	ServiceType ServiceType `json:"serviceType"`

	// The total value of all items in the container.
	TotalCharge Currency `json:"totalCharge"`
}

ServiceRate defines model for ServiceRate.

type ServiceRateList

type ServiceRateList []ServiceRate

ServiceRateList defines model for ServiceRateList.

type ServiceType

type ServiceType string

ServiceType defines model for ServiceType.

const (
	ServiceType_Amazon_Shipping_Ground   ServiceType = "Amazon Shipping Ground"
	ServiceType_Amazon_Shipping_Premium  ServiceType = "Amazon Shipping Premium"
	ServiceType_Amazon_Shipping_Standard ServiceType = "Amazon Shipping Standard"
)

List of ServiceType

type ServiceTypeList

type ServiceTypeList []ServiceType

ServiceTypeList defines model for ServiceTypeList.

type Shipment

type Shipment struct {

	// The specific rate purchased for the shipment, or null if unpurchased.
	AcceptedRate *AcceptedRate `json:"acceptedRate,omitempty"`

	// Client reference id.
	ClientReferenceId ClientReferenceId `json:"clientReferenceId"`

	// A list of container.
	Containers ContainerList `json:"containers"`

	// The address.
	ShipFrom Address `json:"shipFrom"`

	// The address.
	ShipTo Address `json:"shipTo"`

	// The unique shipment identifier.
	ShipmentId ShipmentId `json:"shipmentId"`

	// The account related with the shipment.
	Shipper *Party `json:"shipper,omitempty"`
}

Shipment defines model for Shipment.

type ShipmentId

type ShipmentId string

ShipmentId defines model for ShipmentId.

type ShippingPromiseSet

type ShippingPromiseSet struct {

	// The time range.
	DeliveryWindow *TimeRange `json:"deliveryWindow,omitempty"`

	// The time range.
	ReceiveWindow *TimeRange `json:"receiveWindow,omitempty"`
}

ShippingPromiseSet defines model for ShippingPromiseSet.

type StateOrRegion

type StateOrRegion string

StateOrRegion defines model for StateOrRegion.

type TimeRange

type TimeRange struct {

	// The end date and time. This must come after the value of start. This defaults to the next business day from the start.
	End *time.Time `json:"end,omitempty"`

	// The start date and time. This defaults to the current date and time.
	Start *time.Time `json:"start,omitempty"`
}

TimeRange defines model for TimeRange.

type TrackingId

type TrackingId string

TrackingId defines model for TrackingId.

type TrackingInformation

type TrackingInformation struct {

	// A list of events of a shipment.
	EventHistory EventList `json:"eventHistory"`

	// The promised delivery date and time of a shipment.
	PromisedDeliveryDate PromisedDeliveryDate `json:"promisedDeliveryDate"`

	// The tracking summary.
	Summary TrackingSummary `json:"summary"`

	// The tracking id generated to each shipment. It contains a series of letters or digits or both.
	TrackingId TrackingId `json:"trackingId"`
}

TrackingInformation defines model for TrackingInformation.

type TrackingSummary

type TrackingSummary struct {

	// The derived status based on the events in the eventHistory.
	Status *string `json:"status,omitempty"`
}

TrackingSummary defines model for TrackingSummary.

type Weight

type Weight struct {

	// The unit of measurement.
	Unit string `json:"unit"`

	// The measurement value.
	Value float32 `json:"value"`
}

Weight defines model for Weight.

Jump to

Keyboard shortcuts

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