vendorInvoice

package
v0.0.0-...-f22db7b Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package vendorInvoice provides primitives to interact the openapi HTTP API.

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

Package vendorInvoice 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 NewSubmitInvoiceRequest

func NewSubmitInvoiceRequest(endpoint string, body SubmitInvoiceJSONRequestBody) (*http.Request, error)

NewSubmitInvoiceRequest calls the generic SubmitInvoice builder with application/json body

func NewSubmitInvoiceRequestWithBody

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

NewSubmitInvoiceRequestWithBody generates requests for SubmitInvoice with any type of body

Types

type AdditionalDetails

type AdditionalDetails struct {

	// The detail of the additional information provided by the selling party.
	Detail string `json:"detail"`

	// The language code of the additional information detail.
	LanguageCode *string `json:"languageCode,omitempty"`

	// The type of the additional information provided by the selling party.
	Type string `json:"type"`
}

AdditionalDetails defines model for AdditionalDetails.

type Address

type Address struct {

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

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

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

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

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

	// The county where person, business or institution is located.
	County *string `json:"county,omitempty"`

	// The district where person, business or institution is located.
	District *string `json:"district,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.
	Phone *string `json:"phone,omitempty"`

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

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

Address defines model for Address.

type ChargeDetails

type ChargeDetails struct {

	// An amount of money, including units in the form of currency.
	ChargeAmount Money `json:"chargeAmount"`

	// Individual tax details per line item.
	TaxDetails *[]TaxDetail `json:"taxDetails,omitempty"`

	// Type of charge applied.
	Type string `json:"type"`
}

ChargeDetails defines model for ChargeDetails.

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

func (c *Client) SubmitInvoice(ctx context.Context, body SubmitInvoiceJSONRequestBody) (*http.Response, error)

func (*Client) SubmitInvoiceWithBody

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

type ClientInterface

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

	SubmitInvoice(ctx context.Context, body SubmitInvoiceJSONRequestBody) (*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) SubmitInvoiceWithBodyWithResponse

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

SubmitInvoiceWithBodyWithResponse request with arbitrary body returning *SubmitInvoiceResponse

func (*ClientWithResponses) SubmitInvoiceWithResponse

func (c *ClientWithResponses) SubmitInvoiceWithResponse(ctx context.Context, body SubmitInvoiceJSONRequestBody) (*SubmitInvoiceResp, error)

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// SubmitInvoice request  with any body
	SubmitInvoiceWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*SubmitInvoiceResp, error)

	SubmitInvoiceWithResponse(ctx context.Context, body SubmitInvoiceJSONRequestBody) (*SubmitInvoiceResp, error)
}

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

type Decimal

type Decimal string

Decimal defines model for Decimal.

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

type InvoiceDetail struct {

	// Additional details provided by the selling party, for tax related or other purposes.
	AdditionalDetails *[]AdditionalDetails `json:"additionalDetails,omitempty"`
	BillToParty       *PartyIdentification `json:"billToParty,omitempty"`

	// Total charge amount details for all line items.
	ChargeDetails *[]ChargeDetails `json:"chargeDetails,omitempty"`

	// Invoice date.
	InvoiceDate time.Time `json:"invoiceDate"`

	// The unique invoice number.
	InvoiceNumber string `json:"invoiceNumber"`

	// An amount of money, including units in the form of currency.
	InvoiceTotal Money `json:"invoiceTotal"`

	// Provides the details of the items in this invoice.
	Items []InvoiceItem `json:"items"`

	// The payment terms for the invoice.
	PaymentTermsCode *string `json:"paymentTermsCode,omitempty"`

	// An additional unique reference number used for regulatory or other purposes.
	ReferenceNumber *string             `json:"referenceNumber,omitempty"`
	RemitToParty    PartyIdentification `json:"remitToParty"`
	ShipFromParty   PartyIdentification `json:"shipFromParty"`

	// Ship-to country code.
	ShipToCountryCode *string `json:"shipToCountryCode,omitempty"`

	// Individual tax details per line item.
	TaxTotals *[]TaxDetail `json:"taxTotals,omitempty"`
}

InvoiceDetail defines model for InvoiceDetail.

type InvoiceItem

type InvoiceItem struct {

	// Buyer's standard identification number (ASIN) of an item.
	BuyerProductIdentifier *string `json:"buyerProductIdentifier,omitempty"`

	// Individual charge details per line item.
	ChargeDetails *[]ChargeDetails `json:"chargeDetails,omitempty"`

	// HSN tax code. The HSN number cannot contain alphabets.
	HsnCode *string `json:"hsnCode,omitempty"`

	// Details of item quantity.
	InvoicedQuantity ItemQuantity `json:"invoicedQuantity"`

	// Numbering of the item on the purchase order. The first item will be 1, the second 2, and so on.
	ItemSequenceNumber string `json:"itemSequenceNumber"`

	// An amount of money, including units in the form of currency.
	NetCost Money `json:"netCost"`

	// The purchase order number for this order. Formatting Notes: 8-character alpha-numeric code.
	PurchaseOrderNumber string `json:"purchaseOrderNumber"`

	// Individual tax details per line item.
	TaxDetails *[]TaxDetail `json:"taxDetails,omitempty"`

	// The vendor's order number for this order.
	VendorOrderNumber *string `json:"vendorOrderNumber,omitempty"`

	// The vendor selected product identification of the item.
	VendorProductIdentifier *string `json:"vendorProductIdentifier,omitempty"`
}

InvoiceItem defines model for InvoiceItem.

type ItemQuantity

type ItemQuantity struct {

	// Quantity of units available for a specific item.
	Amount int `json:"amount"`

	// Unit of measure for the available quantity.
	UnitOfMeasure string `json:"unitOfMeasure"`
}

ItemQuantity defines model for ItemQuantity.

type Money

type Money struct {

	// A decimal number with no loss of precision. Useful when precision loss is unacceptable, as with currencies. Follows RFC7159 for number representation. <br>**Pattern** : `^-?(0|([1-9]\d*))(\.\d+)?([eE][+-]?\d+)?$`.
	Amount Decimal `json:"amount"`

	// Three digit currency code in ISO 4217 format.
	CurrencyCode string `json:"currencyCode"`
}

Money defines model for Money.

type PartyIdentification

type PartyIdentification struct {

	// Address of the party.
	Address *Address `json:"address,omitempty"`

	// Assigned Identification for the party.
	PartyId string `json:"partyId"`

	// Tax registration details of the entity.
	TaxRegistrationDetails *[]TaxRegistrationDetail `json:"taxRegistrationDetails,omitempty"`
}

PartyIdentification defines model for PartyIdentification.

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 SubmitInvoiceJSONBody

type SubmitInvoiceJSONBody SubmitInvoiceRequest

SubmitInvoiceJSONBody defines parameters for SubmitInvoice.

type SubmitInvoiceJSONRequestBody

type SubmitInvoiceJSONRequestBody SubmitInvoiceJSONBody

SubmitInvoiceRequestBody defines body for SubmitInvoice for application/json ContentType.

type SubmitInvoiceRequest

type SubmitInvoiceRequest struct {
	Invoices *[]InvoiceDetail `json:"invoices,omitempty"`
}

SubmitInvoiceRequest defines model for SubmitInvoiceRequest.

type SubmitInvoiceResp

type SubmitInvoiceResp struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON202      *SubmitInvoiceResponse
	JSON400      *SubmitInvoiceResponse
	JSON403      *SubmitInvoiceResponse
	JSON404      *SubmitInvoiceResponse
	JSON413      *SubmitInvoiceResponse
	JSON415      *SubmitInvoiceResponse
	JSON429      *SubmitInvoiceResponse
	JSON500      *SubmitInvoiceResponse
	JSON503      *SubmitInvoiceResponse
}

func ParseSubmitInvoiceResp

func ParseSubmitInvoiceResp(rsp *http.Response) (*SubmitInvoiceResp, error)

ParseSubmitInvoiceResp parses an HTTP response from a SubmitInvoiceWithResponse call

func (SubmitInvoiceResp) Status

func (r SubmitInvoiceResp) Status() string

Status returns HTTPResponse.Status

func (SubmitInvoiceResp) StatusCode

func (r SubmitInvoiceResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type SubmitInvoiceResponse

type SubmitInvoiceResponse struct {

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

SubmitInvoiceResponse defines model for SubmitInvoiceResponse.

type TaxDetail

type TaxDetail struct {

	// An amount of money, including units in the form of currency.
	TaxAmount Money `json:"taxAmount"`

	// A decimal number with no loss of precision. Useful when precision loss is unacceptable, as with currencies. Follows RFC7159 for number representation. <br>**Pattern** : `^-?(0|([1-9]\d*))(\.\d+)?([eE][+-]?\d+)?$`.
	TaxRate *Decimal `json:"taxRate,omitempty"`

	// Type of the tax applied.
	TaxType string `json:"taxType"`

	// An amount of money, including units in the form of currency.
	TaxableAmount *Money `json:"taxableAmount,omitempty"`
}

TaxDetail defines model for TaxDetail.

type TaxRegistrationDetail

type TaxRegistrationDetail struct {

	// Address of the party.
	TaxRegistrationAddress *Address `json:"taxRegistrationAddress,omitempty"`

	// Tax registration message that can be used for additional tax related details.
	TaxRegistrationMessage *string `json:"taxRegistrationMessage,omitempty"`

	// Tax registration number for the party. For example, VAT ID.
	TaxRegistrationNumber string `json:"taxRegistrationNumber"`

	// Tax registration type for the entity.
	TaxRegistrationType *string `json:"taxRegistrationType,omitempty"`
}

TaxRegistrationDetail defines model for TaxRegistrationDetail.

type TransactionReference

type TransactionReference struct {

	// GUID to identify this transaction. This value can be used with the Transaction Status API to return the status of this transaction.
	TransactionId *string `json:"transactionId,omitempty"`
}

TransactionReference defines model for TransactionReference.

Jump to

Keyboard shortcuts

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