/**
 * Selling Partner API for Direct Fulfillment Orders
 * The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor\'s order data.
 *
 * The version of the OpenAPI document: v1
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */ import { Configuration } from './configuration' ; import globalAxios , { AxiosPromise , AxiosInstance } from 'axios' ; import { DUMMY_BASE_URL , assertParamExists , setApiKeyToObject , setBasicAuthToObject , setBearerAuthToObject , setOAuthToObject , setSearchParams , serializeDataIfNeeded , toPathString , createRequestFunction } from './common' ; import { BASE_PATH , COLLECTION_FORMATS , RequestArgs , BaseAPI , RequiredError } from './base' ; export interface export interface AcknowledgementStatus { type { string } memberof code ? : string ; type { string } memberof description ? : string ; } export interface export interface Address { type { string } memberof name : string ; type { string } memberof attention ? : string ; type { string } memberof addressLine1 : string ; type { string } memberof addressLine2 ? : string ; type { string } memberof addressLine3 ? : string ; type { string } memberof city ? : string ; type { string } memberof county ? : string ; type { string } memberof district ? : string ; type { string } memberof stateOrRegion : string ; type { string } memberof postalCode ? : string ; type { string } memberof countryCode : string ; type { string } memberof phone ? : string ; } export interface export interface GetOrderResponse { type { Order } memberof payload ? : Order ; type { Array < Error > } memberof errors ? : Array < Error > ; } export interface export interface GetOrdersResponse { type { OrderList } memberof payload ? : OrderList ; type { Array < Error > } memberof errors ? : Array < Error > ; } export interface export interface GiftDetails { type { string } memberof giftMessage ? : string ; type { string } memberof giftWrapId ? : string ; } export interface export interface ItemQuantity { type { number } memberof amount ? : number ; type { string } memberof unitOfMeasure ? : ItemQuantityUnitOfMeasureEnum | 'Each' ; } export enum { string } export enum ItemQuantityUnitOfMeasureEnum { Each = 'Each' } export interface export interface ModelError { type { string } memberof code : string ; type { string } memberof message : string ; type { string } memberof details ? : string ; } export interface export interface Money { type { string } memberof currencyCode ? : string ; type { string } memberof amount ? : string ; } export interface export interface Order { type { string } memberof purchaseOrderNumber : string ; type { OrderDetails } memberof orderDetails ? : OrderDetails ; } export interface export interface OrderAcknowledgementItem { type { string } memberof purchaseOrderNumber : string ; type { string } memberof vendorOrderNumber : string ; type { string } memberof acknowledgementDate : string ; type { AcknowledgementStatus } memberof acknowledgementStatus : AcknowledgementStatus ; type { PartyIdentification } memberof sellingParty : PartyIdentification ; type { PartyIdentification } memberof shipFromParty : PartyIdentification ; type { Array < OrderItemAcknowledgement > } memberof itemAcknowledgements : Array < OrderItemAcknowledgement > ; } export interface export interface OrderDetails { type { string } memberof customerOrderNumber : string ; type { string } memberof orderDate : string ; type { string } memberof orderStatus ? : OrderDetailsOrderStatusEnum | 'NEW' | 'SHIPPED' | 'ACCEPTED' | 'CANCELLED' ; type { ShipmentDetails } memberof shipmentDetails : ShipmentDetails ; type { OrderDetailsTaxTotal } memberof taxTotal ? : OrderDetailsTaxTotal ; type { PartyIdentification } memberof sellingParty : PartyIdentification ; type { PartyIdentification } memberof shipFromParty : PartyIdentification ; type { Address } memberof shipToParty : Address ; type { PartyIdentification } memberof billToParty : PartyIdentification ; type { Array < OrderItem > } memberof items : Array < OrderItem > ; } export enum { string } export enum OrderDetailsOrderStatusEnum { New = 'NEW' , Shipped = 'SHIPPED' , Accepted = 'ACCEPTED' , Cancelled = 'CANCELLED' } export interface export interface OrderDetailsTaxTotal { type { Array < TaxDetails > } memberof taxLineItem ? : Array < TaxDetails > ; } export interface export interface OrderItem { type { string } memberof itemSequenceNumber : string ; type { string } memberof buyerProductIdentifier ? : string ; type { string } memberof vendorProductIdentifier ? : string ; type { string } memberof title ? : string ; type { ItemQuantity } memberof orderedQuantity : ItemQuantity ; type { ScheduledDeliveryShipment } memberof scheduledDeliveryShipment ? : ScheduledDeliveryShipment ; type { GiftDetails } memberof giftDetails ? : GiftDetails ; type { Money } memberof netPrice : Money ; type { OrderItemTaxDetails } memberof taxDetails ? : OrderItemTaxDetails ; type { Money } memberof totalPrice ? : Money ; } export interface export interface OrderItemAcknowledgement { type { string } memberof itemSequenceNumber : string ; type { string } memberof buyerProductIdentifier ? : string ; type { string } memberof vendorProductIdentifier ? : string ; type { ItemQuantity } memberof acknowledgedQuantity : ItemQuantity ; } export interface export interface OrderItemTaxDetails { type { Array < TaxDetails > } memberof taxLineItem ? : Array < TaxDetails > ; } export interface export interface OrderList { type { Pagination } memberof pagination ? : Pagination ; type { Array < Order > } memberof orders ? : Array < Order > ; } export interface export interface Pagination { type { string } memberof nextToken ? : string ; } export interface export interface PartyIdentification { type { string } memberof partyId : string ; type { Address } memberof address ? : Address ; type { TaxRegistrationDetails } memberof taxInfo ? : TaxRegistrationDetails ; } export interface export interface ScheduledDeliveryShipment { type { string } memberof scheduledDeliveryServiceType ? : string ; type { string } memberof earliestNominatedDeliveryDate ? : string ; type { string } memberof latestNominatedDeliveryDate ? : string ; } export interface export interface ShipmentDates { type { string } memberof requiredShipDate : string ; type { string } memberof promisedDeliveryDate ? : string ; } export interface export interface ShipmentDetails { type { boolean } memberof isPriorityShipment : boolean ; type { boolean } memberof isScheduledDeliveryShipment ? : boolean ; type { boolean } memberof isPslipRequired : boolean ; type { boolean } memberof isGift ? : boolean ; type { string } memberof shipMethod : string ; type { ShipmentDates } memberof shipmentDates : ShipmentDates ; type { string } memberof messageToCustomer : string ; } export interface export interface SubmitAcknowledgementRequest { type { Array < OrderAcknowledgementItem > } memberof orderAcknowledgements ? : Array < OrderAcknowledgementItem > ; } export interface export interface SubmitAcknowledgementResponse { type { TransactionId } memberof payload ? : TransactionId ; type { Array < Error > } memberof errors ? : Array < Error > ; } export interface export interface TaxDetails { type { string } memberof taxRate ? : string ; type { Money } memberof taxAmount : Money ; type { Money } memberof taxableAmount ? : Money ; type { string } memberof type ? : TaxDetailsTypeEnum | 'CONSUMPTION' | 'GST' | 'MwSt.' | 'PST' | 'TOTAL' | 'TVA' | 'VAT' ; } export enum { string } export enum TaxDetailsTypeEnum { Consumption = 'CONSUMPTION' , Gst = 'GST' , MwSt = 'MwSt.' , Pst = 'PST' , Total = 'TOTAL' , Tva = 'TVA' , Vat = 'VAT' } export interface export interface TaxRegistrationDetails { type { string } memberof taxRegistrationType ? : TaxRegistrationDetailsTaxRegistrationTypeEnum | 'VAT' | 'GST' ; type { string } memberof taxRegistrationNumber : string ; type { Address } memberof taxRegistrationAddress ? : Address ; type { string } memberof taxRegistrationMessages ? : string ; } export enum { string } export enum TaxRegistrationDetailsTaxRegistrationTypeEnum { Vat = 'VAT' , Gst = 'GST' } export interface export interface TransactionId { type { string } memberof transactionId ? : string ; } export export const VendorOrdersApiAxiosParamCreator = function ( configuration ? ) { return { param { string } purchaseOrderNumber param { * } options throws getOrder : async ( purchaseOrderNumber , options = { } ) : Promise < RequestArgs > => { assertParamExists ( 'getOrder' , 'purchaseOrderNumber' , purchaseOrderNumber ) ; const localVarPath = `/vendor/directFulfillment/orders/v1/purchaseOrders/{purchaseOrderNumber}` . replace ( `{${ "purchaseOrderNumber" }}` , encodeURIComponent ( String ( purchaseOrderNumber ) ) ) ; const localVarUrlObj = new URL ( localVarPath , DUMMY_BASE_URL ) ; let baseOptions ; if ( configuration ) { baseOptions = configuration . baseOptions ; } const localVarRequestOptions = { method : 'GET' , ... baseOptions , ... options } ; const localVarHeaderParameter = { } as any ; const localVarQueryParameter = { } as any ; setSearchParams ( localVarUrlObj , localVarQueryParameter , options . query ) ; let headersFromBaseOptions = baseOptions && baseOptions . headers ? baseOptions . headers : { } ; localVarRequestOptions . headers = { ... localVarHeaderParameter , ... headersFromBaseOptions , ... options . headers } ; return { url : toPathString ( localVarUrlObj ) , options : localVarRequestOptions , } ; } , param { string } createdAfter param { string } createdBefore param { string } shipFromPartyId param { 'NEW' | 'SHIPPED' | 'ACCEPTED' | 'CANCELLED' } status param { number } limit param { 'ASC' | 'DESC' } sortOrder param { string } nextToken param { boolean } includeDetails param { * } options throws getOrders : async ( createdAfter , createdBefore , shipFromPartyId ? , status ? , limit ? , sortOrder ? , nextToken ? , includeDetails ? , options = { } ) : Promise < RequestArgs > => { assertParamExists ( 'getOrders' , 'createdAfter' , createdAfter ) ; assertParamExists ( 'getOrders' , 'createdBefore' , createdBefore ) ; const localVarPath = `/vendor/directFulfillment/orders/v1/purchaseOrders` ; const localVarUrlObj = new URL ( localVarPath , DUMMY_BASE_URL ) ; let baseOptions ; if ( configuration ) { baseOptions = configuration . baseOptions ; } const localVarRequestOptions = { method : 'GET' , ... baseOptions , ... options } ; const localVarHeaderParameter = { } as any ; const localVarQueryParameter = { } as any ; if ( shipFromPartyId !== undefined ) { localVarQueryParameter [ 'shipFromPartyId' ] = shipFromPartyId ; } if ( status !== undefined ) { localVarQueryParameter [ 'status' ] = status ; } if ( limit !== undefined ) { localVarQueryParameter [ 'limit' ] = limit ; } if ( createdAfter !== undefined ) { localVarQueryParameter [ 'createdAfter' ] = ( createdAfter as any instanceof Date ) ? ( createdAfter as any ) . toISOString ( ) : createdAfter ; } if ( createdBefore !== undefined ) { localVarQueryParameter [ 'createdBefore' ] = ( createdBefore as any instanceof Date ) ? ( createdBefore as any ) . toISOString ( ) : createdBefore ; } if ( sortOrder !== undefined ) { localVarQueryParameter [ 'sortOrder' ] = sortOrder ; } if ( nextToken !== undefined ) { localVarQueryParameter [ 'nextToken' ] = nextToken ; } if ( includeDetails !== undefined ) { localVarQueryParameter [ 'includeDetails' ] = includeDetails ; } setSearchParams ( localVarUrlObj , localVarQueryParameter , options . query ) ; let headersFromBaseOptions = baseOptions && baseOptions . headers ? baseOptions . headers : { } ; localVarRequestOptions . headers = { ... localVarHeaderParameter , ... headersFromBaseOptions , ... options . headers } ; return { url : toPathString ( localVarUrlObj ) , options : localVarRequestOptions , } ; } , param { SubmitAcknowledgementRequest } body param { * } options throws submitAcknowledgement : async ( body , options = { } ) : Promise < RequestArgs > => { assertParamExists ( 'submitAcknowledgement' , 'body' , body ) ; const localVarPath = `/vendor/directFulfillment/orders/v1/acknowledgements` ; const localVarUrlObj = new URL ( localVarPath , DUMMY_BASE_URL ) ; let baseOptions ; if ( configuration ) { baseOptions = configuration . baseOptions ; } const localVarRequestOptions = { method : 'POST' , ... baseOptions , ... options } ; const localVarHeaderParameter = { } as any ; const localVarQueryParameter = { } as any ; localVarHeaderParameter [ 'Content-Type' ] = 'application/json' ; setSearchParams ( localVarUrlObj , localVarQueryParameter , options . query ) ; let headersFromBaseOptions = baseOptions && baseOptions . headers ? baseOptions . headers : { } ; localVarRequestOptions . headers = { ... localVarHeaderParameter , ... headersFromBaseOptions , ... options . headers } ; localVarRequestOptions . data = serializeDataIfNeeded ( body , localVarRequestOptions , configuration ) ; return { url : toPathString ( localVarUrlObj ) , options : localVarRequestOptions , } ; } , } ; } ; export export const VendorOrdersApiFp = function ( configuration ? ) { const localVarAxiosParamCreator = VendorOrdersApiAxiosParamCreator ( configuration ) ; return { param { string } purchaseOrderNumber param { * } options throws async getOrder ( purchaseOrderNumber , options ? ) { const localVarAxiosArgs = await localVarAxiosParamCreator . getOrder ( purchaseOrderNumber , options ) ; return createRequestFunction ( localVarAxiosArgs , globalAxios , BASE_PATH , configuration ) ; } , param { string } createdAfter param { string } createdBefore param { string } shipFromPartyId param { 'NEW' | 'SHIPPED' | 'ACCEPTED' | 'CANCELLED' } status param { number } limit param { 'ASC' | 'DESC' } sortOrder param { string } nextToken param { boolean } includeDetails param { * } options throws async getOrders ( createdAfter , createdBefore , shipFromPartyId ? , status ? , limit ? , sortOrder ? , nextToken ? , includeDetails ? , options ? ) { const localVarAxiosArgs = await localVarAxiosParamCreator . getOrders ( createdAfter , createdBefore , shipFromPartyId , status , limit , sortOrder , nextToken , includeDetails , options ) ; return createRequestFunction ( localVarAxiosArgs , globalAxios , BASE_PATH , configuration ) ; } , param { SubmitAcknowledgementRequest } body param { * } options throws async submitAcknowledgement ( body , options ? ) { const localVarAxiosArgs = await localVarAxiosParamCreator . submitAcknowledgement ( body , options ) ; return createRequestFunction ( localVarAxiosArgs , globalAxios , BASE_PATH , configuration ) ; } , } ; } ; export export const VendorOrdersApiFactory = function ( configuration ? , basePath ? , axios ? ) { const localVarFp = VendorOrdersApiFp ( configuration ) ; return { param { string } purchaseOrderNumber param { * } options throws getOrder ( purchaseOrderNumber , options ? ) { return localVarFp . getOrder ( purchaseOrderNumber , options ) . then ( ( request ) => request ( axios , basePath ) ) ; } , param { string } createdAfter param { string } createdBefore param { string } shipFromPartyId param { 'NEW' | 'SHIPPED' | 'ACCEPTED' | 'CANCELLED' } status param { number } limit param { 'ASC' | 'DESC' } sortOrder param { string } nextToken param { boolean } includeDetails param { * } options throws getOrders ( createdAfter , createdBefore , shipFromPartyId ? , status ? , limit ? , sortOrder ? , nextToken ? , includeDetails ? , options ? ) { return localVarFp . getOrders ( createdAfter , createdBefore , shipFromPartyId , status , limit , sortOrder , nextToken , includeDetails , options ) . then ( ( request ) => request ( axios , basePath ) ) ; } , param { SubmitAcknowledgementRequest } body param { * } options throws submitAcknowledgement ( body , options ? ) { return localVarFp . submitAcknowledgement ( body , options ) . then ( ( request ) => request ( axios , basePath ) ) ; } , } ; } ; export interface export interface VendorOrdersApiGetOrderRequest { type { string } memberof readonly purchaseOrderNumber : string ; } export interface export interface VendorOrdersApiGetOrdersRequest { type { string } memberof readonly createdAfter : string ; type { string } memberof readonly createdBefore : string ; type { string } memberof readonly shipFromPartyId ? : string ; type { 'NEW' | 'SHIPPED' | 'ACCEPTED' | 'CANCELLED' } memberof readonly status ? : 'NEW' | 'SHIPPED' | 'ACCEPTED' | 'CANCELLED' ; type { number } memberof readonly limit ? : number ; type { 'ASC' | 'DESC' } memberof readonly sortOrder ? : 'ASC' | 'DESC' ; type { string } memberof readonly nextToken ? : string ; type { boolean } memberof readonly includeDetails ? : boolean ; } export interface export interface VendorOrdersApiSubmitAcknowledgementRequest { type { SubmitAcknowledgementRequest } memberof readonly body : SubmitAcknowledgementRequest ; } export class extends BaseAPI export class VendorOrdersApi extends BaseAPI { param { VendorOrdersApiGetOrderRequest } requestParameters param { * } options throws memberof public getOrder ( requestParameters , options ? ) { return VendorOrdersApiFp ( this . configuration ) . getOrder ( requestParameters . purchaseOrderNumber , options ) . then ( ( request ) => request ( this . axios , this . basePath ) ) ; } param { VendorOrdersApiGetOrdersRequest } requestParameters param { * } options throws memberof public getOrders ( requestParameters , options ? ) { return VendorOrdersApiFp ( this . configuration ) . getOrders ( requestParameters . createdAfter , requestParameters . createdBefore , requestParameters . shipFromPartyId , requestParameters . status , requestParameters . limit , requestParameters . sortOrder , requestParameters . nextToken , requestParameters . includeDetails , options ) . then ( ( request ) => request ( this . axios , this . basePath ) ) ; } param { VendorOrdersApiSubmitAcknowledgementRequest } requestParameters param { * } options throws memberof public submitAcknowledgement ( requestParameters , options ? ) { return VendorOrdersApiFp ( this . configuration ) . submitAcknowledgement ( requestParameters . body , options ) . then ( ( request ) => request ( this . axios , this . basePath ) ) ; } }