/**
 * Selling Partner API for Shipment Invoicing
 * The Selling Partner API for Shipment Invoicing helps you programmatically retrieve shipment invoice information in the Brazil marketplace for a selling partner’s Fulfillment by Amazon (FBA) orders.
 *
 * The version of the OpenAPI document: v0
 *
 *
 * 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 Address { type { string } memberof Name ? : 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 ; type { AddressTypeEnum } memberof AddressType ? : AddressTypeEnum | 'Residential' | 'Commercial' ; } export enum { string } export enum AddressTypeEnum { Residential = 'Residential' , Commercial = 'Commercial' } export interface export interface BuyerTaxInfo { type { string } memberof CompanyLegalName ? : string ; type { string } memberof TaxingRegion ? : string ; type { Array < TaxClassification > } memberof TaxClassifications ? : Array < TaxClassification > ; } export interface export interface GetInvoiceStatusResponse { type { ShipmentInvoiceStatusResponse } memberof payload ? : ShipmentInvoiceStatusResponse ; type { Array < Error > } memberof errors ? : Array < Error > ; } export interface export interface GetShipmentDetailsResponse { type { ShipmentDetail } memberof payload ? : ShipmentDetail ; type { Array < Error > } memberof errors ? : Array < Error > ; } export interface export interface MarketplaceTaxInfo { type { string } memberof CompanyLegalName ? : string ; type { string } memberof TaxingRegion ? : string ; type { Array < TaxClassification > } memberof TaxClassifications ? : Array < TaxClassification > ; } 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 ShipmentDetail { type { string } memberof WarehouseId ? : string ; type { string } memberof AmazonOrderId ? : string ; type { string } memberof AmazonShipmentId ? : string ; type { string } memberof PurchaseDate ? : string ; type { Address } memberof ShippingAddress ? : Address ; type { Array < string > } memberof PaymentMethodDetails ? : Array < string > ; type { string } memberof MarketplaceId ? : string ; type { string } memberof SellerId ? : string ; type { string } memberof BuyerName ? : string ; type { string } memberof BuyerCounty ? : string ; type { BuyerTaxInfo } memberof BuyerTaxInfo ? : BuyerTaxInfo ; type { MarketplaceTaxInfo } memberof MarketplaceTaxInfo ? : MarketplaceTaxInfo ; type { string } memberof SellerDisplayName ? : string ; type { Array < ShipmentItem > } memberof ShipmentItems ? : Array < ShipmentItem > ; } export enum { string } export enum ShipmentInvoiceStatus { Processing = 'Processing' , Accepted = 'Accepted' , Errored = 'Errored' , NotFound = 'NotFound' } export interface export interface ShipmentInvoiceStatusInfo { type { string } memberof AmazonShipmentId ? : string ; type { ShipmentInvoiceStatus } memberof InvoiceStatus ? : ShipmentInvoiceStatus | 'Processing' | 'Accepted' | 'Errored' | 'NotFound' ; } export interface export interface ShipmentInvoiceStatusResponse { type { ShipmentInvoiceStatusInfo } memberof Shipments ? : ShipmentInvoiceStatusInfo ; } export interface export interface ShipmentItem { type { string } memberof ASIN ? : string ; type { string } memberof SellerSKU ? : string ; type { string } memberof OrderItemId ? : string ; type { string } memberof Title ? : string ; type { number } memberof QuantityOrdered ? : number ; type { Money } memberof ItemPrice ? : Money ; type { Money } memberof ShippingPrice ? : Money ; type { Money } memberof GiftWrapPrice ? : Money ; type { Money } memberof ShippingDiscount ? : Money ; type { Money } memberof PromotionDiscount ? : Money ; type { Array < string > } memberof SerialNumbers ? : Array < string > ; } export interface export interface SubmitInvoiceRequest { type { string } memberof InvoiceContent : string ; type { string } memberof MarketplaceId ? : string ; type { string } memberof ContentMD5Value : string ; } export interface export interface SubmitInvoiceResponse { type { Array < Error > } memberof errors ? : Array < Error > ; } export interface export interface TaxClassification { type { string } memberof Name ? : string ; type { string } memberof Value ? : string ; } export export const ShipmentInvoiceApiAxiosParamCreator = function ( configuration ? ) { return { param { string } shipmentId param { * } options throws getInvoiceStatus : async ( shipmentId , options = { } ) : Promise < RequestArgs > => { assertParamExists ( 'getInvoiceStatus' , 'shipmentId' , shipmentId ) ; const localVarPath = `/fba/outbound/brazil/v0/shipments/{shipmentId}/invoice/status` . replace ( `{${ "shipmentId" }}` , encodeURIComponent ( String ( shipmentId ) ) ) ; 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 } shipmentId param { * } options throws getShipmentDetails : async ( shipmentId , options = { } ) : Promise < RequestArgs > => { assertParamExists ( 'getShipmentDetails' , 'shipmentId' , shipmentId ) ; const localVarPath = `/fba/outbound/brazil/v0/shipments/{shipmentId}` . replace ( `{${ "shipmentId" }}` , encodeURIComponent ( String ( shipmentId ) ) ) ; 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 } shipmentId param { SubmitInvoiceRequest } body param { * } options throws submitInvoice : async ( shipmentId , body , options = { } ) : Promise < RequestArgs > => { assertParamExists ( 'submitInvoice' , 'shipmentId' , shipmentId ) ; assertParamExists ( 'submitInvoice' , 'body' , body ) ; const localVarPath = `/fba/outbound/brazil/v0/shipments/{shipmentId}/invoice` . replace ( `{${ "shipmentId" }}` , encodeURIComponent ( String ( shipmentId ) ) ) ; 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 ShipmentInvoiceApiFp = function ( configuration ? ) { const localVarAxiosParamCreator = ShipmentInvoiceApiAxiosParamCreator ( configuration ) ; return { param { string } shipmentId param { * } options throws async getInvoiceStatus ( shipmentId , options ? ) { const localVarAxiosArgs = await localVarAxiosParamCreator . getInvoiceStatus ( shipmentId , options ) ; return createRequestFunction ( localVarAxiosArgs , globalAxios , BASE_PATH , configuration ) ; } , param { string } shipmentId param { * } options throws async getShipmentDetails ( shipmentId , options ? ) { const localVarAxiosArgs = await localVarAxiosParamCreator . getShipmentDetails ( shipmentId , options ) ; return createRequestFunction ( localVarAxiosArgs , globalAxios , BASE_PATH , configuration ) ; } , param { string } shipmentId param { SubmitInvoiceRequest } body param { * } options throws async submitInvoice ( shipmentId , body , options ? ) { const localVarAxiosArgs = await localVarAxiosParamCreator . submitInvoice ( shipmentId , body , options ) ; return createRequestFunction ( localVarAxiosArgs , globalAxios , BASE_PATH , configuration ) ; } , } ; } ; export export const ShipmentInvoiceApiFactory = function ( configuration ? , basePath ? , axios ? ) { const localVarFp = ShipmentInvoiceApiFp ( configuration ) ; return { param { string } shipmentId param { * } options throws getInvoiceStatus ( shipmentId , options ? ) { return localVarFp . getInvoiceStatus ( shipmentId , options ) . then ( ( request ) => request ( axios , basePath ) ) ; } , param { string } shipmentId param { * } options throws getShipmentDetails ( shipmentId , options ? ) { return localVarFp . getShipmentDetails ( shipmentId , options ) . then ( ( request ) => request ( axios , basePath ) ) ; } , param { string } shipmentId param { SubmitInvoiceRequest } body param { * } options throws submitInvoice ( shipmentId , body , options ? ) { return localVarFp . submitInvoice ( shipmentId , body , options ) . then ( ( request ) => request ( axios , basePath ) ) ; } , } ; } ; export interface export interface ShipmentInvoiceApiGetInvoiceStatusRequest { type { string } memberof readonly shipmentId : string ; } export interface export interface ShipmentInvoiceApiGetShipmentDetailsRequest { type { string } memberof readonly shipmentId : string ; } export interface export interface ShipmentInvoiceApiSubmitInvoiceRequest { type { string } memberof readonly shipmentId : string ; type { SubmitInvoiceRequest } memberof readonly body : SubmitInvoiceRequest ; } export class extends BaseAPI export class ShipmentInvoiceApi extends BaseAPI { param { ShipmentInvoiceApiGetInvoiceStatusRequest } requestParameters param { * } options throws memberof public getInvoiceStatus ( requestParameters , options ? ) { return ShipmentInvoiceApiFp ( this . configuration ) . getInvoiceStatus ( requestParameters . shipmentId , options ) . then ( ( request ) => request ( this . axios , this . basePath ) ) ; } param { ShipmentInvoiceApiGetShipmentDetailsRequest } requestParameters param { * } options throws memberof public getShipmentDetails ( requestParameters , options ? ) { return ShipmentInvoiceApiFp ( this . configuration ) . getShipmentDetails ( requestParameters . shipmentId , options ) . then ( ( request ) => request ( this . axios , this . basePath ) ) ; } param { ShipmentInvoiceApiSubmitInvoiceRequest } requestParameters param { * } options throws memberof public submitInvoice ( requestParameters , options ? ) { return ShipmentInvoiceApiFp ( this . configuration ) . submitInvoice ( requestParameters . shipmentId , requestParameters . body , options ) . then ( ( request ) => request ( this . axios , this . basePath ) ) ; } }