// Package shipping provides primitives to interact the openapi HTTP API.
//
// Code generated by go-sdk-codegen DO NOT EDIT.
package shipping

import (
	"time"
)

// AcceptedRate defines model for 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"`
}

// Account defines model for Account.
type Account struct {

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

// AccountId defines model for AccountId.
type AccountId string

// Address defines model for 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"`
}

// CancelShipmentResponse defines model for CancelShipmentResponse.
type CancelShipmentResponse struct {

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

// City defines model for City.
type City string

// ClientReferenceId defines model for ClientReferenceId.
type ClientReferenceId string

// Container defines model for 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"`
}

// ContainerItem defines model for 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"`
}

// ContainerList defines model for ContainerList.
type ContainerList []Container

// ContainerReferenceId defines model for ContainerReferenceId.
type ContainerReferenceId string

// ContainerSpecification defines model for ContainerSpecification.
type ContainerSpecification struct {

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

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

// ContainerSpecificationList defines model for ContainerSpecificationList.
type ContainerSpecificationList []ContainerSpecification

// CountryCode defines model for CountryCode.
type CountryCode string

// CreateShipmentRequest defines model for 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"`
}

// CreateShipmentResponse defines model for 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"`
}

// CreateShipmentResult defines model for 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"`
}

// Currency defines model for Currency.
type Currency struct {

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

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

// Dimensions defines model for 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"`
}

// Error defines model for 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"`
}

// ErrorList defines model for ErrorList.
type ErrorList []Error

// Event defines model for 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"`
}

// EventCode defines model for EventCode.
type EventCode string

// EventList defines model for EventList.
type EventList []Event

// GetAccountResponse defines model for 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"`
}

// GetRatesRequest defines model for 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"`
}

// GetRatesResponse defines model for 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"`
}

// GetRatesResult defines model for GetRatesResult.
type GetRatesResult struct {

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

// GetShipmentResponse defines model for 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"`
}

// GetTrackingInformationResponse defines model for 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"`
}

// Label defines model for 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"`
}

// LabelResult defines model for 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"`
}

// LabelResultList defines model for LabelResultList.
type LabelResultList []LabelResult

// LabelSpecification defines model for 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"`
}

// LabelStream defines model for LabelStream.
type LabelStream string

// Location defines model for 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"`
}

// Party defines model for Party.
type Party struct {

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

// PostalCode defines model for PostalCode.
type PostalCode string

// PromisedDeliveryDate defines model for PromisedDeliveryDate.
type PromisedDeliveryDate time.Time

// PurchaseLabelsRequest defines model for PurchaseLabelsRequest.
type PurchaseLabelsRequest struct {

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

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

// PurchaseLabelsResponse defines model for 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"`
}

// PurchaseLabelsResult defines model for 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"`
}

// PurchaseShipmentRequest defines model for 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"`
}

// PurchaseShipmentResponse defines model for 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"`
}

// PurchaseShipmentResult defines model for 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"`
}

// Rate defines model for 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"`
}

// RateId defines model for RateId.
type RateId string

// RateList defines model for RateList.
type RateList []Rate

// RetrieveShippingLabelRequest defines model for RetrieveShippingLabelRequest.
type RetrieveShippingLabelRequest struct {

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

// RetrieveShippingLabelResponse defines model for 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"`
}

// RetrieveShippingLabelResult defines model for 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"`
}

// ServiceRate defines model for 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"`
}

// ServiceRateList defines model for ServiceRateList.
type ServiceRateList []ServiceRate

// ServiceType defines model for ServiceType.
type ServiceType string

// List of 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"
)

// ServiceTypeList defines model for ServiceTypeList.
type ServiceTypeList []ServiceType

// Shipment defines model for 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"`
}

// ShipmentId defines model for ShipmentId.
type ShipmentId string

// ShippingPromiseSet defines model for ShippingPromiseSet.
type ShippingPromiseSet struct {

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

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

// StateOrRegion defines model for StateOrRegion.
type StateOrRegion string

// TimeRange defines model for 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"`
}

// TrackingId defines model for TrackingId.
type TrackingId string

// TrackingInformation defines model for 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"`
}

// TrackingSummary defines model for TrackingSummary.
type TrackingSummary struct {

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

// Weight defines model for Weight.
type Weight struct {

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

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

// PurchaseShipmentJSONBody defines parameters for PurchaseShipment.
type PurchaseShipmentJSONBody PurchaseShipmentRequest

// GetRatesJSONBody defines parameters for GetRates.
type GetRatesJSONBody GetRatesRequest

// CreateShipmentJSONBody defines parameters for CreateShipment.
type CreateShipmentJSONBody CreateShipmentRequest

// RetrieveShippingLabelJSONBody defines parameters for RetrieveShippingLabel.
type RetrieveShippingLabelJSONBody RetrieveShippingLabelRequest

// PurchaseLabelsJSONBody defines parameters for PurchaseLabels.
type PurchaseLabelsJSONBody PurchaseLabelsRequest

// PurchaseShipmentRequestBody defines body for PurchaseShipment for application/json ContentType.
type PurchaseShipmentJSONRequestBody PurchaseShipmentJSONBody

// GetRatesRequestBody defines body for GetRates for application/json ContentType.
type GetRatesJSONRequestBody GetRatesJSONBody

// CreateShipmentRequestBody defines body for CreateShipment for application/json ContentType.
type CreateShipmentJSONRequestBody CreateShipmentJSONBody

// RetrieveShippingLabelRequestBody defines body for RetrieveShippingLabel for application/json ContentType.
type RetrieveShippingLabelJSONRequestBody RetrieveShippingLabelJSONBody

// PurchaseLabelsRequestBody defines body for PurchaseLabels for application/json ContentType.
type PurchaseLabelsJSONRequestBody PurchaseLabelsJSONBody
