diff --git a/README.md b/README.md index 2c93221..31d5288 100644 --- a/README.md +++ b/README.md @@ -201,12 +201,20 @@ This PHP package is automatically generated by the [OpenAPI Generator](https://o Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*DataInputFieldsApi* | [**getDataInputFields**](docs/EInvoicing/V1/DataInputFieldsApi.md#getdatainputfields) | **GET** /data-input-fields | Returns the mandatory and conditional invoice or creditnote input fields for different country mandates +*DataInputFieldsApi* | [**getDataInputFields**](docs/EInvoicing/V1/DataInputFieldsApi.md#getdatainputfields) | **GET** /data-input-fields | Returns the optionality of document fields for different country mandates *DocumentsApi* | [**downloadDocument**](docs/EInvoicing/V1/DocumentsApi.md#downloaddocument) | **GET** /documents/{documentId}/$download | Returns a copy of the document +*DocumentsApi* | [**fetchDocuments**](docs/EInvoicing/V1/DocumentsApi.md#fetchdocuments) | **POST** /documents/$fetch | Fetch the inbound document from a tax authority *DocumentsApi* | [**getDocumentList**](docs/EInvoicing/V1/DocumentsApi.md#getdocumentlist) | **GET** /documents | Returns a summary of documents for a date range -*DocumentsApi* | [**getDocumentStatus**](docs/EInvoicing/V1/DocumentsApi.md#getdocumentstatus) | **GET** /document/{documentId}/status | Checks the status of a document +*DocumentsApi* | [**getDocumentStatus**](docs/EInvoicing/V1/DocumentsApi.md#getdocumentstatus) | **GET** /documents/{documentId}/status | Checks the status of a document *DocumentsApi* | [**submitDocument**](docs/EInvoicing/V1/DocumentsApi.md#submitdocument) | **POST** /documents | Submits a document to Avalara E-Invoicing API +*InteropApi* | [**submitInteropDocument**](docs/EInvoicing/V1/InteropApi.md#submitinteropdocument) | **POST** /interop/documents | Submit a document +*MandatesApi* | [**getMandateDataInputFields**](docs/EInvoicing/V1/MandatesApi.md#getmandatedatainputfields) | **GET** /mandates/{mandateId}/data-input-fields | Returns document field information for a country mandate, a selected document type, and its version *MandatesApi* | [**getMandates**](docs/EInvoicing/V1/MandatesApi.md#getmandates) | **GET** /mandates | List country mandates that are supported by the Avalara E-Invoicing platform +*TradingPartnersApi* | [**batchSearchParticipants**](docs/EInvoicing/V1/TradingPartnersApi.md#batchsearchparticipants) | **POST** /trading-partners/batch-searches | Creates a batch search and performs a batch search in the directory for participants in the background. +*TradingPartnersApi* | [**downloadBatchSearchReport**](docs/EInvoicing/V1/TradingPartnersApi.md#downloadbatchsearchreport) | **GET** /trading-partners/batch-searches/{id}/$download-results | Download batch search results in a csv file. +*TradingPartnersApi* | [**getBatchSearchDetail**](docs/EInvoicing/V1/TradingPartnersApi.md#getbatchsearchdetail) | **GET** /trading-partners/batch-searches/{id} | Get the batch search details for a given id. +*TradingPartnersApi* | [**listBatchSearches**](docs/EInvoicing/V1/TradingPartnersApi.md#listbatchsearches) | **GET** /trading-partners/batch-searches | List all batch searches that were previously submitted. +*TradingPartnersApi* | [**searchParticipants**](docs/EInvoicing/V1/TradingPartnersApi.md#searchparticipants) | **GET** /trading-partners | Returns a list of participants matching the input query. ## Documentation for Models @@ -216,26 +224,40 @@ Class | Method | HTTP request | Description - [Avalara\SDK\Model\EInvoicing\V1\BadDownloadRequest](docs/EInvoicing/V1/BadDownloadRequest.md) - [Avalara\SDK\Model\EInvoicing\V1\BadRequest](docs/EInvoicing/V1/BadRequest.md) + - [Avalara\SDK\Model\EInvoicing\V1\BatchSearch](docs/EInvoicing/V1/BatchSearch.md) + - [Avalara\SDK\Model\EInvoicing\V1\BatchSearchListResponse](docs/EInvoicing/V1/BatchSearchListResponse.md) - [Avalara\SDK\Model\EInvoicing\V1\ConditionalForField](docs/EInvoicing/V1/ConditionalForField.md) - [Avalara\SDK\Model\EInvoicing\V1\DataInputField](docs/EInvoicing/V1/DataInputField.md) - [Avalara\SDK\Model\EInvoicing\V1\DataInputFieldNotUsedFor](docs/EInvoicing/V1/DataInputFieldNotUsedFor.md) - [Avalara\SDK\Model\EInvoicing\V1\DataInputFieldOptionalFor](docs/EInvoicing/V1/DataInputFieldOptionalFor.md) - [Avalara\SDK\Model\EInvoicing\V1\DataInputFieldRequiredFor](docs/EInvoicing/V1/DataInputFieldRequiredFor.md) - [Avalara\SDK\Model\EInvoicing\V1\DataInputFieldsResponse](docs/EInvoicing/V1/DataInputFieldsResponse.md) + - [Avalara\SDK\Model\EInvoicing\V1\DirectorySearchResponse](docs/EInvoicing/V1/DirectorySearchResponse.md) + - [Avalara\SDK\Model\EInvoicing\V1\DirectorySearchResponseValueInner](docs/EInvoicing/V1/DirectorySearchResponseValueInner.md) + - [Avalara\SDK\Model\EInvoicing\V1\DirectorySearchResponseValueInnerAddressesInner](docs/EInvoicing/V1/DirectorySearchResponseValueInnerAddressesInner.md) + - [Avalara\SDK\Model\EInvoicing\V1\DirectorySearchResponseValueInnerIdentifiersInner](docs/EInvoicing/V1/DirectorySearchResponseValueInnerIdentifiersInner.md) + - [Avalara\SDK\Model\EInvoicing\V1\DirectorySearchResponseValueInnerSupportedDocumentTypesInner](docs/EInvoicing/V1/DirectorySearchResponseValueInnerSupportedDocumentTypesInner.md) + - [Avalara\SDK\Model\EInvoicing\V1\DocumentFetch](docs/EInvoicing/V1/DocumentFetch.md) + - [Avalara\SDK\Model\EInvoicing\V1\DocumentFetchRequest](docs/EInvoicing/V1/DocumentFetchRequest.md) + - [Avalara\SDK\Model\EInvoicing\V1\DocumentFetchRequestDataInner](docs/EInvoicing/V1/DocumentFetchRequestDataInner.md) + - [Avalara\SDK\Model\EInvoicing\V1\DocumentFetchRequestMetadata](docs/EInvoicing/V1/DocumentFetchRequestMetadata.md) - [Avalara\SDK\Model\EInvoicing\V1\DocumentListResponse](docs/EInvoicing/V1/DocumentListResponse.md) - [Avalara\SDK\Model\EInvoicing\V1\DocumentStatusResponse](docs/EInvoicing/V1/DocumentStatusResponse.md) - [Avalara\SDK\Model\EInvoicing\V1\DocumentSubmissionError](docs/EInvoicing/V1/DocumentSubmissionError.md) - [Avalara\SDK\Model\EInvoicing\V1\DocumentSubmitResponse](docs/EInvoicing/V1/DocumentSubmitResponse.md) - [Avalara\SDK\Model\EInvoicing\V1\DocumentSummary](docs/EInvoicing/V1/DocumentSummary.md) + - [Avalara\SDK\Model\EInvoicing\V1\ErrorResponse](docs/EInvoicing/V1/ErrorResponse.md) - [Avalara\SDK\Model\EInvoicing\V1\ForbiddenError](docs/EInvoicing/V1/ForbiddenError.md) - [Avalara\SDK\Model\EInvoicing\V1\InputDataFormats](docs/EInvoicing/V1/InputDataFormats.md) - [Avalara\SDK\Model\EInvoicing\V1\InternalServerError](docs/EInvoicing/V1/InternalServerError.md) - [Avalara\SDK\Model\EInvoicing\V1\Mandate](docs/EInvoicing/V1/Mandate.md) + - [Avalara\SDK\Model\EInvoicing\V1\MandateDataInputField](docs/EInvoicing/V1/MandateDataInputField.md) + - [Avalara\SDK\Model\EInvoicing\V1\MandateDataInputFieldNamespace](docs/EInvoicing/V1/MandateDataInputFieldNamespace.md) - [Avalara\SDK\Model\EInvoicing\V1\MandatesResponse](docs/EInvoicing/V1/MandatesResponse.md) - [Avalara\SDK\Model\EInvoicing\V1\NotFoundError](docs/EInvoicing/V1/NotFoundError.md) - [Avalara\SDK\Model\EInvoicing\V1\NotUsedForField](docs/EInvoicing/V1/NotUsedForField.md) - [Avalara\SDK\Model\EInvoicing\V1\RequiredWhenField](docs/EInvoicing/V1/RequiredWhenField.md) - [Avalara\SDK\Model\EInvoicing\V1\StatusEvent](docs/EInvoicing/V1/StatusEvent.md) - - [Avalara\SDK\Model\EInvoicing\V1\SubmitDocumentData](docs/EInvoicing/V1/SubmitDocumentData.md) - [Avalara\SDK\Model\EInvoicing\V1\SubmitDocumentMetadata](docs/EInvoicing/V1/SubmitDocumentMetadata.md) + - [Avalara\SDK\Model\EInvoicing\V1\SubmitInteropDocument202Response](docs/EInvoicing/V1/SubmitInteropDocument202Response.md) - [Avalara\SDK\Model\EInvoicing\V1\WorkflowIds](docs/EInvoicing/V1/WorkflowIds.md) diff --git a/docs/EInvoicing/BatchSearch.md b/docs/EInvoicing/BatchSearch.md new file mode 100644 index 0000000..be91207 --- /dev/null +++ b/docs/EInvoicing/BatchSearch.md @@ -0,0 +1,15 @@ +# # BatchSearch + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | ID of the batch search | [optional] +**name** | **string** | Name of the batch report | [optional] +**created_by** | **string** | Email of the user who created the batch search | [optional] +**created** | **\DateTime** | Timestamp when the batch search was created | [optional] +**last_modified** | **\DateTime** | Timestamp when the batch search was created | [optional] +**status** | **string** | Status of the batch search | [optional] +**error** | [**\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse**](ErrorResponse.md) | | [optional] + +[[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/BatchSearchListResponse.md b/docs/EInvoicing/BatchSearchListResponse.md new file mode 100644 index 0000000..f3c297d --- /dev/null +++ b/docs/EInvoicing/BatchSearchListResponse.md @@ -0,0 +1,11 @@ +# # BatchSearchListResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**at_record_set_count** | **int** | The count of records in the result set | [optional] +**at_next_link** | **string** | Next Link | [optional] +**value** | [**\Avalara\SDK\Model\EInvoicing\V1\BatchSearch[]**](BatchSearch.md) | | [optional] + +[[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/DataInputField.md b/docs/EInvoicing/DataInputField.md index 8c0616d..21314f3 100644 --- a/docs/EInvoicing/DataInputField.md +++ b/docs/EInvoicing/DataInputField.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **field_id** | **string** | Field ID | [optional] **applicable_document_roots** | **object[]** | | [optional] **path** | **string** | Path to this field | [optional] -**name_space** | **string** | Namespace of this field | [optional] +**namespace** | **string** | Namespace of this field | [optional] **field_name** | **string** | Field name | [optional] **example_or_fixed_value** | **string** | An example of the content for this field | [optional] **accepted_values** | **object** | An object representing the acceptable values for this field | [optional] diff --git a/docs/EInvoicing/DataInputFieldsResponse.md b/docs/EInvoicing/DataInputFieldsResponse.md index ab063b0..3ca3622 100644 --- a/docs/EInvoicing/DataInputFieldsResponse.md +++ b/docs/EInvoicing/DataInputFieldsResponse.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**at_record_set_count** | **float** | Total count of results | [optional] +**at_recordset_count** | **float** | Total count of results | [optional] **at_next_link** | **string** | | [optional] **value** | [**\Avalara\SDK\Model\EInvoicing\V1\DataInputField[]**](DataInputField.md) | Array of Data Input Fields | [optional] diff --git a/docs/EInvoicing/DirectorySearchResponse.md b/docs/EInvoicing/DirectorySearchResponse.md new file mode 100644 index 0000000..03dd455 --- /dev/null +++ b/docs/EInvoicing/DirectorySearchResponse.md @@ -0,0 +1,11 @@ +# # DirectorySearchResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**at_record_set_count** | **int** | The count of records in the result set | [optional] +**at_next_link** | **string** | The next page link to get the next set of results. | [optional] +**value** | [**\Avalara\SDK\Model\EInvoicing\V1\DirectorySearchResponseValueInner[]**](DirectorySearchResponseValueInner.md) | | [optional] + +[[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/DirectorySearchResponseValueInner.md b/docs/EInvoicing/DirectorySearchResponseValueInner.md new file mode 100644 index 0000000..9e1b549 --- /dev/null +++ b/docs/EInvoicing/DirectorySearchResponseValueInner.md @@ -0,0 +1,15 @@ +# # DirectorySearchResponseValueInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | Avalara unique ID of the participant in the directory. | [optional] +**name** | **string** | Name of the participant (typically, the name of the business entity). | [optional] +**network** | **string** | The network where the participant is present. | [optional] +**registration_date** | **\DateTime** | Registration date of the participant if available | [optional] +**identifiers** | [**\Avalara\SDK\Model\EInvoicing\V1\DirectorySearchResponseValueInnerIdentifiersInner[]**](DirectorySearchResponseValueInnerIdentifiersInner.md) | | [optional] +**addresses** | [**\Avalara\SDK\Model\EInvoicing\V1\DirectorySearchResponseValueInnerAddressesInner[]**](DirectorySearchResponseValueInnerAddressesInner.md) | | [optional] +**supported_document_types** | [**\Avalara\SDK\Model\EInvoicing\V1\DirectorySearchResponseValueInnerSupportedDocumentTypesInner[]**](DirectorySearchResponseValueInnerSupportedDocumentTypesInner.md) | | [optional] + +[[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/DirectorySearchResponseValueInnerAddressesInner.md b/docs/EInvoicing/DirectorySearchResponseValueInnerAddressesInner.md new file mode 100644 index 0000000..61066ac --- /dev/null +++ b/docs/EInvoicing/DirectorySearchResponseValueInnerAddressesInner.md @@ -0,0 +1,13 @@ +# # DirectorySearchResponseValueInnerAddressesInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**line1** | **string** | Address line 1 | [optional] +**line2** | **string** | Address line 2 | [optional] +**city** | **string** | City | [optional] +**state** | **string** | State | [optional] +**country** | **string** | Country | [optional] + +[[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/DirectorySearchResponseValueInnerIdentifiersInner.md b/docs/EInvoicing/DirectorySearchResponseValueInnerIdentifiersInner.md new file mode 100644 index 0000000..2de42e8 --- /dev/null +++ b/docs/EInvoicing/DirectorySearchResponseValueInnerIdentifiersInner.md @@ -0,0 +1,10 @@ +# # DirectorySearchResponseValueInnerIdentifiersInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | Peppol Participant ID if the participant is in Peppol network | [optional] +**value** | **string** | Value of the identifier | [optional] + +[[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/DirectorySearchResponseValueInnerSupportedDocumentTypesInner.md b/docs/EInvoicing/DirectorySearchResponseValueInnerSupportedDocumentTypesInner.md new file mode 100644 index 0000000..bdb224c --- /dev/null +++ b/docs/EInvoicing/DirectorySearchResponseValueInnerSupportedDocumentTypesInner.md @@ -0,0 +1,12 @@ +# # DirectorySearchResponseValueInnerSupportedDocumentTypesInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | Document type name. | [optional] +**value** | **string** | Document type identifier. | [optional] +**supported_by_trading_partner** | **bool** | Does trading partner support receiving this document type | [optional] +**supported_by_avalara** | **bool** | Does avalara support exchanging this document type | [optional] + +[[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/DocumentFetch.md b/docs/EInvoicing/DocumentFetch.md new file mode 100644 index 0000000..2200dc0 --- /dev/null +++ b/docs/EInvoicing/DocumentFetch.md @@ -0,0 +1,11 @@ +# # DocumentFetch + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | Unique ID for this document that can be used for status checking and file downloads. This is a UID created by the Avalara E-Invoicing platform. | [optional] +**status** | **string** | Status of the document | [optional] +**event_date_time** | **string** | The date and time when the inbound document was accepted by the Avalara E-Invoicing Platform | [optional] + +[[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/DocumentFetchRequest.md b/docs/EInvoicing/DocumentFetchRequest.md new file mode 100644 index 0000000..6dee56c --- /dev/null +++ b/docs/EInvoicing/DocumentFetchRequest.md @@ -0,0 +1,10 @@ +# # DocumentFetchRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Avalara\SDK\Model\EInvoicing\V1\DocumentFetchRequestDataInner[]**](DocumentFetchRequestDataInner.md) | Array of key-value pairs used to retrieve inbound documents from the Tax Authority | [optional] +**metadata** | [**\Avalara\SDK\Model\EInvoicing\V1\DocumentFetchRequestMetadata**](DocumentFetchRequestMetadata.md) | | [optional] + +[[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/DocumentFetchRequestDataInner.md b/docs/EInvoicing/DocumentFetchRequestDataInner.md new file mode 100644 index 0000000..634e1f3 --- /dev/null +++ b/docs/EInvoicing/DocumentFetchRequestDataInner.md @@ -0,0 +1,10 @@ +# # DocumentFetchRequestDataInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**key** | **string** | Descriptor of the identifier | +**value** | **string** | Value of the identifier | + +[[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/DocumentFetchRequestMetadata.md b/docs/EInvoicing/DocumentFetchRequestMetadata.md new file mode 100644 index 0000000..f9977e8 --- /dev/null +++ b/docs/EInvoicing/DocumentFetchRequestMetadata.md @@ -0,0 +1,13 @@ +# # DocumentFetchRequestMetadata + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**workflow_id** | **string** | Specifies a unique ID for this workflow. | +**data_format** | **string** | Specifies the data format for this workflow | +**data_format_version** | **float** | Specifies the data format version number | +**country_code** | **string** | The two-letter ISO-3166 country code for the country for which document is being retrieved | +**country_mandate** | **string** | The e-invoicing mandate for the specified country | + +[[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/DocumentListResponse.md b/docs/EInvoicing/DocumentListResponse.md index faf551f..30b6c9f 100644 --- a/docs/EInvoicing/DocumentListResponse.md +++ b/docs/EInvoicing/DocumentListResponse.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**at_record_set_count** | **string** | Count of collections for the given date range | [optional] +**at_recordset_count** | **string** | Count of collections for the given date range | [optional] **at_next_link** | **string** | | [optional] -**value** | [**\Avalara\SDK\Model\EInvoicing\V1\DocumentSummary[]**](DocumentSummary.md) | Array of invoices matching query parameters | +**value** | [**\Avalara\SDK\Model\EInvoicing\V1\DocumentSummary[]**](DocumentSummary.md) | Array of documents matching query parameters | [[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/DocumentStatusResponse.md b/docs/EInvoicing/DocumentStatusResponse.md index 0972000..5925b83 100644 --- a/docs/EInvoicing/DocumentStatusResponse.md +++ b/docs/EInvoicing/DocumentStatusResponse.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **string** | The unique ID for this document | [optional] -**status** | **string** | Status of the transaction: <br> 'Pending' <br> 'Failed' <br> 'Complete' | [optional] +**status** | **string** | Status of the document | [optional] **events** | [**\Avalara\SDK\Model\EInvoicing\V1\StatusEvent[]**](StatusEvent.md) | | [optional] [[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/DocumentSummary.md b/docs/EInvoicing/DocumentSummary.md index 3fe9dd2..a64013f 100644 --- a/docs/EInvoicing/DocumentSummary.md +++ b/docs/EInvoicing/DocumentSummary.md @@ -6,15 +6,17 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **string** | The unique ID for this document | [optional] **process_date_time** | **string** | The date and time when the document was processed, displayed in the format YYYY-MM-DDThh:mm:ss | [optional] -**status** | **string** | The transaction status: <br> 'Pending' <br> 'Failed' <br> 'Complete' | [optional] +**status** | **string** | The Document status | [optional] **supplier_name** | **string** | The name of the supplier in the transaction | [optional] **customer_name** | **string** | The name of the customer in the transaction | [optional] -**document_number** | **string** | The invoice document number | [optional] -**document_date** | **string** | The invoice issue date | [optional] -**flow** | **string** | The invoice direction, where issued = `out` and received = `in` | [optional] -**country_code** | **string** | The two-letter ISO-3166 country code for the country where the e-invoice is being submitted | [optional] +**document_type** | **string** | The document type | [optional] +**document_version** | **string** | The document version | [optional] +**document_number** | **string** | The document number | [optional] +**document_date** | **string** | The document issue date | [optional] +**flow** | **string** | The document direction, where issued = `out` and received = `in` | [optional] +**country_code** | **string** | The two-letter ISO-3166 country code for the country where the document is being submitted | [optional] **country_mandate** | **string** | The e-invoicing mandate for the specified country | [optional] -**interface** | **string** | The interface where the invoice data is sent | [optional] -**receiver** | **string** | The invoice recipient based on the interface | [optional] +**interface** | **string** | The interface where the document is sent | [optional] +**receiver** | **string** | The document recipient based on the interface | [optional] [[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/ErrorResponse.md b/docs/EInvoicing/ErrorResponse.md new file mode 100644 index 0000000..cba8438 --- /dev/null +++ b/docs/EInvoicing/ErrorResponse.md @@ -0,0 +1,12 @@ +# # ErrorResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **string** | | [optional] +**status** | **string** | | [optional] +**detail** | **string** | | [optional] +**instance** | **string** | | [optional] + +[[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/FetchDocumentsRequest.md b/docs/EInvoicing/FetchDocumentsRequest.md new file mode 100644 index 0000000..22c8102 --- /dev/null +++ b/docs/EInvoicing/FetchDocumentsRequest.md @@ -0,0 +1,10 @@ +# # FetchDocumentsRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Avalara\\SDK\Model\\EInvoicing\\V1\FetchDocumentsRequestDataInner[]**](FetchDocumentsRequestDataInner.md) | Array of key-value pairs used to retrieve inbound documents from the Tax Authority | [optional] +**metadata** | [**\Avalara\\SDK\Model\\EInvoicing\\V1\FetchDocumentsRequestMetadata**](FetchDocumentsRequestMetadata.md) | | [optional] + +[[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/FetchDocumentsRequestDataInner.md b/docs/EInvoicing/FetchDocumentsRequestDataInner.md new file mode 100644 index 0000000..094b42c --- /dev/null +++ b/docs/EInvoicing/FetchDocumentsRequestDataInner.md @@ -0,0 +1,10 @@ +# # FetchDocumentsRequestDataInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**key** | **string** | Descriptor of the identifier | +**value** | **string** | Value of the identifier | + +[[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/FetchDocumentsRequestMetadata.md b/docs/EInvoicing/FetchDocumentsRequestMetadata.md new file mode 100644 index 0000000..c3dea8f --- /dev/null +++ b/docs/EInvoicing/FetchDocumentsRequestMetadata.md @@ -0,0 +1,13 @@ +# # FetchDocumentsRequestMetadata + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**workflow_id** | **string** | Specifies a unique ID for this workflow. | +**data_format** | **string** | Specifies the data format for this workflow | +**data_format_version** | **float** | Specifies the data format version number | +**country_code** | **string** | The two-letter ISO-3166 country code for the country for which document is being retrieved | +**country_mandate** | **string** | The e-invoicing mandate for the specified country | + +[[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/InputDataFormats.md b/docs/EInvoicing/InputDataFormats.md index 7875618..2375c8d 100644 --- a/docs/EInvoicing/InputDataFormats.md +++ b/docs/EInvoicing/InputDataFormats.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**format** | **string** | Invoice format | [optional] +**format** | **string** | Document format | [optional] **versions** | **string[]** | | [optional] [[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/Mandate.md b/docs/EInvoicing/Mandate.md index 81a3e75..5e91bf0 100644 --- a/docs/EInvoicing/Mandate.md +++ b/docs/EInvoicing/Mandate.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**mandate_id** | **string** | Mandate UUID | [optional] -**country_mandate** | **string** | Country mandate name | [optional] +**mandate_id** | **string** | The `mandateId` is comprised of the country code, mandate type, and the network or regulation type (for example, AU-B2G-PEPPOL). Keep in mind the following when specifying a `mandateId`. - A country can have multiple mandate types (B2C, B2B, B2G). - A entity/company can opt in for multiple mandates. - A `mandateId` is the combination of country + mandate type + network/regulation. | [optional] +**country_mandate** | **string** | **[LEGACY]** This field is retained for backward compatibility. It is recommended to use `mandateId` instead. The `countryMandate` similar to the `mandateId` is comprised of the country code, mandate type, and the network or regulation type (for example, AU-B2G-PEPPOL). | [optional] **country_code** | **string** | Country code | [optional] **description** | **string** | Mandate description | [optional] **supported_by_partner_api** | **bool** | Indicates whether this mandate supported by the partner API | [optional] diff --git a/docs/EInvoicing/MandateDataInputField.md b/docs/EInvoicing/MandateDataInputField.md new file mode 100644 index 0000000..46303b7 --- /dev/null +++ b/docs/EInvoicing/MandateDataInputField.md @@ -0,0 +1,22 @@ +# # MandateDataInputField + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**field_id** | **string** | Field ID | [optional] +**document_type** | **string** | The document type | [optional] +**document_version** | **string** | The document version | [optional] +**path** | **string** | Path to this field | [optional] +**path_type** | **string** | The type of path | [optional] +**field_name** | **string** | Field name | [optional] +**namespace** | [**\Avalara\SDK\Model\EInvoicing\V1\MandateDataInputFieldNamespace**](MandateDataInputFieldNamespace.md) | | [optional] +**example_or_fixed_value** | **string** | An example of the content for this field | [optional] +**accepted_values** | **string[]** | An Array representing the acceptable values for this field | [optional] +**documentation_link** | **string** | An example of the content for this field | [optional] +**data_type** | **string** | The data type of this field. | [optional] +**description** | **string** | A description of this field | [optional] +**optionality** | **string** | Determines if the field if Required/Conditional/Optional or not required. | [optional] +**cardinality** | **string** | Represents the number of times an element can appear within the document | [optional] + +[[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/MandateDataInputFieldNamespace.md b/docs/EInvoicing/MandateDataInputFieldNamespace.md new file mode 100644 index 0000000..89a2ea9 --- /dev/null +++ b/docs/EInvoicing/MandateDataInputFieldNamespace.md @@ -0,0 +1,10 @@ +# # MandateDataInputFieldNamespace + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**prefix** | **string** | The namespace prefix for the UBL Element | [optional] +**value** | **string** | | [optional] + +[[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/MandatesResponse.md b/docs/EInvoicing/MandatesResponse.md index 456a79f..ee3efa6 100644 --- a/docs/EInvoicing/MandatesResponse.md +++ b/docs/EInvoicing/MandatesResponse.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**at_record_set_count** | **float** | Total count of results | [optional] +**at_recordset_count** | **float** | Total count of results | [optional] **at_next_link** | **string** | | [optional] **value** | [**\Avalara\SDK\Model\EInvoicing\V1\Mandate[]**](Mandate.md) | Mandates schema | [optional] diff --git a/docs/EInvoicing/StatusEvent.md b/docs/EInvoicing/StatusEvent.md index 98e6364..5dbd110 100644 --- a/docs/EInvoicing/StatusEvent.md +++ b/docs/EInvoicing/StatusEvent.md @@ -6,5 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **event_date_time** | **string** | The date and time when the status event occured, displayed in the format YYYY-MM-DDThh:mm:ss | [optional] **message** | **string** | A message describing the status event | [optional] +**response_key** | **string** | The type of number or acknowledgement returned by the tax authority (if applicable). For example, it could be an identification key, acknowledgement code, or any other relevant identifier. | [optional] +**response_value** | **string** | The corresponding value associated with the response key. This value is provided by the tax authority in response to the event. | [optional] [[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/SubmitDocumentMetadata.md b/docs/EInvoicing/SubmitDocumentMetadata.md index c1273d0..2193ba5 100644 --- a/docs/EInvoicing/SubmitDocumentMetadata.md +++ b/docs/EInvoicing/SubmitDocumentMetadata.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **workflow_id** | **string** | Specifies a unique ID for this workflow. | **data_format** | **string** | Specifies the data format for this workflow. | **data_format_version** | **string** | Specifies the data format version number. | -**country_code** | **string** | The two-letter ISO-3166 country code for the country where the e-invoice is being submitted | +**country_code** | **string** | The two-letter ISO-3166 country code for the country where the document is being submitted | **country_mandate** | **string** | The e-invoicing mandate for the specified country. | [[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/SubmitInteropDocument202Response.md b/docs/EInvoicing/SubmitInteropDocument202Response.md new file mode 100644 index 0000000..347d372 --- /dev/null +++ b/docs/EInvoicing/SubmitInteropDocument202Response.md @@ -0,0 +1,10 @@ +# # SubmitInteropDocument202Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interchange_id** | **string** | The unique interchange ID for this submission. | [optional] +**message** | **string** | A message indicating that the document has been accepted. | [optional] + +[[Back to Model list]](../../../README.md#models) [[Back to API list]](../../../README.md#endpoints) [[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/V1/DataInputFieldsApi.md b/docs/EInvoicing/V1/DataInputFieldsApi.md index ba3bf88..7df87d4 100644 --- a/docs/EInvoicing/V1/DataInputFieldsApi.md +++ b/docs/EInvoicing/V1/DataInputFieldsApi.md @@ -4,7 +4,7 @@ All URIs are relative to https://api.sbx.avalara.com/einvoicing. Method | HTTP request | Description ------------- | ------------- | ------------- -[**getDataInputFields()**](DataInputFieldsApi.md#getDataInputFields) | **GET** /data-input-fields | Returns the mandatory and conditional invoice or creditnote input fields for different country mandates +[**getDataInputFields()**](DataInputFieldsApi.md#getDataInputFields) | **GET** /data-input-fields | Returns the optionality of document fields for different country mandates ## `getDataInputFields()` @@ -13,7 +13,7 @@ Method | HTTP request | Description getDataInputFields($avalara_version, $x_avalara_client, $filter, $top, $skip, $count, $count_only): \Avalara\SDK\Model\EInvoicing\V1\DataInputFieldsResponse ``` -Returns the mandatory and conditional invoice or creditnote input fields for different country mandates +Returns the optionality of document fields for different country mandates This endpoint provides a list of required, conditional, and optional fields for each country mandate. You can use the mandates endpoint to retrieve all available country mandates. You can use the $filter query parameter to retrieve fields for a particular mandate @@ -35,8 +35,8 @@ $client = new \Avalara\SDK\ApiClient($config); $apiInstance = new Avalara\SDK\Api\DataInputFieldsApi($client); -$avalara_version = 1.0; // string | The HTTP Header meant to specify the version of the API intended to be used -$x_avalara_client = John's E-Invoicing-API Client; // string | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" +$avalara_version = 1.2; // string | The HTTP Header meant to specify the version of the API intended to be used +$x_avalara_client = John's E-Invoicing-API Client; // string | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. $filter = requiredFor/countryMandate eq AU-B2G-PEPPOL; // string | Filter by field name and value. This filter only supports eq and contains. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. $top = 10; // float | If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. $skip = 10; // float | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. @@ -56,7 +56,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **avalara_version** | **string**| The HTTP Header meant to specify the version of the API intended to be used | - **x_avalara_client** | **string**| You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" | [optional] + **x_avalara_client** | **string**| You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. | [optional] **filter** | **string**| Filter by field name and value. This filter only supports <code>eq</code> and <code>contains</code>. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. | [optional] **top** | **float**| If nonzero, return no more than this number of results. Used with <code>$skip</code> to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. | [optional] **skip** | **float**| If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. | [optional] diff --git a/docs/EInvoicing/V1/DocumentsApi.md b/docs/EInvoicing/V1/DocumentsApi.md index 16ada8e..15f4bb3 100644 --- a/docs/EInvoicing/V1/DocumentsApi.md +++ b/docs/EInvoicing/V1/DocumentsApi.md @@ -5,8 +5,9 @@ All URIs are relative to https://api.sbx.avalara.com/einvoicing. Method | HTTP request | Description ------------- | ------------- | ------------- [**downloadDocument()**](DocumentsApi.md#downloadDocument) | **GET** /documents/{documentId}/$download | Returns a copy of the document +[**fetchDocuments()**](DocumentsApi.md#fetchDocuments) | **POST** /documents/$fetch | Fetch the inbound document from a tax authority [**getDocumentList()**](DocumentsApi.md#getDocumentList) | **GET** /documents | Returns a summary of documents for a date range -[**getDocumentStatus()**](DocumentsApi.md#getDocumentStatus) | **GET** /document/{documentId}/status | Checks the status of a document +[**getDocumentStatus()**](DocumentsApi.md#getDocumentStatus) | **GET** /documents/{documentId}/status | Checks the status of a document [**submitDocument()**](DocumentsApi.md#submitDocument) | **POST** /documents | Submits a document to Avalara E-Invoicing API @@ -18,7 +19,7 @@ downloadDocument($avalara_version, $accept, $document_id, $x_avalara_client): \S Returns a copy of the document -When the document is available, use this endpoint to download it as text, XML, or PDF. The output format needs to be specified in the Accept header and it will vary depending on the mandate. If the file has not yet been created, then status code 404 (not found) is returned. +When the document is available, use this endpoint to download it as text, XML, or PDF. The output format needs to be specified in the Accept header, and it will vary depending on the mandate. If the file has not yet been created, then status code 404 (not found) is returned. ### Example @@ -38,10 +39,10 @@ $client = new \Avalara\SDK\ApiClient($config); $apiInstance = new Avalara\SDK\Api\DocumentsApi($client); -$avalara_version = 1.0; // string | The HTTP Header meant to specify the version of the API intended to be used +$avalara_version = 1.2; // string | The HTTP Header meant to specify the version of the API intended to be used $accept = application/pdf; // string | This header indicates the MIME type of the document $document_id = 'document_id_example'; // string | The unique ID for this document that was returned in the POST /einvoicing/document response body -$x_avalara_client = John's E-Invoicing-API Client; // string | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" +$x_avalara_client = John's E-Invoicing-API Client; // string | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. try { $result = $apiInstance->downloadDocument($avalara_version, $accept, $document_id, $x_avalara_client); @@ -58,7 +59,7 @@ Name | Type | Description | Notes **avalara_version** | **string**| The HTTP Header meant to specify the version of the API intended to be used | **accept** | **string**| This header indicates the MIME type of the document | **document_id** | **string**| The unique ID for this document that was returned in the POST /einvoicing/document response body | - **x_avalara_client** | **string**| You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" | [optional] + **x_avalara_client** | **string**| You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. | [optional] ### Return type @@ -77,6 +78,71 @@ Name | Type | Description | Notes [[Back to Model list]](../../../README.md#models) [[Back to README]](../../../README.md) +## `fetchDocuments()` + +```php +fetchDocuments($avalara_version, $document_fetch_request, $x_avalara_client): \Avalara\SDK\Model\EInvoicing\V1\DocumentFetch +``` + +Fetch the inbound document from a tax authority + +This API allows you to retrieve an inbound document. Pass key-value pairs as parameters in the request, such as the confirmation number, supplier number, and buyer VAT number. + +### Example + +```php +setBearerToken('YOUR_JWT_ACCESS_TOKEN') + ->setAppName('YOUR_APP_NAME') + ->setEnvironment('sandbox') + ->setMachineName('YOUR_MACHINE_NAME') + ->setAppVersion('YOUR_APP_VERSION'); + +$client = new \Avalara\SDK\ApiClient($config); + +$apiInstance = new Avalara\SDK\Api\DocumentsApi($client); + +$avalara_version = 1.2; // string | The HTTP Header meant to specify the version of the API intended to be used +$document_fetch_request = new \Avalara\SDK\Model\EInvoicing\V1\DocumentFetchRequest(); // \Avalara\SDK\Model\EInvoicing\V1\DocumentFetchRequest +$x_avalara_client = John's E-Invoicing-API Client; // string | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. + +try { + $result = $apiInstance->fetchDocuments($avalara_version, $document_fetch_request, $x_avalara_client); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DocumentsApi->fetchDocuments: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **avalara_version** | **string**| The HTTP Header meant to specify the version of the API intended to be used | + **document_fetch_request** | [**\Avalara\SDK\Model\EInvoicing\V1\DocumentFetchRequest**](../Model/DocumentFetchRequest.md)| | + **x_avalara_client** | **string**| You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. | [optional] + +### Return type + +[**\Avalara\SDK\Model\EInvoicing\V1\DocumentFetch**](../Model/DocumentFetch.md) + +### Authorization + +[Bearer](../../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../../README.md#endpoints) +[[Back to Model list]](../../../README.md#models) +[[Back to README]](../../../README.md) + ## `getDocumentList()` ```php @@ -105,14 +171,14 @@ $client = new \Avalara\SDK\ApiClient($config); $apiInstance = new Avalara\SDK\Api\DocumentsApi($client); -$avalara_version = 1.0; // string | The HTTP Header meant to specify the version of the API intended to be used -$x_avalara_client = John's E-Invoicing-API Client; // string | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" +$avalara_version = 1.2; // string | The HTTP Header meant to specify the version of the API intended to be used +$x_avalara_client = John's E-Invoicing-API Client; // string | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. $start_date = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Start date of documents to return. This defaults to the previous month. $end_date = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | End date of documents to return. This defaults to the current date. $flow = out; // string | Optionally filter by document direction, where issued = `out` and received = `in` $count = true; // string | When set to true, the count of the collection is also returned in the response body $count_only = false; // string | When set to true, only the count of the collection is returned -$filter = id eq 2023-02-000016; // string | Filter by field name and value. This filter only supports eq . Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. Filtering will be done over the provided startDate and endDate. If no startDate or endDate is provided, defaults will be assumed. +$filter = id eq 52f60401-44d0-4667-ad47-4afe519abb53; // string | Filter by field name and value. This filter only supports eq . Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. Filtering will be done over the provided startDate and endDate. If no startDate or endDate is provided, defaults will be assumed. $top = 10; // float | If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 200 records. $skip = 10; // string | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. @@ -129,7 +195,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **avalara_version** | **string**| The HTTP Header meant to specify the version of the API intended to be used | - **x_avalara_client** | **string**| You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" | [optional] + **x_avalara_client** | **string**| You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. | [optional] **start_date** | **\DateTime**| Start date of documents to return. This defaults to the previous month. | [optional] **end_date** | **\DateTime**| End date of documents to return. This defaults to the current date. | [optional] **flow** | **string**| Optionally filter by document direction, where issued = `out` and received = `in` | [optional] @@ -184,9 +250,9 @@ $client = new \Avalara\SDK\ApiClient($config); $apiInstance = new Avalara\SDK\Api\DocumentsApi($client); -$avalara_version = 1.0; // string | The HTTP Header meant to specify the version of the API intended to be used +$avalara_version = 1.2; // string | The HTTP Header meant to specify the version of the API intended to be used $document_id = 'document_id_example'; // string | The unique ID for this document that was returned in the POST /einvoicing/documents response body -$x_avalara_client = John's E-Invoicing-API Client; // string | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" +$x_avalara_client = John's E-Invoicing-API Client; // string | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. try { $result = $apiInstance->getDocumentStatus($avalara_version, $document_id, $x_avalara_client); @@ -202,7 +268,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **avalara_version** | **string**| The HTTP Header meant to specify the version of the API intended to be used | **document_id** | **string**| The unique ID for this document that was returned in the POST /einvoicing/documents response body | - **x_avalara_client** | **string**| You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" | [optional] + **x_avalara_client** | **string**| You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. | [optional] ### Return type @@ -229,7 +295,7 @@ submitDocument($avalara_version, $metadata, $data, $x_avalara_client): \Avalara\ Submits a document to Avalara E-Invoicing API -For both e-invoices and credit notes, when a document is sent to this endpoint, it generates an invoice or credit note in the required format as mandated by the specified country. Additionally, it initiates the workflow to transmit the generated document to the relevant tax authority, if necessary.

The response from the endpoint contains a unique document ID, which can be used to request the status of the document and verify if it was successfully accepted at the destination.

Furthermore, the unique ID enables the download of a copy of the e-invoice or credit note for reference purposes. +When a UBL document is sent to this endpoint, it generates a document in the required format as mandated by the specified country. Additionally, it initiates the workflow to transmit the generated document to the relevant tax authority, if necessary.

The response from the endpoint contains a unique document ID, which can be used to request the status of the document and verify if it was successfully accepted at the destination.

Furthermore, the unique ID enables the download of a copy of the generated document for reference purposes. ### Example @@ -249,10 +315,10 @@ $client = new \Avalara\SDK\ApiClient($config); $apiInstance = new Avalara\SDK\Api\DocumentsApi($client); -$avalara_version = 1.0; // string | The HTTP Header meant to specify the version of the API intended to be used +$avalara_version = 1.2; // string | The HTTP Header meant to specify the version of the API intended to be used $metadata = new \Avalara\SDK\Model\EInvoicing\V1\SubmitDocumentMetadata(); // \Avalara\SDK\Model\EInvoicing\V1\SubmitDocumentMetadata -$data = new \Avalara\SDK\Model\EInvoicing\V1\SubmitDocumentData(); // \Avalara\SDK\Model\EInvoicing\V1\SubmitDocumentData -$x_avalara_client = John's E-Invoicing-API Client; // string | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" +$data = 'data_example'; // string | The document to be submitted, as indicated by the metadata fields 'dataFormat' and 'dataFormatVersion' +$x_avalara_client = John's E-Invoicing-API Client; // string | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. try { $result = $apiInstance->submitDocument($avalara_version, $metadata, $data, $x_avalara_client); @@ -268,8 +334,8 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **avalara_version** | **string**| The HTTP Header meant to specify the version of the API intended to be used | **metadata** | [**\Avalara\SDK\Model\EInvoicing\V1\SubmitDocumentMetadata**](../Model/SubmitDocumentMetadata.md)| | - **data** | [**\Avalara\SDK\Model\EInvoicing\V1\SubmitDocumentData**](../Model/SubmitDocumentData.md)| | - **x_avalara_client** | **string**| You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" | [optional] + **data** | **string**| The document to be submitted, as indicated by the metadata fields 'dataFormat' and 'dataFormatVersion' | + **x_avalara_client** | **string**| You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. | [optional] ### Return type diff --git a/docs/EInvoicing/V1/InteropApi.md b/docs/EInvoicing/V1/InteropApi.md new file mode 100644 index 0000000..3fb8ee2 --- /dev/null +++ b/docs/EInvoicing/V1/InteropApi.md @@ -0,0 +1,79 @@ +# Avalara\SDK\InteropApi + +All URIs are relative to https://api.sbx.avalara.com/einvoicing. + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**submitInteropDocument()**](InteropApi.md#submitInteropDocument) | **POST** /interop/documents | Submit a document + + +## `submitInteropDocument()` + +```php +submitInteropDocument($document_type, $interchange_type, $avalara_version, $x_avalara_client, $x_correlation_id, $file_name): \Avalara\SDK\Model\EInvoicing\V1\SubmitInteropDocument202Response +``` + +Submit a document + +This API used by the interoperability partners to submit a document to their trading partners in Avalara on behalf of their customers. + +### Example + +```php +setBearerToken('YOUR_JWT_ACCESS_TOKEN') + ->setAppName('YOUR_APP_NAME') + ->setEnvironment('sandbox') + ->setMachineName('YOUR_MACHINE_NAME') + ->setAppVersion('YOUR_APP_VERSION'); + +$client = new \Avalara\SDK\ApiClient($config); + +$apiInstance = new Avalara\SDK\Api\InteropApi($client); + +$document_type = 'document_type_example'; // string | Type of the document being uploaded. Partners will be configured in Avalara system to send only certain types of documents. +$interchange_type = 'interchange_type_example'; // string | Type of interchange (codes in Avalara system that uniquely identifies a type of interchange). Partners will be configured in Avalara system to send documents belonging to certain types of interchanges. +$avalara_version = 1.2; // string | The HTTP Header meant to specify the version of the API intended to be used +$x_avalara_client = John's E-Invoicing-API Client; // string | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" +$x_correlation_id = f3f0d19a-01a1-4748-8a58-f000d0424f43; // string | The caller can use this as an identifier to use as a correlation id to trace the call. +$file_name = "/path/to/file.txt"; // \SplFileObject | The file to be uploaded (e.g., UBL XML, CII XML). + +try { + $result = $apiInstance->submitInteropDocument($document_type, $interchange_type, $avalara_version, $x_avalara_client, $x_correlation_id, $file_name); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling InteropApi->submitInteropDocument: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **document_type** | **string**| Type of the document being uploaded. Partners will be configured in Avalara system to send only certain types of documents. | + **interchange_type** | **string**| Type of interchange (codes in Avalara system that uniquely identifies a type of interchange). Partners will be configured in Avalara system to send documents belonging to certain types of interchanges. | + **avalara_version** | **string**| The HTTP Header meant to specify the version of the API intended to be used | + **x_avalara_client** | **string**| You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" | [optional] + **x_correlation_id** | **string**| The caller can use this as an identifier to use as a correlation id to trace the call. | [optional] + **file_name** | **\SplFileObject****\SplFileObject**| The file to be uploaded (e.g., UBL XML, CII XML). | [optional] + +### Return type + +[**\Avalara\SDK\Model\EInvoicing\V1\SubmitInteropDocument202Response**](../Model/SubmitInteropDocument202Response.md) + +### Authorization + +[Bearer](../../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: `multipart/form-data` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../../README.md#endpoints) +[[Back to Model list]](../../../README.md#models) +[[Back to README]](../../../README.md) diff --git a/docs/EInvoicing/V1/MandatesApi.md b/docs/EInvoicing/V1/MandatesApi.md index 7c06e73..67f1a35 100644 --- a/docs/EInvoicing/V1/MandatesApi.md +++ b/docs/EInvoicing/V1/MandatesApi.md @@ -4,9 +4,79 @@ All URIs are relative to https://api.sbx.avalara.com/einvoicing. Method | HTTP request | Description ------------- | ------------- | ------------- +[**getMandateDataInputFields()**](MandatesApi.md#getMandateDataInputFields) | **GET** /mandates/{mandateId}/data-input-fields | Returns document field information for a country mandate, a selected document type, and its version [**getMandates()**](MandatesApi.md#getMandates) | **GET** /mandates | List country mandates that are supported by the Avalara E-Invoicing platform +## `getMandateDataInputFields()` + +```php +getMandateDataInputFields($avalara_version, $mandate_id, $document_type, $document_version, $x_avalara_client): \Avalara\SDK\Model\EInvoicing\V1\MandateDataInputField[] +``` + +Returns document field information for a country mandate, a selected document type, and its version + +This endpoint provides document field details and the optionality of fields (required, conditional, optional) of different documents supported by the country mandate. Use the GET /mandates endpoint to retrieve all available country mandates, their supported document types and supported versions. You can use the `documentType` and `documentVersion` query parameters to retrieve the input fields for a particular document type and document version. + +### Example + +```php +setBearerToken('YOUR_JWT_ACCESS_TOKEN') + ->setAppName('YOUR_APP_NAME') + ->setEnvironment('sandbox') + ->setMachineName('YOUR_MACHINE_NAME') + ->setAppVersion('YOUR_APP_VERSION'); + +$client = new \Avalara\SDK\ApiClient($config); + +$apiInstance = new Avalara\SDK\Api\MandatesApi($client); + +$avalara_version = 1.2; // string | The HTTP Header meant to specify the version of the API intended to be used +$mandate_id = AD-B2G-PEPPOL; // string | The unique ID for the mandate that was returned in the GET /einvoicing/mandates response body +$document_type = ubl-invoice; // string | Select the documentType for which you wish to view the data-input-fields (You may obtain the supported documentTypes from the GET /mandates endpoint) +$document_version = 2.1; // string | Select the document version of the documentType (You may obtain the supported documentVersion from the GET /mandates endpoint) +$x_avalara_client = John's E-Invoicing-API Client; // string | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. + +try { + $result = $apiInstance->getMandateDataInputFields($avalara_version, $mandate_id, $document_type, $document_version, $x_avalara_client); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling MandatesApi->getMandateDataInputFields: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **avalara_version** | **string**| The HTTP Header meant to specify the version of the API intended to be used | + **mandate_id** | **string**| The unique ID for the mandate that was returned in the GET /einvoicing/mandates response body | + **document_type** | **string**| Select the documentType for which you wish to view the data-input-fields (You may obtain the supported documentTypes from the GET /mandates endpoint) | + **document_version** | **string**| Select the document version of the documentType (You may obtain the supported documentVersion from the GET /mandates endpoint) | + **x_avalara_client** | **string**| You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. | [optional] + +### Return type + +[**\Avalara\SDK\Model\EInvoicing\V1\MandateDataInputField[]**](../Model/MandateDataInputField.md) + +### Authorization + +[Bearer](../../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../../README.md#endpoints) +[[Back to Model list]](../../../README.md#models) +[[Back to README]](../../../README.md) + ## `getMandates()` ```php @@ -35,8 +105,8 @@ $client = new \Avalara\SDK\ApiClient($config); $apiInstance = new Avalara\SDK\Api\MandatesApi($client); -$avalara_version = 1.0; // string | The HTTP Header meant to specify the version of the API intended to be used -$x_avalara_client = John's E-Invoicing-API Client; // string | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" +$avalara_version = 1.2; // string | The HTTP Header meant to specify the version of the API intended to be used +$x_avalara_client = John's E-Invoicing-API Client; // string | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. $filter = countryMandate eq DE-B2G-PEPPOL; // string | Filter by field name and value. This filter only supports eq and contains. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. $top = 10; // float | If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. $skip = 10; // float | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. @@ -56,7 +126,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **avalara_version** | **string**| The HTTP Header meant to specify the version of the API intended to be used | - **x_avalara_client** | **string**| You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" | [optional] + **x_avalara_client** | **string**| You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. | [optional] **filter** | **string**| Filter by field name and value. This filter only supports <code>eq</code> and <code>contains</code>. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. | [optional] **top** | **float**| If nonzero, return no more than this number of results. Used with <code>$skip</code> to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. | [optional] **skip** | **float**| If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. | [optional] diff --git a/docs/EInvoicing/V1/TradingPartnersApi.md b/docs/EInvoicing/V1/TradingPartnersApi.md new file mode 100644 index 0000000..214a6ff --- /dev/null +++ b/docs/EInvoicing/V1/TradingPartnersApi.md @@ -0,0 +1,368 @@ +# Avalara\SDK\TradingPartnersApi + +All URIs are relative to https://api.sbx.avalara.com/einvoicing. + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**batchSearchParticipants()**](TradingPartnersApi.md#batchSearchParticipants) | **POST** /trading-partners/batch-searches | Creates a batch search and performs a batch search in the directory for participants in the background. +[**downloadBatchSearchReport()**](TradingPartnersApi.md#downloadBatchSearchReport) | **GET** /trading-partners/batch-searches/{id}/$download-results | Download batch search results in a csv file. +[**getBatchSearchDetail()**](TradingPartnersApi.md#getBatchSearchDetail) | **GET** /trading-partners/batch-searches/{id} | Get the batch search details for a given id. +[**listBatchSearches()**](TradingPartnersApi.md#listBatchSearches) | **GET** /trading-partners/batch-searches | List all batch searches that were previously submitted. +[**searchParticipants()**](TradingPartnersApi.md#searchParticipants) | **GET** /trading-partners | Returns a list of participants matching the input query. + + +## `batchSearchParticipants()` + +```php +batchSearchParticipants($avalara_version, $name, $notification_email, $file, $x_avalara_client, $x_correlation_id) +``` + +Creates a batch search and performs a batch search in the directory for participants in the background. + +Handles batch search requests by uploading a file containing search parameters. + +### Example + +```php +setBearerToken('YOUR_JWT_ACCESS_TOKEN') + ->setAppName('YOUR_APP_NAME') + ->setEnvironment('sandbox') + ->setMachineName('YOUR_MACHINE_NAME') + ->setAppVersion('YOUR_APP_VERSION'); + +$client = new \Avalara\SDK\ApiClient($config); + +$apiInstance = new Avalara\SDK\Api\TradingPartnersApi($client); + +$avalara_version = 1.2; // string | The HTTP Header meant to specify the version of the API intended to be used +$name = Automotive Companies in London Search; // string | The human readable name given to this batch search. +$notification_email = user@example.com; // string | The email address of the user to whom the batch search completion notification must go to. +$file = "/path/to/file.txt"; // \SplFileObject | CSV file containing search parameters. +$x_avalara_client = John's E-Invoicing-API Client; // string | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" +$x_correlation_id = f3f0d19a-01a1-4748-8a58-f000d0424f43; // string | The caller can use this as an identifier to use as a correlation id to trace the call. + +try { + $apiInstance->batchSearchParticipants($avalara_version, $name, $notification_email, $file, $x_avalara_client, $x_correlation_id); +} catch (Exception $e) { + echo 'Exception when calling TradingPartnersApi->batchSearchParticipants: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **avalara_version** | **string**| The HTTP Header meant to specify the version of the API intended to be used | + **name** | **string**| The human readable name given to this batch search. | + **notification_email** | **string**| The email address of the user to whom the batch search completion notification must go to. | + **file** | **\SplFileObject****\SplFileObject**| CSV file containing search parameters. | + **x_avalara_client** | **string**| You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" | [optional] + **x_correlation_id** | **string**| The caller can use this as an identifier to use as a correlation id to trace the call. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: `multipart/form-data` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../../README.md#endpoints) +[[Back to Model list]](../../../README.md#models) +[[Back to README]](../../../README.md) + +## `downloadBatchSearchReport()` + +```php +downloadBatchSearchReport($avalara_version, $id, $x_avalara_client, $x_correlation_id): \SplFileObject +``` + +Download batch search results in a csv file. + +Downloads the report for a specific batch search using the batch search ID. + +### Example + +```php +setBearerToken('YOUR_JWT_ACCESS_TOKEN') + ->setAppName('YOUR_APP_NAME') + ->setEnvironment('sandbox') + ->setMachineName('YOUR_MACHINE_NAME') + ->setAppVersion('YOUR_APP_VERSION'); + +$client = new \Avalara\SDK\ApiClient($config); + +$apiInstance = new Avalara\SDK\Api\TradingPartnersApi($client); + +$avalara_version = 1.2; // string | The HTTP Header meant to specify the version of the API intended to be used +$id = 2f5ea4b5-4dae-445a-b3e4-9f65a61eaa99; // string | The ID of the batch search whose report is to be downloaded. +$x_avalara_client = John's E-Invoicing-API Client; // string | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" +$x_correlation_id = f3f0d19a-01a1-4748-8a58-f000d0424f43; // string | The caller can use this as an identifier to use as a correlation id to trace the call. + +try { + $result = $apiInstance->downloadBatchSearchReport($avalara_version, $id, $x_avalara_client, $x_correlation_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TradingPartnersApi->downloadBatchSearchReport: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **avalara_version** | **string**| The HTTP Header meant to specify the version of the API intended to be used | + **id** | **string**| The ID of the batch search whose report is to be downloaded. | + **x_avalara_client** | **string**| You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" | [optional] + **x_correlation_id** | **string**| The caller can use this as an identifier to use as a correlation id to trace the call. | [optional] + +### Return type + +**\SplFileObject** + +### Authorization + +[Bearer](../../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/csv`, `application/json` + +[[Back to top]](#) [[Back to API list]](../../../README.md#endpoints) +[[Back to Model list]](../../../README.md#models) +[[Back to README]](../../../README.md) + +## `getBatchSearchDetail()` + +```php +getBatchSearchDetail($avalara_version, $id, $x_avalara_client, $x_correlation_id): \Avalara\SDK\Model\EInvoicing\V1\BatchSearch +``` + +Get the batch search details for a given id. + +Get the batch search details for a given id. + +### Example + +```php +setBearerToken('YOUR_JWT_ACCESS_TOKEN') + ->setAppName('YOUR_APP_NAME') + ->setEnvironment('sandbox') + ->setMachineName('YOUR_MACHINE_NAME') + ->setAppVersion('YOUR_APP_VERSION'); + +$client = new \Avalara\SDK\ApiClient($config); + +$apiInstance = new Avalara\SDK\Api\TradingPartnersApi($client); + +$avalara_version = 1.2; // string | The HTTP Header meant to specify the version of the API intended to be used +$id = 2f5ea4b5-4dae-445a-b3e4-9f65a61eaa99; // string | The ID of the batch search that was submitted earlier. +$x_avalara_client = John's E-Invoicing-API Client; // string | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" +$x_correlation_id = f3f0d19a-01a1-4748-8a58-f000d0424f43; // string | The caller can use this as an identifier to use as a correlation id to trace the call. + +try { + $result = $apiInstance->getBatchSearchDetail($avalara_version, $id, $x_avalara_client, $x_correlation_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TradingPartnersApi->getBatchSearchDetail: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **avalara_version** | **string**| The HTTP Header meant to specify the version of the API intended to be used | + **id** | **string**| The ID of the batch search that was submitted earlier. | + **x_avalara_client** | **string**| You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" | [optional] + **x_correlation_id** | **string**| The caller can use this as an identifier to use as a correlation id to trace the call. | [optional] + +### Return type + +[**\Avalara\SDK\Model\EInvoicing\V1\BatchSearch**](../Model/BatchSearch.md) + +### Authorization + +[Bearer](../../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../../README.md#endpoints) +[[Back to Model list]](../../../README.md#models) +[[Back to README]](../../../README.md) + +## `listBatchSearches()` + +```php +listBatchSearches($avalara_version, $x_avalara_client, $filter, $count, $top, $skip, $order_by, $x_correlation_id): \Avalara\SDK\Model\EInvoicing\V1\BatchSearchListResponse +``` + +List all batch searches that were previously submitted. + +Retrieves all batch searches performed by the user. + +### Example + +```php +setBearerToken('YOUR_JWT_ACCESS_TOKEN') + ->setAppName('YOUR_APP_NAME') + ->setEnvironment('sandbox') + ->setMachineName('YOUR_MACHINE_NAME') + ->setAppVersion('YOUR_APP_VERSION'); + +$client = new \Avalara\SDK\ApiClient($config); + +$apiInstance = new Avalara\SDK\Api\TradingPartnersApi($client); + +$avalara_version = 1.2; // string | The HTTP Header meant to specify the version of the API intended to be used +$x_avalara_client = John's E-Invoicing-API Client; // string | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" +$filter = name eq 'Batch_Search_Import_V4'; // string | Filter by field name and value. This filter only supports eq .The parameters supported is name. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. Filtering will be done over the provided parameters. +$count = true; // bool | When set to true, the count of the collection is included as @recordSetCount in the response body. +$top = 10; // string | If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 200 records. +$skip = 10; // string | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. +$order_by = name desc; // string | The $orderBy query parameter specifies the field and sorting direction for ordering the result set. The value is a string that combines a field name and a sorting direction (asc for ascending or desc for descending), separated by a space. +$x_correlation_id = f3f0d19a-01a1-4748-8a58-f000d0424f43; // string | The caller can use this as an identifier to use as a correlation id to trace the call. + +try { + $result = $apiInstance->listBatchSearches($avalara_version, $x_avalara_client, $filter, $count, $top, $skip, $order_by, $x_correlation_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TradingPartnersApi->listBatchSearches: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **avalara_version** | **string**| The HTTP Header meant to specify the version of the API intended to be used | + **x_avalara_client** | **string**| You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" | [optional] + **filter** | **string**| Filter by field name and value. This filter only supports <code>eq</code> .The parameters supported is <code>name</code>. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. Filtering will be done over the provided parameters. | [optional] + **count** | **bool**| When set to true, the count of the collection is included as @recordSetCount in the response body. | [optional] + **top** | **string**| If nonzero, return no more than this number of results. Used with <code>$skip</code> to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 200 records. | [optional] + **skip** | **string**| If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. | [optional] + **order_by** | **string**| The $orderBy query parameter specifies the field and sorting direction for ordering the result set. The value is a string that combines a field name and a sorting direction (asc for ascending or desc for descending), separated by a space. | [optional] + **x_correlation_id** | **string**| The caller can use this as an identifier to use as a correlation id to trace the call. | [optional] + +### Return type + +[**\Avalara\SDK\Model\EInvoicing\V1\BatchSearchListResponse**](../Model/BatchSearchListResponse.md) + +### Authorization + +[Bearer](../../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../../README.md#endpoints) +[[Back to Model list]](../../../README.md#models) +[[Back to README]](../../../README.md) + +## `searchParticipants()` + +```php +searchParticipants($avalara_version, $search, $x_avalara_client, $count, $filter, $top, $skip, $order_by, $x_correlation_id): \Avalara\SDK\Model\EInvoicing\V1\DirectorySearchResponse +``` + +Returns a list of participants matching the input query. + +Returns a list of participants matching the input query. + +### Example + +```php +setBearerToken('YOUR_JWT_ACCESS_TOKEN') + ->setAppName('YOUR_APP_NAME') + ->setEnvironment('sandbox') + ->setMachineName('YOUR_MACHINE_NAME') + ->setAppVersion('YOUR_APP_VERSION'); + +$client = new \Avalara\SDK\ApiClient($config); + +$apiInstance = new Avalara\SDK\Api\TradingPartnersApi($client); + +$avalara_version = 1.2; // string | The HTTP Header meant to specify the version of the API intended to be used +$search = Acme and 7726627177 or BMW; // string | Search by value supports logical AND and OR. Refer to [https://learn.microsoft.com/en-us/odata/concepts/queryoptions-overview#search](https://learn.microsoft.com/en-us/odata/concepts/queryoptions-overview#search) for more information on search. Search will be done over name and identifier parameters only. +$x_avalara_client = John's E-Invoicing-API Client; // string | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" +$count = true; // bool | When set to true, the count of the collection is included as @recordSetCount in the response body. +$filter = network eq 'Peppol' and country eq 'Australia'; // string | Filter by field name and value. This filter only supports eq .The parameters supported are network, country, documentType, idType. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. Filtering will be done over the provided parameters. +$top = 10; // string | If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 200 records. +$skip = 10; // string | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. +$order_by = name desc; // string | The $orderBy query parameter specifies the field and sorting direction for ordering the result set. The value is a string that combines a field name and a sorting direction (asc for ascending or desc for descending), separated by a space. +$x_correlation_id = f3f0d19a-01a1-4748-8a58-f000d0424f43; // string | The caller can use this as an identifier to use as a correlation id to trace the call. + +try { + $result = $apiInstance->searchParticipants($avalara_version, $search, $x_avalara_client, $count, $filter, $top, $skip, $order_by, $x_correlation_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TradingPartnersApi->searchParticipants: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **avalara_version** | **string**| The HTTP Header meant to specify the version of the API intended to be used | + **search** | **string**| Search by value supports logical AND and OR. Refer to [https://learn.microsoft.com/en-us/odata/concepts/queryoptions-overview#search](https://learn.microsoft.com/en-us/odata/concepts/queryoptions-overview#search) for more information on search. Search will be done over <code>name</code> and <code>identifier</code> parameters only. | + **x_avalara_client** | **string**| You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" | [optional] + **count** | **bool**| When set to true, the count of the collection is included as @recordSetCount in the response body. | [optional] + **filter** | **string**| Filter by field name and value. This filter only supports <code>eq</code> .The parameters supported are <code>network</code>, <code>country</code>, <code>documentType</code>, <code>idType</code>. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. Filtering will be done over the provided parameters. | [optional] + **top** | **string**| If nonzero, return no more than this number of results. Used with <code>$skip</code> to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 200 records. | [optional] + **skip** | **string**| If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. | [optional] + **order_by** | **string**| The $orderBy query parameter specifies the field and sorting direction for ordering the result set. The value is a string that combines a field name and a sorting direction (asc for ascending or desc for descending), separated by a space. | [optional] + **x_correlation_id** | **string**| The caller can use this as an identifier to use as a correlation id to trace the call. | [optional] + +### Return type + +[**\Avalara\SDK\Model\EInvoicing\V1\DirectorySearchResponse**](../Model/DirectorySearchResponse.md) + +### Authorization + +[Bearer](../../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../../README.md#endpoints) +[[Back to Model list]](../../../README.md#models) +[[Back to README]](../../../README.md) diff --git a/lib/API/EInvoicing/V1/DataInputFieldsApi.php b/lib/API/EInvoicing/V1/DataInputFieldsApi.php index da2e654..e070b69 100644 --- a/lib/API/EInvoicing/V1/DataInputFieldsApi.php +++ b/lib/API/EInvoicing/V1/DataInputFieldsApi.php @@ -9,7 +9,7 @@ /* * AvaTax Software Development Kit for PHP * - * (c) 2004-2022 Avalara, Inc. + * (c) 2004-2025 Avalara, Inc. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -22,9 +22,8 @@ * @package Avalara\SDK\API\EInvoicing\V1 * @author Sachin Baijal * @author Jonathan Wenger - * @copyright 2004-2022 Avalara, Inc. + * @copyright 2004-2025 Avalara, Inc. * @license https://www.apache.org/licenses/LICENSE-2.0 - * @version * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK */ @@ -80,7 +79,7 @@ public function __construct(ApiClient $client ) private function setConfiguration($client): void { $this->verifyAPIClient($client); - $client->setSdkVersion(""); + $client->setSdkVersion("24.12.0"); $this->headerSelector = new HeaderSelector(); $this->client = $client; } @@ -119,7 +118,7 @@ public function getConfig() /** * Operation getDataInputFields * - * Returns the mandatory and conditional invoice or creditnote input fields for different country mandates + * Returns the optionality of document fields for different country mandates * * @param GetDataInputFieldsRequest The request parameters for the API call. * @@ -136,7 +135,7 @@ public function getDataInputFields($request_parameters) /** * Operation getDataInputFieldsWithHttpInfo * - * Returns the mandatory and conditional invoice or creditnote input fields for different country mandates + * Returns the optionality of document fields for different country mandates * * @param GetDataInputFieldsRequest The request parameters for the API call. * @@ -286,7 +285,7 @@ public function getDataInputFieldsWithHttpInfo($request_parameters, $isRetry = f /** * Operation getDataInputFieldsAsync * - * Returns the mandatory and conditional invoice or creditnote input fields for different country mandates + * Returns the optionality of document fields for different country mandates * * @param GetDataInputFieldsRequest The request parameters for the API call. * @@ -306,7 +305,7 @@ function ($response) { /** * Operation getDataInputFieldsAsyncWithHttpInfo * - * Returns the mandatory and conditional invoice or creditnote input fields for different country mandates + * Returns the optionality of document fields for different country mandates * * @param GetDataInputFieldsRequest The request parameters for the API call. * @@ -458,12 +457,12 @@ public function getDataInputFieldsRequest($request_parameters) } // header params - $headerParams['avalara-version'] = '1.0'; + $headerParams['avalara-version'] = '1.2'; if ($avalara_version !== null) { $headerParams['avalara-version'] = ObjectSerializer::toHeaderValue($avalara_version); } // header params - $headerParams['avalara-version'] = '1.0'; + $headerParams['avalara-version'] = '1.2'; if ($x_avalara_client !== null) { $headerParams['X-Avalara-Client'] = ObjectSerializer::toHeaderValue($x_avalara_client); } @@ -480,7 +479,7 @@ public function getDataInputFieldsRequest($request_parameters) [] ); } - $clientId="{$this->client->config->getAppName()}; {$this->client->config->getAppVersion()}; PhpRestClient; ; {$this->client->config->getMachineName()}"; + $clientId="{$this->client->config->getAppName()}; {$this->client->config->getAppVersion()}; PhpRestClient; 24.12.0; {$this->client->config->getMachineName()}"; $headers['X-Avalara-Client']=$clientId; @@ -533,7 +532,7 @@ public function getDataInputFieldsRequest($request_parameters) * Represents the Request object for the GetDataInputFields API * * @param string $avalara_version The HTTP Header meant to specify the version of the API intended to be used (required) - * @param string $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" (optional) + * @param string $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. (optional) * @param string $filter Filter by field name and value. This filter only supports <code>eq</code> and <code>contains</code>. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. (optional) * @param float $top If nonzero, return no more than this number of results. Used with <code>$skip</code> to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. (optional) * @param float $skip If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. (optional) @@ -552,7 +551,7 @@ class GetDataInputFieldsRequest { public function __construct() { } public function getAvalaraVersion() { - return $this->avalara_version; + return $this->avalara_version ?? '1.2'; } public function setAvalaraVersion($avalara_version) { diff --git a/lib/API/EInvoicing/V1/DocumentsApi.php b/lib/API/EInvoicing/V1/DocumentsApi.php index 245478c..427071b 100644 --- a/lib/API/EInvoicing/V1/DocumentsApi.php +++ b/lib/API/EInvoicing/V1/DocumentsApi.php @@ -9,7 +9,7 @@ /* * AvaTax Software Development Kit for PHP * - * (c) 2004-2022 Avalara, Inc. + * (c) 2004-2025 Avalara, Inc. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -22,9 +22,8 @@ * @package Avalara\SDK\API\EInvoicing\V1 * @author Sachin Baijal * @author Jonathan Wenger - * @copyright 2004-2022 Avalara, Inc. + * @copyright 2004-2025 Avalara, Inc. * @license https://www.apache.org/licenses/LICENSE-2.0 - * @version * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK */ @@ -80,7 +79,7 @@ public function __construct(ApiClient $client ) private function setConfiguration($client): void { $this->verifyAPIClient($client); - $client->setSdkVersion(""); + $client->setSdkVersion("24.12.0"); $this->headerSelector = new HeaderSelector(); $this->client = $client; } @@ -433,17 +432,17 @@ public function downloadDocumentRequest($request_parameters) // header params - $headerParams['avalara-version'] = '1.0'; + $headerParams['avalara-version'] = '1.2'; if ($avalara_version !== null) { $headerParams['avalara-version'] = ObjectSerializer::toHeaderValue($avalara_version); } // header params - $headerParams['avalara-version'] = '1.0'; + $headerParams['avalara-version'] = '1.2'; if ($accept !== null) { $headerParams['Accept'] = ObjectSerializer::toHeaderValue($accept); } // header params - $headerParams['avalara-version'] = '1.0'; + $headerParams['avalara-version'] = '1.2'; if ($x_avalara_client !== null) { $headerParams['X-Avalara-Client'] = ObjectSerializer::toHeaderValue($x_avalara_client); } @@ -468,7 +467,7 @@ public function downloadDocumentRequest($request_parameters) [] ); } - $clientId="{$this->client->config->getAppName()}; {$this->client->config->getAppVersion()}; PhpRestClient; ; {$this->client->config->getMachineName()}"; + $clientId="{$this->client->config->getAppName()}; {$this->client->config->getAppVersion()}; PhpRestClient; 24.12.0; {$this->client->config->getMachineName()}"; $headers['X-Avalara-Client']=$clientId; @@ -516,6 +515,371 @@ public function downloadDocumentRequest($request_parameters) ); } + /** + * Operation fetchDocuments + * + * Fetch the inbound document from a tax authority + * + * @param FetchDocumentsRequest The request parameters for the API call. + * + * @throws \Avalara\SDK\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Avalara\SDK\Model\EInvoicing\V1\DocumentFetch|\Avalara\SDK\Model\EInvoicing\V1\ForbiddenError|\Avalara\SDK\Model\EInvoicing\V1\InternalServerError + */ + public function fetchDocuments($request_parameters) + { + list($response) = $this->fetchDocumentsWithHttpInfo($request_parameters); + return $response; + } + + /** + * Operation fetchDocumentsWithHttpInfo + * + * Fetch the inbound document from a tax authority + * + * @param FetchDocumentsRequest The request parameters for the API call. + * + * @throws \Avalara\SDK\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Avalara\SDK\Model\EInvoicing\V1\DocumentFetch|\Avalara\SDK\Model\EInvoicing\V1\ForbiddenError|\Avalara\SDK\Model\EInvoicing\V1\InternalServerError, HTTP status code, HTTP response headers (array of strings) + */ + public function fetchDocumentsWithHttpInfo($request_parameters, $isRetry = false) + { + $logObject = new LogObject($this->client->logRequestAndResponse); + //OAuth2 Scopes + $requiredScopes = ""; + $request = $this->fetchDocumentsRequest($request_parameters); + $logObject->populateRequestInfo($request); + + try { + try { + $response = $this->client->send_sync($request, []); + } catch (RequestException $e) { + $statusCode = $e->getCode(); + if (($statusCode == 401 || $statusCode == 403) && !$isRetry) { + $this->client->refreshAuthToken($e->getRequest() ? $e->getRequest()->getHeaders() : null, $requiredScopes); + list($response) = $this->fetchDocumentsWithHttpInfo($request_parameters, true); + return $response; + } + $logObject->populateErrorInfo($e->getResponse()); + $this->client->logger->error(json_encode($logObject)); + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + $logObject->populateErrorMessage($e->getCode(), $e->getMessage()); + $this->client->logger->error(json_encode($logObject)); + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Avalara\SDK\Model\EInvoicing\V1\DocumentFetch' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\DocumentFetch', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\Avalara\SDK\Model\EInvoicing\V1\ForbiddenError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\ForbiddenError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Avalara\SDK\Model\EInvoicing\V1\InternalServerError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\InternalServerError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Avalara\SDK\Model\EInvoicing\V1\DocumentFetch'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\DocumentFetch', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\ForbiddenError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\InternalServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation fetchDocumentsAsync + * + * Fetch the inbound document from a tax authority + * + * @param FetchDocumentsRequest The request parameters for the API call. + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function fetchDocumentsAsync($request_parameters) + { + return $this->fetchDocumentsAsyncWithHttpInfo($request_parameters) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation fetchDocumentsAsyncWithHttpInfo + * + * Fetch the inbound document from a tax authority + * + * @param FetchDocumentsRequest The request parameters for the API call. + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function fetchDocumentsAsyncWithHttpInfo($request_parameters, $isRetry = false) + { + $logObject = new LogObject($this->client->logRequestAndResponse); + $returnType = '\Avalara\SDK\Model\EInvoicing\V1\DocumentFetch'; + $request = $this->fetchDocumentsRequest($request_parameters); + $logObject->populateRequestInfo($request); + return $this->client + ->send_async($request, []) + ->then( + function ($response) use ($returnType, $logObject) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) use ($request_parameters, $isRetry, $request, $logObject) { + //OAuth2 Scopes + $requiredScopes = ""; + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + if (($statusCode == 401 || $statusCode == 403) && !$isRetry) { + $this->client->refreshAuthToken($request->getHeaders(), $requiredScopes); + return $this->fetchDocumentsAsyncWithHttpInfo($request_parameters, true) + ->then( + function ($response) { + return $response[0]; + } + ); + } + $logObject->populateErrorInfo($response); + $this->client->logger->error(json_encode($logObject)); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'fetchDocuments' + * + * @param FetchDocumentsRequest The request parameters for the API call. + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function fetchDocumentsRequest($request_parameters) + { + //OAuth2 Scopes + $requiredScopes = ""; + + $avalara_version = $request_parameters->getAvalaraVersion(); + $document_fetch_request = $request_parameters->getDocumentFetchRequest(); + $x_avalara_client = $request_parameters->getXAvalaraClient(); + + // verify the required parameter 'avalara_version' is set + if ($avalara_version === null || (is_array($avalara_version) && count($avalara_version) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $avalara_version when calling fetchDocuments' + ); + } + // verify the required parameter 'document_fetch_request' is set + if ($document_fetch_request === null || (is_array($document_fetch_request) && count($document_fetch_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $document_fetch_request when calling fetchDocuments' + ); + } + + $resourcePath = '/einvoicing/documents/$fetch'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // header params + $headerParams['avalara-version'] = '1.2'; + if ($avalara_version !== null) { + $headerParams['avalara-version'] = ObjectSerializer::toHeaderValue($avalara_version); + } + // header params + $headerParams['avalara-version'] = '1.2'; + if ($x_avalara_client !== null) { + $headerParams['X-Avalara-Client'] = ObjectSerializer::toHeaderValue($x_avalara_client); + } + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + $clientId="{$this->client->config->getAppName()}; {$this->client->config->getAppVersion()}; PhpRestClient; 24.12.0; {$this->client->config->getMachineName()}"; + + $headers['X-Avalara-Client']=$clientId; + + // for model (json/xml) + if (isset($document_fetch_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($document_fetch_request)); + } else { + $httpBody = $document_fetch_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + } + } + + $headers = $this->client->applyAuthToRequest($headers, $requiredScopes); + + $defaultHeaders = []; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'POST', + $this->client->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation getDocumentList * @@ -894,12 +1258,12 @@ public function getDocumentListRequest($request_parameters) } // header params - $headerParams['avalara-version'] = '1.0'; + $headerParams['avalara-version'] = '1.2'; if ($avalara_version !== null) { $headerParams['avalara-version'] = ObjectSerializer::toHeaderValue($avalara_version); } // header params - $headerParams['avalara-version'] = '1.0'; + $headerParams['avalara-version'] = '1.2'; if ($x_avalara_client !== null) { $headerParams['X-Avalara-Client'] = ObjectSerializer::toHeaderValue($x_avalara_client); } @@ -916,7 +1280,7 @@ public function getDocumentListRequest($request_parameters) [] ); } - $clientId="{$this->client->config->getAppName()}; {$this->client->config->getAppVersion()}; PhpRestClient; ; {$this->client->config->getMachineName()}"; + $clientId="{$this->client->config->getAppName()}; {$this->client->config->getAppVersion()}; PhpRestClient; 24.12.0; {$this->client->config->getMachineName()}"; $headers['X-Avalara-Client']=$clientId; @@ -1244,7 +1608,7 @@ public function getDocumentStatusRequest($request_parameters) ); } - $resourcePath = '/einvoicing/document/{documentId}/status'; + $resourcePath = '/einvoicing/documents/{documentId}/status'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1253,12 +1617,12 @@ public function getDocumentStatusRequest($request_parameters) // header params - $headerParams['avalara-version'] = '1.0'; + $headerParams['avalara-version'] = '1.2'; if ($avalara_version !== null) { $headerParams['avalara-version'] = ObjectSerializer::toHeaderValue($avalara_version); } // header params - $headerParams['avalara-version'] = '1.0'; + $headerParams['avalara-version'] = '1.2'; if ($x_avalara_client !== null) { $headerParams['X-Avalara-Client'] = ObjectSerializer::toHeaderValue($x_avalara_client); } @@ -1283,7 +1647,7 @@ public function getDocumentStatusRequest($request_parameters) [] ); } - $clientId="{$this->client->config->getAppName()}; {$this->client->config->getAppVersion()}; PhpRestClient; ; {$this->client->config->getMachineName()}"; + $clientId="{$this->client->config->getAppName()}; {$this->client->config->getAppVersion()}; PhpRestClient; 24.12.0; {$this->client->config->getMachineName()}"; $headers['X-Avalara-Client']=$clientId; @@ -1627,12 +1991,12 @@ public function submitDocumentRequest($request_parameters) // header params - $headerParams['avalara-version'] = '1.0'; + $headerParams['avalara-version'] = '1.2'; if ($avalara_version !== null) { $headerParams['avalara-version'] = ObjectSerializer::toHeaderValue($avalara_version); } // header params - $headerParams['avalara-version'] = '1.0'; + $headerParams['avalara-version'] = '1.2'; if ($x_avalara_client !== null) { $headerParams['X-Avalara-Client'] = ObjectSerializer::toHeaderValue($x_avalara_client); } @@ -1657,7 +2021,7 @@ public function submitDocumentRequest($request_parameters) ['multipart/form-data'] ); } - $clientId="{$this->client->config->getAppName()}; {$this->client->config->getAppVersion()}; PhpRestClient; ; {$this->client->config->getMachineName()}"; + $clientId="{$this->client->config->getAppName()}; {$this->client->config->getAppVersion()}; PhpRestClient; 24.12.0; {$this->client->config->getMachineName()}"; $headers['X-Avalara-Client']=$clientId; @@ -1712,7 +2076,7 @@ public function submitDocumentRequest($request_parameters) * @param string $avalara_version The HTTP Header meant to specify the version of the API intended to be used (required) * @param string $accept This header indicates the MIME type of the document (required) * @param string $document_id The unique ID for this document that was returned in the POST /einvoicing/document response body (required) - * @param string $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" (optional) + * @param string $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. (optional) */ class DownloadDocumentRequest { private $avalara_version; @@ -1723,7 +2087,7 @@ class DownloadDocumentRequest { public function __construct() { } public function getAvalaraVersion() { - return $this->avalara_version; + return $this->avalara_version ?? '1.2'; } public function setAvalaraVersion($avalara_version) { @@ -1747,6 +2111,43 @@ public function getXAvalaraClient() { return $this->x_avalara_client; } + public function setXAvalaraClient($x_avalara_client) { + $this->x_avalara_client = $x_avalara_client; + } +} + + /** + * Represents the Request object for the FetchDocuments API + * + * @param string $avalara_version The HTTP Header meant to specify the version of the API intended to be used (required) + * @param \Avalara\SDK\Model\EInvoicing\V1\DocumentFetchRequest $document_fetch_request document_fetch_request (required) + * @param string $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. (optional) + */ +class FetchDocumentsRequest { + private $avalara_version; + private $document_fetch_request; + private $x_avalara_client; + + public function __construct() { + } + public function getAvalaraVersion() { + return $this->avalara_version ?? '1.2'; + } + + public function setAvalaraVersion($avalara_version) { + $this->avalara_version = $avalara_version; + } + public function getDocumentFetchRequest() { + return $this->document_fetch_request; + } + + public function setDocumentFetchRequest($document_fetch_request) { + $this->document_fetch_request = $document_fetch_request; + } + public function getXAvalaraClient() { + return $this->x_avalara_client; + } + public function setXAvalaraClient($x_avalara_client) { $this->x_avalara_client = $x_avalara_client; } @@ -1756,7 +2157,7 @@ public function setXAvalaraClient($x_avalara_client) { * Represents the Request object for the GetDocumentList API * * @param string $avalara_version The HTTP Header meant to specify the version of the API intended to be used (required) - * @param string $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" (optional) + * @param string $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. (optional) * @param \DateTime $start_date Start date of documents to return. This defaults to the previous month. (optional) * @param \DateTime $end_date End date of documents to return. This defaults to the current date. (optional) * @param string $flow Optionally filter by document direction, where issued = `out` and received = `in` (optional) @@ -1781,7 +2182,7 @@ class GetDocumentListRequest { public function __construct() { } public function getAvalaraVersion() { - return $this->avalara_version; + return $this->avalara_version ?? '1.2'; } public function setAvalaraVersion($avalara_version) { @@ -1857,7 +2258,7 @@ public function setSkip($skip) { * * @param string $avalara_version The HTTP Header meant to specify the version of the API intended to be used (required) * @param string $document_id The unique ID for this document that was returned in the POST /einvoicing/documents response body (required) - * @param string $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" (optional) + * @param string $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. (optional) */ class GetDocumentStatusRequest { private $avalara_version; @@ -1867,7 +2268,7 @@ class GetDocumentStatusRequest { public function __construct() { } public function getAvalaraVersion() { - return $this->avalara_version; + return $this->avalara_version ?? '1.2'; } public function setAvalaraVersion($avalara_version) { @@ -1894,8 +2295,8 @@ public function setXAvalaraClient($x_avalara_client) { * * @param string $avalara_version The HTTP Header meant to specify the version of the API intended to be used (required) * @param \Avalara\SDK\Model\EInvoicing\V1\SubmitDocumentMetadata $metadata metadata (required) - * @param \Avalara\SDK\Model\EInvoicing\V1\SubmitDocumentData $data data (required) - * @param string $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" (optional) + * @param string $data The document to be submitted, as indicated by the metadata fields 'dataFormat' and 'dataFormatVersion' (required) + * @param string $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. (optional) */ class SubmitDocumentRequest { private $avalara_version; @@ -1906,7 +2307,7 @@ class SubmitDocumentRequest { public function __construct() { } public function getAvalaraVersion() { - return $this->avalara_version; + return $this->avalara_version ?? '1.2'; } public function setAvalaraVersion($avalara_version) { diff --git a/lib/API/EInvoicing/V1/InteropApi.php b/lib/API/EInvoicing/V1/InteropApi.php new file mode 100644 index 0000000..e172d86 --- /dev/null +++ b/lib/API/EInvoicing/V1/InteropApi.php @@ -0,0 +1,631 @@ + + * @author Jonathan Wenger + * @copyright 2004-2025 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + + + +namespace Avalara\SDK\API\EInvoicing\V1; + +use GuzzleHttp\Client; +use GuzzleHttp\ClientInterface; +use GuzzleHttp\Exception\RequestException; +use GuzzleHttp\Exception\ConnectException; +use GuzzleHttp\Psr7\MultipartStream; +use GuzzleHttp\Psr7\Request; +use GuzzleHttp\RequestOptions; +use Avalara\SDK\ApiClient; +use Avalara\SDK\ApiException; +use Avalara\SDK\Configuration; +use Avalara\SDK\HeaderSelector; +use Avalara\SDK\ObjectSerializer; +use Avalara\SDK\Utils\LogObject; + +class InteropApi +{ + /** + * @var ApiClient + */ + protected $client; + + /** + * @var Configuration + */ + protected $config; + + /** + * @var HeaderSelector + */ + protected $headerSelector; + + /** + * @param ApiClient $client + */ + public function __construct(ApiClient $client ) + { + $this->setConfiguration($client); + } + + /** + * Set APIClient Configuration + * + * @param APIClient $client + */ + private function setConfiguration($client): void + { + $this->verifyAPIClient($client); + $client->setSdkVersion("24.12.0"); + $this->headerSelector = new HeaderSelector(); + $this->client = $client; + } + + /** + * Verify APIClient object + * + * @param int $client + */ + private function verifyAPIClient($client): void + { + if (is_null($client)){ + throw new ApiException("APIClient not defined"); + } + } + + + /** + * Set the HeaderSelector + * + * @param HeaderSelector $selector (required) + */ + public function setHeaderSelector($selector): void + { + $this->headerSelector = $selector ?: new HeaderSelector(); + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->client->config; + } + + /** + * Operation submitInteropDocument + * + * Submit a document + * + * @param SubmitInteropDocumentRequest The request parameters for the API call. + * + * @throws \Avalara\SDK\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Avalara\SDK\Model\EInvoicing\V1\SubmitInteropDocument202Response|\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse|\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse|\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse|\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse + */ + public function submitInteropDocument($request_parameters) + { + list($response) = $this->submitInteropDocumentWithHttpInfo($request_parameters); + return $response; + } + + /** + * Operation submitInteropDocumentWithHttpInfo + * + * Submit a document + * + * @param SubmitInteropDocumentRequest The request parameters for the API call. + * + * @throws \Avalara\SDK\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Avalara\SDK\Model\EInvoicing\V1\SubmitInteropDocument202Response|\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse|\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse|\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse|\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function submitInteropDocumentWithHttpInfo($request_parameters, $isRetry = false) + { + $logObject = new LogObject($this->client->logRequestAndResponse); + //OAuth2 Scopes + $requiredScopes = ""; + $request = $this->submitInteropDocumentRequest($request_parameters); + $logObject->populateRequestInfo($request); + + try { + try { + $response = $this->client->send_sync($request, []); + } catch (RequestException $e) { + $statusCode = $e->getCode(); + if (($statusCode == 401 || $statusCode == 403) && !$isRetry) { + $this->client->refreshAuthToken($e->getRequest() ? $e->getRequest()->getHeaders() : null, $requiredScopes); + list($response) = $this->submitInteropDocumentWithHttpInfo($request_parameters, true); + return $response; + } + $logObject->populateErrorInfo($e->getResponse()); + $this->client->logger->error(json_encode($logObject)); + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + $logObject->populateErrorMessage($e->getCode(), $e->getMessage()); + $this->client->logger->error(json_encode($logObject)); + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 202: + if ('\Avalara\SDK\Model\EInvoicing\V1\SubmitInteropDocument202Response' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\SubmitInteropDocument202Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Avalara\SDK\Model\EInvoicing\V1\SubmitInteropDocument202Response'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 202: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\SubmitInteropDocument202Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation submitInteropDocumentAsync + * + * Submit a document + * + * @param SubmitInteropDocumentRequest The request parameters for the API call. + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function submitInteropDocumentAsync($request_parameters) + { + return $this->submitInteropDocumentAsyncWithHttpInfo($request_parameters) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation submitInteropDocumentAsyncWithHttpInfo + * + * Submit a document + * + * @param SubmitInteropDocumentRequest The request parameters for the API call. + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function submitInteropDocumentAsyncWithHttpInfo($request_parameters, $isRetry = false) + { + $logObject = new LogObject($this->client->logRequestAndResponse); + $returnType = '\Avalara\SDK\Model\EInvoicing\V1\SubmitInteropDocument202Response'; + $request = $this->submitInteropDocumentRequest($request_parameters); + $logObject->populateRequestInfo($request); + return $this->client + ->send_async($request, []) + ->then( + function ($response) use ($returnType, $logObject) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) use ($request_parameters, $isRetry, $request, $logObject) { + //OAuth2 Scopes + $requiredScopes = ""; + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + if (($statusCode == 401 || $statusCode == 403) && !$isRetry) { + $this->client->refreshAuthToken($request->getHeaders(), $requiredScopes); + return $this->submitInteropDocumentAsyncWithHttpInfo($request_parameters, true) + ->then( + function ($response) { + return $response[0]; + } + ); + } + $logObject->populateErrorInfo($response); + $this->client->logger->error(json_encode($logObject)); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'submitInteropDocument' + * + * @param SubmitInteropDocumentRequest The request parameters for the API call. + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function submitInteropDocumentRequest($request_parameters) + { + //OAuth2 Scopes + $requiredScopes = ""; + + $document_type = $request_parameters->getDocumentType(); + $interchange_type = $request_parameters->getInterchangeType(); + $avalara_version = $request_parameters->getAvalaraVersion(); + $x_avalara_client = $request_parameters->getXAvalaraClient(); + $x_correlation_id = $request_parameters->getXCorrelationId(); + $file_name = $request_parameters->getFileName(); + + // verify the required parameter 'document_type' is set + if ($document_type === null || (is_array($document_type) && count($document_type) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $document_type when calling submitInteropDocument' + ); + } + // verify the required parameter 'interchange_type' is set + if ($interchange_type === null || (is_array($interchange_type) && count($interchange_type) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $interchange_type when calling submitInteropDocument' + ); + } + // verify the required parameter 'avalara_version' is set + if ($avalara_version === null || (is_array($avalara_version) && count($avalara_version) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $avalara_version when calling submitInteropDocument' + ); + } + + $resourcePath = '/einvoicing/interop/documents'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($document_type !== null) { + if('form' === 'form' && is_array($document_type)) { + foreach($document_type as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['documentType'] = $document_type; + } + } + // query params + if ($interchange_type !== null) { + if('form' === 'form' && is_array($interchange_type)) { + foreach($interchange_type as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['interchangeType'] = $interchange_type; + } + } + + // header params + $headerParams['avalara-version'] = '1.2'; + if ($avalara_version !== null) { + $headerParams['avalara-version'] = ObjectSerializer::toHeaderValue($avalara_version); + } + // header params + $headerParams['avalara-version'] = '1.2'; + if ($x_avalara_client !== null) { + $headerParams['X-Avalara-Client'] = ObjectSerializer::toHeaderValue($x_avalara_client); + } + // header params + $headerParams['avalara-version'] = '1.2'; + if ($x_correlation_id !== null) { + $headerParams['X-Correlation-ID'] = ObjectSerializer::toHeaderValue($x_correlation_id); + } + + + // form params + if ($file_name !== null) { + $multipart = true; + $formParams['fileName'] = []; + $paramFiles = is_array($file_name) ? $file_name : [$file_name]; + foreach ($paramFiles as $paramFile) { + $formParams['fileName'][] = \GuzzleHttp\Psr7\Utils::tryFopen( + ObjectSerializer::toFormValue($paramFile), + 'rb' + ); + } + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['multipart/form-data'] + ); + } + $clientId="{$this->client->config->getAppName()}; {$this->client->config->getAppVersion()}; PhpRestClient; 24.12.0; {$this->client->config->getMachineName()}"; + + $headers['X-Avalara-Client']=$clientId; + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + } + } + + $headers = $this->client->applyAuthToRequest($headers, $requiredScopes); + + $defaultHeaders = []; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'POST', + $this->client->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + +} + /** + * Represents the Request object for the SubmitInteropDocument API + * + * @param string $document_type Type of the document being uploaded. Partners will be configured in Avalara system to send only certain types of documents. (required) + * @param string $interchange_type Type of interchange (codes in Avalara system that uniquely identifies a type of interchange). Partners will be configured in Avalara system to send documents belonging to certain types of interchanges. (required) + * @param string $avalara_version The HTTP Header meant to specify the version of the API intended to be used (required) + * @param string $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" (optional) + * @param string $x_correlation_id The caller can use this as an identifier to use as a correlation id to trace the call. (optional) + * @param \SplFileObject $file_name The file to be uploaded (e.g., UBL XML, CII XML). (optional) + */ +class SubmitInteropDocumentRequest { + private $document_type; + private $interchange_type; + private $avalara_version; + private $x_avalara_client; + private $x_correlation_id; + private $file_name; + + public function __construct() { + } + public function getDocumentType() { + return $this->document_type; + } + + public function setDocumentType($document_type) { + $this->document_type = $document_type; + } + public function getInterchangeType() { + return $this->interchange_type; + } + + public function setInterchangeType($interchange_type) { + $this->interchange_type = $interchange_type; + } + public function getAvalaraVersion() { + return $this->avalara_version ?? '1.2'; + } + + public function setAvalaraVersion($avalara_version) { + $this->avalara_version = $avalara_version; + } + public function getXAvalaraClient() { + return $this->x_avalara_client; + } + + public function setXAvalaraClient($x_avalara_client) { + $this->x_avalara_client = $x_avalara_client; + } + public function getXCorrelationId() { + return $this->x_correlation_id; + } + + public function setXCorrelationId($x_correlation_id) { + $this->x_correlation_id = $x_correlation_id; + } + public function getFileName() { + return $this->file_name; + } + + public function setFileName($file_name) { + $this->file_name = $file_name; + } +} + diff --git a/lib/API/EInvoicing/V1/MandatesApi.php b/lib/API/EInvoicing/V1/MandatesApi.php index 0ad17a7..41f2b6f 100644 --- a/lib/API/EInvoicing/V1/MandatesApi.php +++ b/lib/API/EInvoicing/V1/MandatesApi.php @@ -9,7 +9,7 @@ /* * AvaTax Software Development Kit for PHP * - * (c) 2004-2022 Avalara, Inc. + * (c) 2004-2025 Avalara, Inc. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -22,9 +22,8 @@ * @package Avalara\SDK\API\EInvoicing\V1 * @author Sachin Baijal * @author Jonathan Wenger - * @copyright 2004-2022 Avalara, Inc. + * @copyright 2004-2025 Avalara, Inc. * @license https://www.apache.org/licenses/LICENSE-2.0 - * @version * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK */ @@ -80,7 +79,7 @@ public function __construct(ApiClient $client ) private function setConfiguration($client): void { $this->verifyAPIClient($client); - $client->setSdkVersion(""); + $client->setSdkVersion("24.12.0"); $this->headerSelector = new HeaderSelector(); $this->client = $client; } @@ -116,6 +115,451 @@ public function getConfig() return $this->client->config; } + /** + * Operation getMandateDataInputFields + * + * Returns document field information for a country mandate, a selected document type, and its version + * + * @param GetMandateDataInputFieldsRequest The request parameters for the API call. + * + * @throws \Avalara\SDK\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Avalara\SDK\Model\EInvoicing\V1\MandateDataInputField[]|\Avalara\SDK\Model\EInvoicing\V1\BadRequest|\Avalara\SDK\Model\EInvoicing\V1\ForbiddenError|\Avalara\SDK\Model\EInvoicing\V1\NotFoundError|\Avalara\SDK\Model\EInvoicing\V1\InternalServerError + */ + public function getMandateDataInputFields($request_parameters) + { + list($response) = $this->getMandateDataInputFieldsWithHttpInfo($request_parameters); + return $response; + } + + /** + * Operation getMandateDataInputFieldsWithHttpInfo + * + * Returns document field information for a country mandate, a selected document type, and its version + * + * @param GetMandateDataInputFieldsRequest The request parameters for the API call. + * + * @throws \Avalara\SDK\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Avalara\SDK\Model\EInvoicing\V1\MandateDataInputField[]|\Avalara\SDK\Model\EInvoicing\V1\BadRequest|\Avalara\SDK\Model\EInvoicing\V1\ForbiddenError|\Avalara\SDK\Model\EInvoicing\V1\NotFoundError|\Avalara\SDK\Model\EInvoicing\V1\InternalServerError, HTTP status code, HTTP response headers (array of strings) + */ + public function getMandateDataInputFieldsWithHttpInfo($request_parameters, $isRetry = false) + { + $logObject = new LogObject($this->client->logRequestAndResponse); + //OAuth2 Scopes + $requiredScopes = ""; + $request = $this->getMandateDataInputFieldsRequest($request_parameters); + $logObject->populateRequestInfo($request); + + try { + try { + $response = $this->client->send_sync($request, []); + } catch (RequestException $e) { + $statusCode = $e->getCode(); + if (($statusCode == 401 || $statusCode == 403) && !$isRetry) { + $this->client->refreshAuthToken($e->getRequest() ? $e->getRequest()->getHeaders() : null, $requiredScopes); + list($response) = $this->getMandateDataInputFieldsWithHttpInfo($request_parameters, true); + return $response; + } + $logObject->populateErrorInfo($e->getResponse()); + $this->client->logger->error(json_encode($logObject)); + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + $logObject->populateErrorMessage($e->getCode(), $e->getMessage()); + $this->client->logger->error(json_encode($logObject)); + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Avalara\SDK\Model\EInvoicing\V1\MandateDataInputField[]' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\MandateDataInputField[]', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Avalara\SDK\Model\EInvoicing\V1\BadRequest' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\BadRequest', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\Avalara\SDK\Model\EInvoicing\V1\ForbiddenError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\ForbiddenError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Avalara\SDK\Model\EInvoicing\V1\NotFoundError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\NotFoundError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Avalara\SDK\Model\EInvoicing\V1\InternalServerError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\InternalServerError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Avalara\SDK\Model\EInvoicing\V1\MandateDataInputField[]'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\MandateDataInputField[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\BadRequest', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\ForbiddenError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\NotFoundError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\InternalServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getMandateDataInputFieldsAsync + * + * Returns document field information for a country mandate, a selected document type, and its version + * + * @param GetMandateDataInputFieldsRequest The request parameters for the API call. + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getMandateDataInputFieldsAsync($request_parameters) + { + return $this->getMandateDataInputFieldsAsyncWithHttpInfo($request_parameters) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getMandateDataInputFieldsAsyncWithHttpInfo + * + * Returns document field information for a country mandate, a selected document type, and its version + * + * @param GetMandateDataInputFieldsRequest The request parameters for the API call. + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getMandateDataInputFieldsAsyncWithHttpInfo($request_parameters, $isRetry = false) + { + $logObject = new LogObject($this->client->logRequestAndResponse); + $returnType = '\Avalara\SDK\Model\EInvoicing\V1\MandateDataInputField[]'; + $request = $this->getMandateDataInputFieldsRequest($request_parameters); + $logObject->populateRequestInfo($request); + return $this->client + ->send_async($request, []) + ->then( + function ($response) use ($returnType, $logObject) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) use ($request_parameters, $isRetry, $request, $logObject) { + //OAuth2 Scopes + $requiredScopes = ""; + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + if (($statusCode == 401 || $statusCode == 403) && !$isRetry) { + $this->client->refreshAuthToken($request->getHeaders(), $requiredScopes); + return $this->getMandateDataInputFieldsAsyncWithHttpInfo($request_parameters, true) + ->then( + function ($response) { + return $response[0]; + } + ); + } + $logObject->populateErrorInfo($response); + $this->client->logger->error(json_encode($logObject)); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getMandateDataInputFields' + * + * @param GetMandateDataInputFieldsRequest The request parameters for the API call. + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getMandateDataInputFieldsRequest($request_parameters) + { + //OAuth2 Scopes + $requiredScopes = ""; + + $avalara_version = $request_parameters->getAvalaraVersion(); + $mandate_id = $request_parameters->getMandateId(); + $document_type = $request_parameters->getDocumentType(); + $document_version = $request_parameters->getDocumentVersion(); + $x_avalara_client = $request_parameters->getXAvalaraClient(); + + // verify the required parameter 'avalara_version' is set + if ($avalara_version === null || (is_array($avalara_version) && count($avalara_version) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $avalara_version when calling getMandateDataInputFields' + ); + } + // verify the required parameter 'mandate_id' is set + if ($mandate_id === null || (is_array($mandate_id) && count($mandate_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $mandate_id when calling getMandateDataInputFields' + ); + } + // verify the required parameter 'document_type' is set + if ($document_type === null || (is_array($document_type) && count($document_type) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $document_type when calling getMandateDataInputFields' + ); + } + // verify the required parameter 'document_version' is set + if ($document_version === null || (is_array($document_version) && count($document_version) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $document_version when calling getMandateDataInputFields' + ); + } + + $resourcePath = '/einvoicing/mandates/{mandateId}/data-input-fields'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($document_type !== null) { + if('form' === 'form' && is_array($document_type)) { + foreach($document_type as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['documentType'] = $document_type; + } + } + // query params + if ($document_version !== null) { + if('form' === 'form' && is_array($document_version)) { + foreach($document_version as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['documentVersion'] = $document_version; + } + } + + // header params + $headerParams['avalara-version'] = '1.2'; + if ($avalara_version !== null) { + $headerParams['avalara-version'] = ObjectSerializer::toHeaderValue($avalara_version); + } + // header params + $headerParams['avalara-version'] = '1.2'; + if ($x_avalara_client !== null) { + $headerParams['X-Avalara-Client'] = ObjectSerializer::toHeaderValue($x_avalara_client); + } + + // path params + if ($mandate_id !== null) { + $resourcePath = str_replace( + '{' . 'mandateId' . '}', + ObjectSerializer::toPathValue($mandate_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + $clientId="{$this->client->config->getAppName()}; {$this->client->config->getAppVersion()}; PhpRestClient; 24.12.0; {$this->client->config->getMachineName()}"; + + $headers['X-Avalara-Client']=$clientId; + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + } + } + + $headers = $this->client->applyAuthToRequest($headers, $requiredScopes); + + $defaultHeaders = []; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'GET', + $this->client->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation getMandates * @@ -479,12 +923,12 @@ public function getMandatesRequest($request_parameters) } // header params - $headerParams['avalara-version'] = '1.0'; + $headerParams['avalara-version'] = '1.2'; if ($avalara_version !== null) { $headerParams['avalara-version'] = ObjectSerializer::toHeaderValue($avalara_version); } // header params - $headerParams['avalara-version'] = '1.0'; + $headerParams['avalara-version'] = '1.2'; if ($x_avalara_client !== null) { $headerParams['X-Avalara-Client'] = ObjectSerializer::toHeaderValue($x_avalara_client); } @@ -501,7 +945,7 @@ public function getMandatesRequest($request_parameters) [] ); } - $clientId="{$this->client->config->getAppName()}; {$this->client->config->getAppVersion()}; PhpRestClient; ; {$this->client->config->getMachineName()}"; + $clientId="{$this->client->config->getAppName()}; {$this->client->config->getAppVersion()}; PhpRestClient; 24.12.0; {$this->client->config->getMachineName()}"; $headers['X-Avalara-Client']=$clientId; @@ -550,11 +994,66 @@ public function getMandatesRequest($request_parameters) } } + /** + * Represents the Request object for the GetMandateDataInputFields API + * + * @param string $avalara_version The HTTP Header meant to specify the version of the API intended to be used (required) + * @param string $mandate_id The unique ID for the mandate that was returned in the GET /einvoicing/mandates response body (required) + * @param string $document_type Select the documentType for which you wish to view the data-input-fields (You may obtain the supported documentTypes from the GET /mandates endpoint) (required) + * @param string $document_version Select the document version of the documentType (You may obtain the supported documentVersion from the GET /mandates endpoint) (required) + * @param string $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. (optional) + */ +class GetMandateDataInputFieldsRequest { + private $avalara_version; + private $mandate_id; + private $document_type; + private $document_version; + private $x_avalara_client; + + public function __construct() { + } + public function getAvalaraVersion() { + return $this->avalara_version ?? '1.2'; + } + + public function setAvalaraVersion($avalara_version) { + $this->avalara_version = $avalara_version; + } + public function getMandateId() { + return $this->mandate_id; + } + + public function setMandateId($mandate_id) { + $this->mandate_id = $mandate_id; + } + public function getDocumentType() { + return $this->document_type; + } + + public function setDocumentType($document_type) { + $this->document_type = $document_type; + } + public function getDocumentVersion() { + return $this->document_version; + } + + public function setDocumentVersion($document_version) { + $this->document_version = $document_version; + } + public function getXAvalaraClient() { + return $this->x_avalara_client; + } + + public function setXAvalaraClient($x_avalara_client) { + $this->x_avalara_client = $x_avalara_client; + } +} + /** * Represents the Request object for the GetMandates API * * @param string $avalara_version The HTTP Header meant to specify the version of the API intended to be used (required) - * @param string $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" (optional) + * @param string $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. (optional) * @param string $filter Filter by field name and value. This filter only supports <code>eq</code> and <code>contains</code>. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. (optional) * @param float $top If nonzero, return no more than this number of results. Used with <code>$skip</code> to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records. (optional) * @param float $skip If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. (optional) @@ -573,7 +1072,7 @@ class GetMandatesRequest { public function __construct() { } public function getAvalaraVersion() { - return $this->avalara_version; + return $this->avalara_version ?? '1.2'; } public function setAvalaraVersion($avalara_version) { diff --git a/lib/API/EInvoicing/V1/TradingPartnersApi.php b/lib/API/EInvoicing/V1/TradingPartnersApi.php new file mode 100644 index 0000000..68fc48a --- /dev/null +++ b/lib/API/EInvoicing/V1/TradingPartnersApi.php @@ -0,0 +1,2528 @@ + + * @author Jonathan Wenger + * @copyright 2004-2025 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + + + +namespace Avalara\SDK\API\EInvoicing\V1; + +use GuzzleHttp\Client; +use GuzzleHttp\ClientInterface; +use GuzzleHttp\Exception\RequestException; +use GuzzleHttp\Exception\ConnectException; +use GuzzleHttp\Psr7\MultipartStream; +use GuzzleHttp\Psr7\Request; +use GuzzleHttp\RequestOptions; +use Avalara\SDK\ApiClient; +use Avalara\SDK\ApiException; +use Avalara\SDK\Configuration; +use Avalara\SDK\HeaderSelector; +use Avalara\SDK\ObjectSerializer; +use Avalara\SDK\Utils\LogObject; + +class TradingPartnersApi +{ + /** + * @var ApiClient + */ + protected $client; + + /** + * @var Configuration + */ + protected $config; + + /** + * @var HeaderSelector + */ + protected $headerSelector; + + /** + * @param ApiClient $client + */ + public function __construct(ApiClient $client ) + { + $this->setConfiguration($client); + } + + /** + * Set APIClient Configuration + * + * @param APIClient $client + */ + private function setConfiguration($client): void + { + $this->verifyAPIClient($client); + $client->setSdkVersion("24.12.0"); + $this->headerSelector = new HeaderSelector(); + $this->client = $client; + } + + /** + * Verify APIClient object + * + * @param int $client + */ + private function verifyAPIClient($client): void + { + if (is_null($client)){ + throw new ApiException("APIClient not defined"); + } + } + + + /** + * Set the HeaderSelector + * + * @param HeaderSelector $selector (required) + */ + public function setHeaderSelector($selector): void + { + $this->headerSelector = $selector ?: new HeaderSelector(); + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->client->config; + } + + /** + * Operation batchSearchParticipants + * + * Creates a batch search and performs a batch search in the directory for participants in the background. + * + * @param BatchSearchParticipantsRequest The request parameters for the API call. + * + * @throws \Avalara\SDK\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function batchSearchParticipants($request_parameters) + { + $this->batchSearchParticipantsWithHttpInfo($request_parameters); + } + + /** + * Operation batchSearchParticipantsWithHttpInfo + * + * Creates a batch search and performs a batch search in the directory for participants in the background. + * + * @param BatchSearchParticipantsRequest The request parameters for the API call. + * + * @throws \Avalara\SDK\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function batchSearchParticipantsWithHttpInfo($request_parameters, $isRetry = false) + { + $logObject = new LogObject($this->client->logRequestAndResponse); + //OAuth2 Scopes + $requiredScopes = ""; + $request = $this->batchSearchParticipantsRequest($request_parameters); + $logObject->populateRequestInfo($request); + + try { + try { + $response = $this->client->send_sync($request, []); + } catch (RequestException $e) { + $statusCode = $e->getCode(); + if (($statusCode == 401 || $statusCode == 403) && !$isRetry) { + $this->client->refreshAuthToken($e->getRequest() ? $e->getRequest()->getHeaders() : null, $requiredScopes); + $this->batchSearchParticipantsWithHttpInfo($request_parameters, true); + } + $logObject->populateErrorInfo($e->getResponse()); + $this->client->logger->error(json_encode($logObject)); + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + $logObject->populateErrorMessage($e->getCode(), $e->getMessage()); + $this->client->logger->error(json_encode($logObject)); + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation batchSearchParticipantsAsync + * + * Creates a batch search and performs a batch search in the directory for participants in the background. + * + * @param BatchSearchParticipantsRequest The request parameters for the API call. + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function batchSearchParticipantsAsync($request_parameters) + { + return $this->batchSearchParticipantsAsyncWithHttpInfo($request_parameters) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation batchSearchParticipantsAsyncWithHttpInfo + * + * Creates a batch search and performs a batch search in the directory for participants in the background. + * + * @param BatchSearchParticipantsRequest The request parameters for the API call. + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function batchSearchParticipantsAsyncWithHttpInfo($request_parameters, $isRetry = false) + { + $logObject = new LogObject($this->client->logRequestAndResponse); + $returnType = ''; + $request = $this->batchSearchParticipantsRequest($request_parameters); + $logObject->populateRequestInfo($request); + return $this->client + ->send_async($request, []) + ->then( + function ($response) use ($returnType, $logObject) { + $this->client->logger->info(json_encode($logObject)); + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) use ($request_parameters, $isRetry, $request, $logObject) { + //OAuth2 Scopes + $requiredScopes = ""; + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + if (($statusCode == 401 || $statusCode == 403) && !$isRetry) { + $this->client->refreshAuthToken($request->getHeaders(), $requiredScopes); + return $this->batchSearchParticipantsAsyncWithHttpInfo($request_parameters, true) + ->then( + function ($response) { + return $response[0]; + } + ); + } + $logObject->populateErrorInfo($response); + $this->client->logger->error(json_encode($logObject)); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'batchSearchParticipants' + * + * @param BatchSearchParticipantsRequest The request parameters for the API call. + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function batchSearchParticipantsRequest($request_parameters) + { + //OAuth2 Scopes + $requiredScopes = ""; + + $avalara_version = $request_parameters->getAvalaraVersion(); + $name = $request_parameters->getName(); + $notification_email = $request_parameters->getNotificationEmail(); + $file = $request_parameters->getFile(); + $x_avalara_client = $request_parameters->getXAvalaraClient(); + $x_correlation_id = $request_parameters->getXCorrelationId(); + + // verify the required parameter 'avalara_version' is set + if ($avalara_version === null || (is_array($avalara_version) && count($avalara_version) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $avalara_version when calling batchSearchParticipants' + ); + } + // verify the required parameter 'name' is set + if ($name === null || (is_array($name) && count($name) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $name when calling batchSearchParticipants' + ); + } + // verify the required parameter 'notification_email' is set + if ($notification_email === null || (is_array($notification_email) && count($notification_email) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $notification_email when calling batchSearchParticipants' + ); + } + // verify the required parameter 'file' is set + if ($file === null || (is_array($file) && count($file) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $file when calling batchSearchParticipants' + ); + } + + $resourcePath = '/einvoicing/trading-partners/batch-searches'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($name !== null) { + if('form' === 'form' && is_array($name)) { + foreach($name as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['name'] = $name; + } + } + // query params + if ($notification_email !== null) { + if('form' === 'form' && is_array($notification_email)) { + foreach($notification_email as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['notificationEmail'] = $notification_email; + } + } + + // header params + $headerParams['avalara-version'] = '1.2'; + if ($avalara_version !== null) { + $headerParams['avalara-version'] = ObjectSerializer::toHeaderValue($avalara_version); + } + // header params + $headerParams['avalara-version'] = '1.2'; + if ($x_avalara_client !== null) { + $headerParams['X-Avalara-Client'] = ObjectSerializer::toHeaderValue($x_avalara_client); + } + // header params + $headerParams['avalara-version'] = '1.2'; + if ($x_correlation_id !== null) { + $headerParams['X-Correlation-ID'] = ObjectSerializer::toHeaderValue($x_correlation_id); + } + + + // form params + if ($file !== null) { + $multipart = true; + $formParams['file'] = []; + $paramFiles = is_array($file) ? $file : [$file]; + foreach ($paramFiles as $paramFile) { + $formParams['file'][] = \GuzzleHttp\Psr7\Utils::tryFopen( + ObjectSerializer::toFormValue($paramFile), + 'rb' + ); + } + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['multipart/form-data'] + ); + } + $clientId="{$this->client->config->getAppName()}; {$this->client->config->getAppVersion()}; PhpRestClient; 24.12.0; {$this->client->config->getMachineName()}"; + + $headers['X-Avalara-Client']=$clientId; + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + } + } + + $headers = $this->client->applyAuthToRequest($headers, $requiredScopes); + + $defaultHeaders = []; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'POST', + $this->client->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation downloadBatchSearchReport + * + * Download batch search results in a csv file. + * + * @param DownloadBatchSearchReportRequest The request parameters for the API call. + * + * @throws \Avalara\SDK\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SplFileObject|\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse|\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse|\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse|\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse + */ + public function downloadBatchSearchReport($request_parameters) + { + list($response) = $this->downloadBatchSearchReportWithHttpInfo($request_parameters); + return $response; + } + + /** + * Operation downloadBatchSearchReportWithHttpInfo + * + * Download batch search results in a csv file. + * + * @param DownloadBatchSearchReportRequest The request parameters for the API call. + * + * @throws \Avalara\SDK\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SplFileObject|\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse|\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse|\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse|\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function downloadBatchSearchReportWithHttpInfo($request_parameters, $isRetry = false) + { + $logObject = new LogObject($this->client->logRequestAndResponse); + //OAuth2 Scopes + $requiredScopes = ""; + $request = $this->downloadBatchSearchReportRequest($request_parameters); + $logObject->populateRequestInfo($request); + + try { + try { + $response = $this->client->send_sync($request, []); + } catch (RequestException $e) { + $statusCode = $e->getCode(); + if (($statusCode == 401 || $statusCode == 403) && !$isRetry) { + $this->client->refreshAuthToken($e->getRequest() ? $e->getRequest()->getHeaders() : null, $requiredScopes); + list($response) = $this->downloadBatchSearchReportWithHttpInfo($request_parameters, true); + return $response; + } + $logObject->populateErrorInfo($e->getResponse()); + $this->client->logger->error(json_encode($logObject)); + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + $logObject->populateErrorMessage($e->getCode(), $e->getMessage()); + $this->client->logger->error(json_encode($logObject)); + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\SplFileObject' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\SplFileObject', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\SplFileObject'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SplFileObject', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation downloadBatchSearchReportAsync + * + * Download batch search results in a csv file. + * + * @param DownloadBatchSearchReportRequest The request parameters for the API call. + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function downloadBatchSearchReportAsync($request_parameters) + { + return $this->downloadBatchSearchReportAsyncWithHttpInfo($request_parameters) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation downloadBatchSearchReportAsyncWithHttpInfo + * + * Download batch search results in a csv file. + * + * @param DownloadBatchSearchReportRequest The request parameters for the API call. + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function downloadBatchSearchReportAsyncWithHttpInfo($request_parameters, $isRetry = false) + { + $logObject = new LogObject($this->client->logRequestAndResponse); + $returnType = '\SplFileObject'; + $request = $this->downloadBatchSearchReportRequest($request_parameters); + $logObject->populateRequestInfo($request); + return $this->client + ->send_async($request, []) + ->then( + function ($response) use ($returnType, $logObject) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) use ($request_parameters, $isRetry, $request, $logObject) { + //OAuth2 Scopes + $requiredScopes = ""; + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + if (($statusCode == 401 || $statusCode == 403) && !$isRetry) { + $this->client->refreshAuthToken($request->getHeaders(), $requiredScopes); + return $this->downloadBatchSearchReportAsyncWithHttpInfo($request_parameters, true) + ->then( + function ($response) { + return $response[0]; + } + ); + } + $logObject->populateErrorInfo($response); + $this->client->logger->error(json_encode($logObject)); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'downloadBatchSearchReport' + * + * @param DownloadBatchSearchReportRequest The request parameters for the API call. + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function downloadBatchSearchReportRequest($request_parameters) + { + //OAuth2 Scopes + $requiredScopes = ""; + + $avalara_version = $request_parameters->getAvalaraVersion(); + $id = $request_parameters->getId(); + $x_avalara_client = $request_parameters->getXAvalaraClient(); + $x_correlation_id = $request_parameters->getXCorrelationId(); + + // verify the required parameter 'avalara_version' is set + if ($avalara_version === null || (is_array($avalara_version) && count($avalara_version) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $avalara_version when calling downloadBatchSearchReport' + ); + } + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling downloadBatchSearchReport' + ); + } + + $resourcePath = '/einvoicing/trading-partners/batch-searches/{id}/$download-results'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // header params + $headerParams['avalara-version'] = '1.2'; + if ($avalara_version !== null) { + $headerParams['avalara-version'] = ObjectSerializer::toHeaderValue($avalara_version); + } + // header params + $headerParams['avalara-version'] = '1.2'; + if ($x_avalara_client !== null) { + $headerParams['X-Avalara-Client'] = ObjectSerializer::toHeaderValue($x_avalara_client); + } + // header params + $headerParams['avalara-version'] = '1.2'; + if ($x_correlation_id !== null) { + $headerParams['X-Correlation-ID'] = ObjectSerializer::toHeaderValue($x_correlation_id); + } + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['text/csv', 'application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['text/csv', 'application/json'], + [] + ); + } + $clientId="{$this->client->config->getAppName()}; {$this->client->config->getAppVersion()}; PhpRestClient; 24.12.0; {$this->client->config->getMachineName()}"; + + $headers['X-Avalara-Client']=$clientId; + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + } + } + + $headers = $this->client->applyAuthToRequest($headers, $requiredScopes); + + $defaultHeaders = []; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'GET', + $this->client->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getBatchSearchDetail + * + * Get the batch search details for a given id. + * + * @param GetBatchSearchDetailRequest The request parameters for the API call. + * + * @throws \Avalara\SDK\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Avalara\SDK\Model\EInvoicing\V1\BatchSearch|\Avalara\SDK\Model\EInvoicing\V1\BatchSearchListResponse|\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse|\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse + */ + public function getBatchSearchDetail($request_parameters) + { + list($response) = $this->getBatchSearchDetailWithHttpInfo($request_parameters); + return $response; + } + + /** + * Operation getBatchSearchDetailWithHttpInfo + * + * Get the batch search details for a given id. + * + * @param GetBatchSearchDetailRequest The request parameters for the API call. + * + * @throws \Avalara\SDK\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Avalara\SDK\Model\EInvoicing\V1\BatchSearch|\Avalara\SDK\Model\EInvoicing\V1\BatchSearchListResponse|\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse|\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getBatchSearchDetailWithHttpInfo($request_parameters, $isRetry = false) + { + $logObject = new LogObject($this->client->logRequestAndResponse); + //OAuth2 Scopes + $requiredScopes = ""; + $request = $this->getBatchSearchDetailRequest($request_parameters); + $logObject->populateRequestInfo($request); + + try { + try { + $response = $this->client->send_sync($request, []); + } catch (RequestException $e) { + $statusCode = $e->getCode(); + if (($statusCode == 401 || $statusCode == 403) && !$isRetry) { + $this->client->refreshAuthToken($e->getRequest() ? $e->getRequest()->getHeaders() : null, $requiredScopes); + list($response) = $this->getBatchSearchDetailWithHttpInfo($request_parameters, true); + return $response; + } + $logObject->populateErrorInfo($e->getResponse()); + $this->client->logger->error(json_encode($logObject)); + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + $logObject->populateErrorMessage($e->getCode(), $e->getMessage()); + $this->client->logger->error(json_encode($logObject)); + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Avalara\SDK\Model\EInvoicing\V1\BatchSearch' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\BatchSearch', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Avalara\SDK\Model\EInvoicing\V1\BatchSearchListResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\BatchSearchListResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Avalara\SDK\Model\EInvoicing\V1\BatchSearch'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\BatchSearch', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\BatchSearchListResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getBatchSearchDetailAsync + * + * Get the batch search details for a given id. + * + * @param GetBatchSearchDetailRequest The request parameters for the API call. + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getBatchSearchDetailAsync($request_parameters) + { + return $this->getBatchSearchDetailAsyncWithHttpInfo($request_parameters) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getBatchSearchDetailAsyncWithHttpInfo + * + * Get the batch search details for a given id. + * + * @param GetBatchSearchDetailRequest The request parameters for the API call. + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getBatchSearchDetailAsyncWithHttpInfo($request_parameters, $isRetry = false) + { + $logObject = new LogObject($this->client->logRequestAndResponse); + $returnType = '\Avalara\SDK\Model\EInvoicing\V1\BatchSearch'; + $request = $this->getBatchSearchDetailRequest($request_parameters); + $logObject->populateRequestInfo($request); + return $this->client + ->send_async($request, []) + ->then( + function ($response) use ($returnType, $logObject) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) use ($request_parameters, $isRetry, $request, $logObject) { + //OAuth2 Scopes + $requiredScopes = ""; + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + if (($statusCode == 401 || $statusCode == 403) && !$isRetry) { + $this->client->refreshAuthToken($request->getHeaders(), $requiredScopes); + return $this->getBatchSearchDetailAsyncWithHttpInfo($request_parameters, true) + ->then( + function ($response) { + return $response[0]; + } + ); + } + $logObject->populateErrorInfo($response); + $this->client->logger->error(json_encode($logObject)); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getBatchSearchDetail' + * + * @param GetBatchSearchDetailRequest The request parameters for the API call. + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getBatchSearchDetailRequest($request_parameters) + { + //OAuth2 Scopes + $requiredScopes = ""; + + $avalara_version = $request_parameters->getAvalaraVersion(); + $id = $request_parameters->getId(); + $x_avalara_client = $request_parameters->getXAvalaraClient(); + $x_correlation_id = $request_parameters->getXCorrelationId(); + + // verify the required parameter 'avalara_version' is set + if ($avalara_version === null || (is_array($avalara_version) && count($avalara_version) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $avalara_version when calling getBatchSearchDetail' + ); + } + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getBatchSearchDetail' + ); + } + + $resourcePath = '/einvoicing/trading-partners/batch-searches/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // header params + $headerParams['avalara-version'] = '1.2'; + if ($avalara_version !== null) { + $headerParams['avalara-version'] = ObjectSerializer::toHeaderValue($avalara_version); + } + // header params + $headerParams['avalara-version'] = '1.2'; + if ($x_avalara_client !== null) { + $headerParams['X-Avalara-Client'] = ObjectSerializer::toHeaderValue($x_avalara_client); + } + // header params + $headerParams['avalara-version'] = '1.2'; + if ($x_correlation_id !== null) { + $headerParams['X-Correlation-ID'] = ObjectSerializer::toHeaderValue($x_correlation_id); + } + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + $clientId="{$this->client->config->getAppName()}; {$this->client->config->getAppVersion()}; PhpRestClient; 24.12.0; {$this->client->config->getMachineName()}"; + + $headers['X-Avalara-Client']=$clientId; + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + } + } + + $headers = $this->client->applyAuthToRequest($headers, $requiredScopes); + + $defaultHeaders = []; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'GET', + $this->client->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listBatchSearches + * + * List all batch searches that were previously submitted. + * + * @param ListBatchSearchesRequest The request parameters for the API call. + * + * @throws \Avalara\SDK\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Avalara\SDK\Model\EInvoicing\V1\BatchSearchListResponse|\Avalara\SDK\Model\EInvoicing\V1\BatchSearchListResponse|\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse|\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse + */ + public function listBatchSearches($request_parameters) + { + list($response) = $this->listBatchSearchesWithHttpInfo($request_parameters); + return $response; + } + + /** + * Operation listBatchSearchesWithHttpInfo + * + * List all batch searches that were previously submitted. + * + * @param ListBatchSearchesRequest The request parameters for the API call. + * + * @throws \Avalara\SDK\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Avalara\SDK\Model\EInvoicing\V1\BatchSearchListResponse|\Avalara\SDK\Model\EInvoicing\V1\BatchSearchListResponse|\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse|\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function listBatchSearchesWithHttpInfo($request_parameters, $isRetry = false) + { + $logObject = new LogObject($this->client->logRequestAndResponse); + //OAuth2 Scopes + $requiredScopes = ""; + $request = $this->listBatchSearchesRequest($request_parameters); + $logObject->populateRequestInfo($request); + + try { + try { + $response = $this->client->send_sync($request, []); + } catch (RequestException $e) { + $statusCode = $e->getCode(); + if (($statusCode == 401 || $statusCode == 403) && !$isRetry) { + $this->client->refreshAuthToken($e->getRequest() ? $e->getRequest()->getHeaders() : null, $requiredScopes); + list($response) = $this->listBatchSearchesWithHttpInfo($request_parameters, true); + return $response; + } + $logObject->populateErrorInfo($e->getResponse()); + $this->client->logger->error(json_encode($logObject)); + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + $logObject->populateErrorMessage($e->getCode(), $e->getMessage()); + $this->client->logger->error(json_encode($logObject)); + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Avalara\SDK\Model\EInvoicing\V1\BatchSearchListResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\BatchSearchListResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Avalara\SDK\Model\EInvoicing\V1\BatchSearchListResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\BatchSearchListResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Avalara\SDK\Model\EInvoicing\V1\BatchSearchListResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\BatchSearchListResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\BatchSearchListResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listBatchSearchesAsync + * + * List all batch searches that were previously submitted. + * + * @param ListBatchSearchesRequest The request parameters for the API call. + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listBatchSearchesAsync($request_parameters) + { + return $this->listBatchSearchesAsyncWithHttpInfo($request_parameters) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listBatchSearchesAsyncWithHttpInfo + * + * List all batch searches that were previously submitted. + * + * @param ListBatchSearchesRequest The request parameters for the API call. + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listBatchSearchesAsyncWithHttpInfo($request_parameters, $isRetry = false) + { + $logObject = new LogObject($this->client->logRequestAndResponse); + $returnType = '\Avalara\SDK\Model\EInvoicing\V1\BatchSearchListResponse'; + $request = $this->listBatchSearchesRequest($request_parameters); + $logObject->populateRequestInfo($request); + return $this->client + ->send_async($request, []) + ->then( + function ($response) use ($returnType, $logObject) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) use ($request_parameters, $isRetry, $request, $logObject) { + //OAuth2 Scopes + $requiredScopes = ""; + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + if (($statusCode == 401 || $statusCode == 403) && !$isRetry) { + $this->client->refreshAuthToken($request->getHeaders(), $requiredScopes); + return $this->listBatchSearchesAsyncWithHttpInfo($request_parameters, true) + ->then( + function ($response) { + return $response[0]; + } + ); + } + $logObject->populateErrorInfo($response); + $this->client->logger->error(json_encode($logObject)); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listBatchSearches' + * + * @param ListBatchSearchesRequest The request parameters for the API call. + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listBatchSearchesRequest($request_parameters) + { + //OAuth2 Scopes + $requiredScopes = ""; + + $avalara_version = $request_parameters->getAvalaraVersion(); + $x_avalara_client = $request_parameters->getXAvalaraClient(); + $filter = $request_parameters->getFilter(); + $count = $request_parameters->getCount(); + $top = $request_parameters->getTop(); + $skip = $request_parameters->getSkip(); + $order_by = $request_parameters->getOrderBy(); + $x_correlation_id = $request_parameters->getXCorrelationId(); + + // verify the required parameter 'avalara_version' is set + if ($avalara_version === null || (is_array($avalara_version) && count($avalara_version) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $avalara_version when calling listBatchSearches' + ); + } + + $resourcePath = '/einvoicing/trading-partners/batch-searches'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($filter !== null) { + if('form' === 'form' && is_array($filter)) { + foreach($filter as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['$filter'] = $filter; + } + } + // query params + if ($count !== null) { + if('form' === 'form' && is_array($count)) { + foreach($count as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['count'] = $count; + } + } + // query params + if ($top !== null) { + if('form' === 'form' && is_array($top)) { + foreach($top as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['$top'] = $top; + } + } + // query params + if ($skip !== null) { + if('form' === 'form' && is_array($skip)) { + foreach($skip as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['$skip'] = $skip; + } + } + // query params + if ($order_by !== null) { + if('form' === 'form' && is_array($order_by)) { + foreach($order_by as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['$orderBy'] = $order_by; + } + } + + // header params + $headerParams['avalara-version'] = '1.2'; + if ($avalara_version !== null) { + $headerParams['avalara-version'] = ObjectSerializer::toHeaderValue($avalara_version); + } + // header params + $headerParams['avalara-version'] = '1.2'; + if ($x_avalara_client !== null) { + $headerParams['X-Avalara-Client'] = ObjectSerializer::toHeaderValue($x_avalara_client); + } + // header params + $headerParams['avalara-version'] = '1.2'; + if ($x_correlation_id !== null) { + $headerParams['X-Correlation-ID'] = ObjectSerializer::toHeaderValue($x_correlation_id); + } + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + $clientId="{$this->client->config->getAppName()}; {$this->client->config->getAppVersion()}; PhpRestClient; 24.12.0; {$this->client->config->getMachineName()}"; + + $headers['X-Avalara-Client']=$clientId; + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + } + } + + $headers = $this->client->applyAuthToRequest($headers, $requiredScopes); + + $defaultHeaders = []; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'GET', + $this->client->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation searchParticipants + * + * Returns a list of participants matching the input query. + * + * @param SearchParticipantsRequest The request parameters for the API call. + * + * @throws \Avalara\SDK\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Avalara\SDK\Model\EInvoicing\V1\DirectorySearchResponse|\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse|\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse|\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse|\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse + */ + public function searchParticipants($request_parameters) + { + list($response) = $this->searchParticipantsWithHttpInfo($request_parameters); + return $response; + } + + /** + * Operation searchParticipantsWithHttpInfo + * + * Returns a list of participants matching the input query. + * + * @param SearchParticipantsRequest The request parameters for the API call. + * + * @throws \Avalara\SDK\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Avalara\SDK\Model\EInvoicing\V1\DirectorySearchResponse|\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse|\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse|\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse|\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function searchParticipantsWithHttpInfo($request_parameters, $isRetry = false) + { + $logObject = new LogObject($this->client->logRequestAndResponse); + //OAuth2 Scopes + $requiredScopes = ""; + $request = $this->searchParticipantsRequest($request_parameters); + $logObject->populateRequestInfo($request); + + try { + try { + $response = $this->client->send_sync($request, []); + } catch (RequestException $e) { + $statusCode = $e->getCode(); + if (($statusCode == 401 || $statusCode == 403) && !$isRetry) { + $this->client->refreshAuthToken($e->getRequest() ? $e->getRequest()->getHeaders() : null, $requiredScopes); + list($response) = $this->searchParticipantsWithHttpInfo($request_parameters, true); + return $response; + } + $logObject->populateErrorInfo($e->getResponse()); + $this->client->logger->error(json_encode($logObject)); + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + $logObject->populateErrorMessage($e->getCode(), $e->getMessage()); + $this->client->logger->error(json_encode($logObject)); + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\Avalara\SDK\Model\EInvoicing\V1\DirectorySearchResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\DirectorySearchResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, '\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\Avalara\SDK\Model\EInvoicing\V1\DirectorySearchResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\DirectorySearchResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation searchParticipantsAsync + * + * Returns a list of participants matching the input query. + * + * @param SearchParticipantsRequest The request parameters for the API call. + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function searchParticipantsAsync($request_parameters) + { + return $this->searchParticipantsAsyncWithHttpInfo($request_parameters) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation searchParticipantsAsyncWithHttpInfo + * + * Returns a list of participants matching the input query. + * + * @param SearchParticipantsRequest The request parameters for the API call. + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function searchParticipantsAsyncWithHttpInfo($request_parameters, $isRetry = false) + { + $logObject = new LogObject($this->client->logRequestAndResponse); + $returnType = '\Avalara\SDK\Model\EInvoicing\V1\DirectorySearchResponse'; + $request = $this->searchParticipantsRequest($request_parameters); + $logObject->populateRequestInfo($request); + return $this->client + ->send_async($request, []) + ->then( + function ($response) use ($returnType, $logObject) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + $logObject->populateResponseInfo($content, $response); + $this->client->logger->info(json_encode($logObject)); + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) use ($request_parameters, $isRetry, $request, $logObject) { + //OAuth2 Scopes + $requiredScopes = ""; + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + if (($statusCode == 401 || $statusCode == 403) && !$isRetry) { + $this->client->refreshAuthToken($request->getHeaders(), $requiredScopes); + return $this->searchParticipantsAsyncWithHttpInfo($request_parameters, true) + ->then( + function ($response) { + return $response[0]; + } + ); + } + $logObject->populateErrorInfo($response); + $this->client->logger->error(json_encode($logObject)); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'searchParticipants' + * + * @param SearchParticipantsRequest The request parameters for the API call. + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function searchParticipantsRequest($request_parameters) + { + //OAuth2 Scopes + $requiredScopes = ""; + + $avalara_version = $request_parameters->getAvalaraVersion(); + $search = $request_parameters->getSearch(); + $x_avalara_client = $request_parameters->getXAvalaraClient(); + $count = $request_parameters->getCount(); + $filter = $request_parameters->getFilter(); + $top = $request_parameters->getTop(); + $skip = $request_parameters->getSkip(); + $order_by = $request_parameters->getOrderBy(); + $x_correlation_id = $request_parameters->getXCorrelationId(); + + // verify the required parameter 'avalara_version' is set + if ($avalara_version === null || (is_array($avalara_version) && count($avalara_version) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $avalara_version when calling searchParticipants' + ); + } + // verify the required parameter 'search' is set + if ($search === null || (is_array($search) && count($search) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $search when calling searchParticipants' + ); + } + + $resourcePath = '/einvoicing/trading-partners'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($count !== null) { + if('form' === 'form' && is_array($count)) { + foreach($count as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['count'] = $count; + } + } + // query params + if ($search !== null) { + if('form' === 'form' && is_array($search)) { + foreach($search as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['$search'] = $search; + } + } + // query params + if ($filter !== null) { + if('form' === 'form' && is_array($filter)) { + foreach($filter as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['$filter'] = $filter; + } + } + // query params + if ($top !== null) { + if('form' === 'form' && is_array($top)) { + foreach($top as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['$top'] = $top; + } + } + // query params + if ($skip !== null) { + if('form' === 'form' && is_array($skip)) { + foreach($skip as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['$skip'] = $skip; + } + } + // query params + if ($order_by !== null) { + if('form' === 'form' && is_array($order_by)) { + foreach($order_by as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['$orderBy'] = $order_by; + } + } + + // header params + $headerParams['avalara-version'] = '1.2'; + if ($avalara_version !== null) { + $headerParams['avalara-version'] = ObjectSerializer::toHeaderValue($avalara_version); + } + // header params + $headerParams['avalara-version'] = '1.2'; + if ($x_avalara_client !== null) { + $headerParams['X-Avalara-Client'] = ObjectSerializer::toHeaderValue($x_avalara_client); + } + // header params + $headerParams['avalara-version'] = '1.2'; + if ($x_correlation_id !== null) { + $headerParams['X-Correlation-ID'] = ObjectSerializer::toHeaderValue($x_correlation_id); + } + + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + $clientId="{$this->client->config->getAppName()}; {$this->client->config->getAppVersion()}; PhpRestClient; 24.12.0; {$this->client->config->getMachineName()}"; + + $headers['X-Avalara-Client']=$clientId; + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + } + } + + $headers = $this->client->applyAuthToRequest($headers, $requiredScopes); + + $defaultHeaders = []; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'GET', + $this->client->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + +} + /** + * Represents the Request object for the BatchSearchParticipants API + * + * @param string $avalara_version The HTTP Header meant to specify the version of the API intended to be used (required) + * @param string $name The human readable name given to this batch search. (required) + * @param string $notification_email The email address of the user to whom the batch search completion notification must go to. (required) + * @param \SplFileObject $file CSV file containing search parameters. (required) + * @param string $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" (optional) + * @param string $x_correlation_id The caller can use this as an identifier to use as a correlation id to trace the call. (optional) + */ +class BatchSearchParticipantsRequest { + private $avalara_version; + private $name; + private $notification_email; + private $file; + private $x_avalara_client; + private $x_correlation_id; + + public function __construct() { + } + public function getAvalaraVersion() { + return $this->avalara_version ?? '1.2'; + } + + public function setAvalaraVersion($avalara_version) { + $this->avalara_version = $avalara_version; + } + public function getName() { + return $this->name; + } + + public function setName($name) { + $this->name = $name; + } + public function getNotificationEmail() { + return $this->notification_email; + } + + public function setNotificationEmail($notification_email) { + $this->notification_email = $notification_email; + } + public function getFile() { + return $this->file; + } + + public function setFile($file) { + $this->file = $file; + } + public function getXAvalaraClient() { + return $this->x_avalara_client; + } + + public function setXAvalaraClient($x_avalara_client) { + $this->x_avalara_client = $x_avalara_client; + } + public function getXCorrelationId() { + return $this->x_correlation_id; + } + + public function setXCorrelationId($x_correlation_id) { + $this->x_correlation_id = $x_correlation_id; + } +} + + /** + * Represents the Request object for the DownloadBatchSearchReport API + * + * @param string $avalara_version The HTTP Header meant to specify the version of the API intended to be used (required) + * @param string $id The ID of the batch search whose report is to be downloaded. (required) + * @param string $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" (optional) + * @param string $x_correlation_id The caller can use this as an identifier to use as a correlation id to trace the call. (optional) + */ +class DownloadBatchSearchReportRequest { + private $avalara_version; + private $id; + private $x_avalara_client; + private $x_correlation_id; + + public function __construct() { + } + public function getAvalaraVersion() { + return $this->avalara_version ?? '1.2'; + } + + public function setAvalaraVersion($avalara_version) { + $this->avalara_version = $avalara_version; + } + public function getId() { + return $this->id; + } + + public function setId($id) { + $this->id = $id; + } + public function getXAvalaraClient() { + return $this->x_avalara_client; + } + + public function setXAvalaraClient($x_avalara_client) { + $this->x_avalara_client = $x_avalara_client; + } + public function getXCorrelationId() { + return $this->x_correlation_id; + } + + public function setXCorrelationId($x_correlation_id) { + $this->x_correlation_id = $x_correlation_id; + } +} + + /** + * Represents the Request object for the GetBatchSearchDetail API + * + * @param string $avalara_version The HTTP Header meant to specify the version of the API intended to be used (required) + * @param string $id The ID of the batch search that was submitted earlier. (required) + * @param string $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" (optional) + * @param string $x_correlation_id The caller can use this as an identifier to use as a correlation id to trace the call. (optional) + */ +class GetBatchSearchDetailRequest { + private $avalara_version; + private $id; + private $x_avalara_client; + private $x_correlation_id; + + public function __construct() { + } + public function getAvalaraVersion() { + return $this->avalara_version ?? '1.2'; + } + + public function setAvalaraVersion($avalara_version) { + $this->avalara_version = $avalara_version; + } + public function getId() { + return $this->id; + } + + public function setId($id) { + $this->id = $id; + } + public function getXAvalaraClient() { + return $this->x_avalara_client; + } + + public function setXAvalaraClient($x_avalara_client) { + $this->x_avalara_client = $x_avalara_client; + } + public function getXCorrelationId() { + return $this->x_correlation_id; + } + + public function setXCorrelationId($x_correlation_id) { + $this->x_correlation_id = $x_correlation_id; + } +} + + /** + * Represents the Request object for the ListBatchSearches API + * + * @param string $avalara_version The HTTP Header meant to specify the version of the API intended to be used (required) + * @param string $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" (optional) + * @param string $filter Filter by field name and value. This filter only supports <code>eq</code> .The parameters supported is <code>name</code>. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. Filtering will be done over the provided parameters. (optional) + * @param bool $count When set to true, the count of the collection is included as @recordSetCount in the response body. (optional) + * @param string $top If nonzero, return no more than this number of results. Used with <code>$skip</code> to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 200 records. (optional) + * @param string $skip If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. (optional) + * @param string $order_by The $orderBy query parameter specifies the field and sorting direction for ordering the result set. The value is a string that combines a field name and a sorting direction (asc for ascending or desc for descending), separated by a space. (optional) + * @param string $x_correlation_id The caller can use this as an identifier to use as a correlation id to trace the call. (optional) + */ +class ListBatchSearchesRequest { + private $avalara_version; + private $x_avalara_client; + private $filter; + private $count; + private $top; + private $skip; + private $order_by; + private $x_correlation_id; + + public function __construct() { + } + public function getAvalaraVersion() { + return $this->avalara_version ?? '1.2'; + } + + public function setAvalaraVersion($avalara_version) { + $this->avalara_version = $avalara_version; + } + public function getXAvalaraClient() { + return $this->x_avalara_client; + } + + public function setXAvalaraClient($x_avalara_client) { + $this->x_avalara_client = $x_avalara_client; + } + public function getFilter() { + return $this->filter; + } + + public function setFilter($filter) { + $this->filter = $filter; + } + public function getCount() { + return $this->count; + } + + public function setCount($count) { + $this->count = $count; + } + public function getTop() { + return $this->top; + } + + public function setTop($top) { + $this->top = $top; + } + public function getSkip() { + return $this->skip; + } + + public function setSkip($skip) { + $this->skip = $skip; + } + public function getOrderBy() { + return $this->order_by; + } + + public function setOrderBy($order_by) { + $this->order_by = $order_by; + } + public function getXCorrelationId() { + return $this->x_correlation_id; + } + + public function setXCorrelationId($x_correlation_id) { + $this->x_correlation_id = $x_correlation_id; + } +} + + /** + * Represents the Request object for the SearchParticipants API + * + * @param string $avalara_version The HTTP Header meant to specify the version of the API intended to be used (required) + * @param string $search Search by value supports logical AND and OR. Refer to [https://learn.microsoft.com/en-us/odata/concepts/queryoptions-overview#search](https://learn.microsoft.com/en-us/odata/concepts/queryoptions-overview#search) for more information on search. Search will be done over <code>name</code> and <code>identifier</code> parameters only. (required) + * @param string $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" (optional) + * @param bool $count When set to true, the count of the collection is included as @recordSetCount in the response body. (optional) + * @param string $filter Filter by field name and value. This filter only supports <code>eq</code> .The parameters supported are <code>network</code>, <code>country</code>, <code>documentType</code>, <code>idType</code>. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. Filtering will be done over the provided parameters. (optional) + * @param string $top If nonzero, return no more than this number of results. Used with <code>$skip</code> to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 200 records. (optional) + * @param string $skip If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. (optional) + * @param string $order_by The $orderBy query parameter specifies the field and sorting direction for ordering the result set. The value is a string that combines a field name and a sorting direction (asc for ascending or desc for descending), separated by a space. (optional) + * @param string $x_correlation_id The caller can use this as an identifier to use as a correlation id to trace the call. (optional) + */ +class SearchParticipantsRequest { + private $avalara_version; + private $search; + private $x_avalara_client; + private $count; + private $filter; + private $top; + private $skip; + private $order_by; + private $x_correlation_id; + + public function __construct() { + } + public function getAvalaraVersion() { + return $this->avalara_version ?? '1.2'; + } + + public function setAvalaraVersion($avalara_version) { + $this->avalara_version = $avalara_version; + } + public function getSearch() { + return $this->search; + } + + public function setSearch($search) { + $this->search = $search; + } + public function getXAvalaraClient() { + return $this->x_avalara_client; + } + + public function setXAvalaraClient($x_avalara_client) { + $this->x_avalara_client = $x_avalara_client; + } + public function getCount() { + return $this->count; + } + + public function setCount($count) { + $this->count = $count; + } + public function getFilter() { + return $this->filter; + } + + public function setFilter($filter) { + $this->filter = $filter; + } + public function getTop() { + return $this->top; + } + + public function setTop($top) { + $this->top = $top; + } + public function getSkip() { + return $this->skip; + } + + public function setSkip($skip) { + $this->skip = $skip; + } + public function getOrderBy() { + return $this->order_by; + } + + public function setOrderBy($order_by) { + $this->order_by = $order_by; + } + public function getXCorrelationId() { + return $this->x_correlation_id; + } + + public function setXCorrelationId($x_correlation_id) { + $this->x_correlation_id = $x_correlation_id; + } +} + diff --git a/lib/Model/EInvoicing/V1/BadDownloadRequest.php b/lib/Model/EInvoicing/V1/BadDownloadRequest.php index d0f0fcb..9460bcf 100644 --- a/lib/Model/EInvoicing/V1/BadDownloadRequest.php +++ b/lib/Model/EInvoicing/V1/BadDownloadRequest.php @@ -13,7 +13,7 @@ /* * AvaTax Software Development Kit for PHP * - * (c) 2004-2022 Avalara, Inc. + * (c) 2004-2025 Avalara, Inc. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -26,9 +26,8 @@ * @package Avalara\SDK\API\EInvoicing\V1 * @author Sachin Baijal * @author Jonathan Wenger - * @copyright 2004-2022 Avalara, Inc. + * @copyright 2004-2025 Avalara, Inc. * @license https://www.apache.org/licenses/LICENSE-2.0 - * @version * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK */ diff --git a/lib/Model/EInvoicing/V1/BadRequest.php b/lib/Model/EInvoicing/V1/BadRequest.php index b55b7df..7a1b43f 100644 --- a/lib/Model/EInvoicing/V1/BadRequest.php +++ b/lib/Model/EInvoicing/V1/BadRequest.php @@ -13,7 +13,7 @@ /* * AvaTax Software Development Kit for PHP * - * (c) 2004-2022 Avalara, Inc. + * (c) 2004-2025 Avalara, Inc. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -26,9 +26,8 @@ * @package Avalara\SDK\API\EInvoicing\V1 * @author Sachin Baijal * @author Jonathan Wenger - * @copyright 2004-2022 Avalara, Inc. + * @copyright 2004-2025 Avalara, Inc. * @license https://www.apache.org/licenses/LICENSE-2.0 - * @version * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK */ diff --git a/lib/Model/EInvoicing/V1/BatchSearch.php b/lib/Model/EInvoicing/V1/BatchSearch.php new file mode 100644 index 0000000..6f3eb20 --- /dev/null +++ b/lib/Model/EInvoicing/V1/BatchSearch.php @@ -0,0 +1,550 @@ + + * @author Jonathan Wenger + * @copyright 2004-2025 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\SDK\Model\EInvoicing\V1; + +use \ArrayAccess; +use \Avalara\SDK\ObjectSerializer; +use \Avalara\SDK\Model\ModelInterface; +/** + * BatchSearch Class Doc Comment + * + * @category Class + * @package Avalara\SDK + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class BatchSearch implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BatchSearch'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'name' => 'string', + 'created_by' => 'string', + 'created' => '\DateTime', + 'last_modified' => '\DateTime', + 'status' => 'string', + 'error' => '\Avalara\SDK\Model\EInvoicing\V1\ErrorResponse' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'created_by' => null, + 'created' => 'date-time', + 'last_modified' => 'date-time', + 'status' => null, + 'error' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'created_by' => 'createdBy', + 'created' => 'created', + 'last_modified' => 'lastModified', + 'status' => 'status', + 'error' => 'error' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'created_by' => 'setCreatedBy', + 'created' => 'setCreated', + 'last_modified' => 'setLastModified', + 'status' => 'setStatus', + 'error' => 'setError' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'created_by' => 'getCreatedBy', + 'created' => 'getCreated', + 'last_modified' => 'getLastModified', + 'status' => 'getStatus', + 'error' => 'getError' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const STATUS_ACCEPTED = 'Accepted'; + const STATUS_RUNNING = 'Running'; + const STATUS_COMPLETED = 'Completed'; + const STATUS_FAILED = 'Failed'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_ACCEPTED, + self::STATUS_RUNNING, + self::STATUS_COMPLETED, + self::STATUS_FAILED, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['created_by'] = $data['created_by'] ?? null; + $this->container['created'] = $data['created'] ?? null; + $this->container['last_modified'] = $data['last_modified'] ?? null; + $this->container['status'] = $data['status'] ?? null; + $this->container['error'] = $data['error'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id ID of the batch search + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Name of the batch report + * + * @return self + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets created_by + * + * @return string|null + */ + public function getCreatedBy() + { + return $this->container['created_by']; + } + + /** + * Sets created_by + * + * @param string|null $created_by Email of the user who created the batch search + * + * @return self + */ + public function setCreatedBy($created_by) + { + $this->container['created_by'] = $created_by; + + return $this; + } + + /** + * Gets created + * + * @return \DateTime|null + */ + public function getCreated() + { + return $this->container['created']; + } + + /** + * Sets created + * + * @param \DateTime|null $created Timestamp when the batch search was created + * + * @return self + */ + public function setCreated($created) + { + $this->container['created'] = $created; + + return $this; + } + + /** + * Gets last_modified + * + * @return \DateTime|null + */ + public function getLastModified() + { + return $this->container['last_modified']; + } + + /** + * Sets last_modified + * + * @param \DateTime|null $last_modified Timestamp when the batch search was created + * + * @return self + */ + public function setLastModified($last_modified) + { + $this->container['last_modified'] = $last_modified; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status Status of the batch search + * + * @return self + */ + public function setStatus($status) + { + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($status) && !in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets error + * + * @return \Avalara\SDK\Model\EInvoicing\V1\ErrorResponse|null + */ + public function getError() + { + return $this->container['error']; + } + + /** + * Sets error + * + * @param \Avalara\SDK\Model\EInvoicing\V1\ErrorResponse|null $error error + * + * @return self + */ + public function setError($error) + { + $this->container['error'] = $error; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset):bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset):mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value):void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset):void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize():mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString():string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue():string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EInvoicing/V1/BatchSearchListResponse.php b/lib/Model/EInvoicing/V1/BatchSearchListResponse.php new file mode 100644 index 0000000..ae471c5 --- /dev/null +++ b/lib/Model/EInvoicing/V1/BatchSearchListResponse.php @@ -0,0 +1,393 @@ + + * @author Jonathan Wenger + * @copyright 2004-2025 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\SDK\Model\EInvoicing\V1; + +use \ArrayAccess; +use \Avalara\SDK\ObjectSerializer; +use \Avalara\SDK\Model\ModelInterface; +/** + * BatchSearchListResponse Class Doc Comment + * + * @category Class + * @description Schema for batch search list + * @package Avalara\SDK + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class BatchSearchListResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BatchSearchListResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'at_record_set_count' => 'int', + 'at_next_link' => 'string', + 'value' => '\Avalara\SDK\Model\EInvoicing\V1\BatchSearch[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'at_record_set_count' => 'int32', + 'at_next_link' => null, + 'value' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'at_record_set_count' => '@recordSetCount', + 'at_next_link' => '@nextLink', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'at_record_set_count' => 'setAtRecordSetCount', + 'at_next_link' => 'setAtNextLink', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'at_record_set_count' => 'getAtRecordSetCount', + 'at_next_link' => 'getAtNextLink', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['at_record_set_count'] = $data['at_record_set_count'] ?? null; + $this->container['at_next_link'] = $data['at_next_link'] ?? null; + $this->container['value'] = $data['value'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets at_record_set_count + * + * @return int|null + */ + public function getAtRecordSetCount() + { + return $this->container['at_record_set_count']; + } + + /** + * Sets at_record_set_count + * + * @param int|null $at_record_set_count The count of records in the result set + * + * @return self + */ + public function setAtRecordSetCount($at_record_set_count) + { + $this->container['at_record_set_count'] = $at_record_set_count; + + return $this; + } + + /** + * Gets at_next_link + * + * @return string|null + */ + public function getAtNextLink() + { + return $this->container['at_next_link']; + } + + /** + * Sets at_next_link + * + * @param string|null $at_next_link Next Link + * + * @return self + */ + public function setAtNextLink($at_next_link) + { + $this->container['at_next_link'] = $at_next_link; + + return $this; + } + + /** + * Gets value + * + * @return \Avalara\SDK\Model\EInvoicing\V1\BatchSearch[]|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param \Avalara\SDK\Model\EInvoicing\V1\BatchSearch[]|null $value value + * + * @return self + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset):bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset):mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value):void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset):void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize():mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString():string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue():string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EInvoicing/V1/ConditionalForField.php b/lib/Model/EInvoicing/V1/ConditionalForField.php index d389ebc..ad4ca75 100644 --- a/lib/Model/EInvoicing/V1/ConditionalForField.php +++ b/lib/Model/EInvoicing/V1/ConditionalForField.php @@ -13,7 +13,7 @@ /* * AvaTax Software Development Kit for PHP * - * (c) 2004-2022 Avalara, Inc. + * (c) 2004-2025 Avalara, Inc. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -26,9 +26,8 @@ * @package Avalara\SDK\API\EInvoicing\V1 * @author Sachin Baijal * @author Jonathan Wenger - * @copyright 2004-2022 Avalara, Inc. + * @copyright 2004-2025 Avalara, Inc. * @license https://www.apache.org/licenses/LICENSE-2.0 - * @version * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK */ diff --git a/lib/Model/EInvoicing/V1/DataInputField.php b/lib/Model/EInvoicing/V1/DataInputField.php index d04b20b..382e00d 100644 --- a/lib/Model/EInvoicing/V1/DataInputField.php +++ b/lib/Model/EInvoicing/V1/DataInputField.php @@ -13,7 +13,7 @@ /* * AvaTax Software Development Kit for PHP * - * (c) 2004-2022 Avalara, Inc. + * (c) 2004-2025 Avalara, Inc. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -26,9 +26,8 @@ * @package Avalara\SDK\API\EInvoicing\V1 * @author Sachin Baijal * @author Jonathan Wenger - * @copyright 2004-2022 Avalara, Inc. + * @copyright 2004-2025 Avalara, Inc. * @license https://www.apache.org/licenses/LICENSE-2.0 - * @version * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK */ @@ -77,7 +76,7 @@ class DataInputField implements ModelInterface, ArrayAccess, \JsonSerializable 'field_id' => 'string', 'applicable_document_roots' => 'object[]', 'path' => 'string', - 'name_space' => 'string', + 'namespace' => 'string', 'field_name' => 'string', 'example_or_fixed_value' => 'string', 'accepted_values' => 'object', @@ -102,7 +101,7 @@ class DataInputField implements ModelInterface, ArrayAccess, \JsonSerializable 'field_id' => null, 'applicable_document_roots' => null, 'path' => null, - 'name_space' => null, + 'namespace' => null, 'field_name' => null, 'example_or_fixed_value' => null, 'accepted_values' => null, @@ -146,7 +145,7 @@ public static function openAPIFormats() 'field_id' => 'fieldId', 'applicable_document_roots' => 'applicableDocumentRoots', 'path' => 'path', - 'name_space' => 'nameSpace', + 'namespace' => 'namespace', 'field_name' => 'fieldName', 'example_or_fixed_value' => 'exampleOrFixedValue', 'accepted_values' => 'acceptedValues', @@ -169,7 +168,7 @@ public static function openAPIFormats() 'field_id' => 'setFieldId', 'applicable_document_roots' => 'setApplicableDocumentRoots', 'path' => 'setPath', - 'name_space' => 'setNameSpace', + 'namespace' => 'setNamespace', 'field_name' => 'setFieldName', 'example_or_fixed_value' => 'setExampleOrFixedValue', 'accepted_values' => 'setAcceptedValues', @@ -192,7 +191,7 @@ public static function openAPIFormats() 'field_id' => 'getFieldId', 'applicable_document_roots' => 'getApplicableDocumentRoots', 'path' => 'getPath', - 'name_space' => 'getNameSpace', + 'namespace' => 'getNamespace', 'field_name' => 'getFieldName', 'example_or_fixed_value' => 'getExampleOrFixedValue', 'accepted_values' => 'getAcceptedValues', @@ -266,7 +265,7 @@ public function __construct(array $data = null) $this->container['field_id'] = $data['field_id'] ?? null; $this->container['applicable_document_roots'] = $data['applicable_document_roots'] ?? null; $this->container['path'] = $data['path'] ?? null; - $this->container['name_space'] = $data['name_space'] ?? null; + $this->container['namespace'] = $data['namespace'] ?? null; $this->container['field_name'] = $data['field_name'] ?? null; $this->container['example_or_fixed_value'] = $data['example_or_fixed_value'] ?? null; $this->container['accepted_values'] = $data['accepted_values'] ?? null; @@ -400,25 +399,25 @@ public function setPath($path) } /** - * Gets name_space + * Gets namespace * * @return string|null */ - public function getNameSpace() + public function getNamespace() { - return $this->container['name_space']; + return $this->container['namespace']; } /** - * Sets name_space + * Sets namespace * - * @param string|null $name_space Namespace of this field + * @param string|null $namespace Namespace of this field * * @return self */ - public function setNameSpace($name_space) + public function setNamespace($namespace) { - $this->container['name_space'] = $name_space; + $this->container['namespace'] = $namespace; return $this; } diff --git a/lib/Model/EInvoicing/V1/DataInputFieldNotUsedFor.php b/lib/Model/EInvoicing/V1/DataInputFieldNotUsedFor.php index ec227d8..b578c19 100644 --- a/lib/Model/EInvoicing/V1/DataInputFieldNotUsedFor.php +++ b/lib/Model/EInvoicing/V1/DataInputFieldNotUsedFor.php @@ -13,7 +13,7 @@ /* * AvaTax Software Development Kit for PHP * - * (c) 2004-2022 Avalara, Inc. + * (c) 2004-2025 Avalara, Inc. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -26,9 +26,8 @@ * @package Avalara\SDK\API\EInvoicing\V1 * @author Sachin Baijal * @author Jonathan Wenger - * @copyright 2004-2022 Avalara, Inc. + * @copyright 2004-2025 Avalara, Inc. * @license https://www.apache.org/licenses/LICENSE-2.0 - * @version * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK */ diff --git a/lib/Model/EInvoicing/V1/DataInputFieldOptionalFor.php b/lib/Model/EInvoicing/V1/DataInputFieldOptionalFor.php index ac50908..4c169cd 100644 --- a/lib/Model/EInvoicing/V1/DataInputFieldOptionalFor.php +++ b/lib/Model/EInvoicing/V1/DataInputFieldOptionalFor.php @@ -13,7 +13,7 @@ /* * AvaTax Software Development Kit for PHP * - * (c) 2004-2022 Avalara, Inc. + * (c) 2004-2025 Avalara, Inc. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -26,9 +26,8 @@ * @package Avalara\SDK\API\EInvoicing\V1 * @author Sachin Baijal * @author Jonathan Wenger - * @copyright 2004-2022 Avalara, Inc. + * @copyright 2004-2025 Avalara, Inc. * @license https://www.apache.org/licenses/LICENSE-2.0 - * @version * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK */ diff --git a/lib/Model/EInvoicing/V1/DataInputFieldRequiredFor.php b/lib/Model/EInvoicing/V1/DataInputFieldRequiredFor.php index c53a42e..c6b239c 100644 --- a/lib/Model/EInvoicing/V1/DataInputFieldRequiredFor.php +++ b/lib/Model/EInvoicing/V1/DataInputFieldRequiredFor.php @@ -13,7 +13,7 @@ /* * AvaTax Software Development Kit for PHP * - * (c) 2004-2022 Avalara, Inc. + * (c) 2004-2025 Avalara, Inc. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -26,9 +26,8 @@ * @package Avalara\SDK\API\EInvoicing\V1 * @author Sachin Baijal * @author Jonathan Wenger - * @copyright 2004-2022 Avalara, Inc. + * @copyright 2004-2025 Avalara, Inc. * @license https://www.apache.org/licenses/LICENSE-2.0 - * @version * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK */ diff --git a/lib/Model/EInvoicing/V1/DataInputFieldsResponse.php b/lib/Model/EInvoicing/V1/DataInputFieldsResponse.php index 6264460..f4cec87 100644 --- a/lib/Model/EInvoicing/V1/DataInputFieldsResponse.php +++ b/lib/Model/EInvoicing/V1/DataInputFieldsResponse.php @@ -13,7 +13,7 @@ /* * AvaTax Software Development Kit for PHP * - * (c) 2004-2022 Avalara, Inc. + * (c) 2004-2025 Avalara, Inc. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -26,9 +26,8 @@ * @package Avalara\SDK\API\EInvoicing\V1 * @author Sachin Baijal * @author Jonathan Wenger - * @copyright 2004-2022 Avalara, Inc. + * @copyright 2004-2025 Avalara, Inc. * @license https://www.apache.org/licenses/LICENSE-2.0 - * @version * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK */ @@ -72,7 +71,7 @@ class DataInputFieldsResponse implements ModelInterface, ArrayAccess, \JsonSeria * @var string[] */ protected static $openAPITypes = [ - 'at_record_set_count' => 'float', + 'at_recordset_count' => 'float', 'at_next_link' => 'string', 'value' => '\Avalara\SDK\Model\EInvoicing\V1\DataInputField[]' ]; @@ -85,7 +84,7 @@ class DataInputFieldsResponse implements ModelInterface, ArrayAccess, \JsonSeria * @psalm-var array */ protected static $openAPIFormats = [ - 'at_record_set_count' => null, + 'at_recordset_count' => null, 'at_next_link' => null, 'value' => null ]; @@ -117,7 +116,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'at_record_set_count' => '@recordSetCount', + 'at_recordset_count' => '@recordsetCount', 'at_next_link' => '@nextLink', 'value' => 'value' ]; @@ -128,7 +127,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'at_record_set_count' => 'setAtRecordSetCount', + 'at_recordset_count' => 'setAtRecordsetCount', 'at_next_link' => 'setAtNextLink', 'value' => 'setValue' ]; @@ -139,7 +138,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'at_record_set_count' => 'getAtRecordSetCount', + 'at_recordset_count' => 'getAtRecordsetCount', 'at_next_link' => 'getAtNextLink', 'value' => 'getValue' ]; @@ -201,7 +200,7 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['at_record_set_count'] = $data['at_record_set_count'] ?? null; + $this->container['at_recordset_count'] = $data['at_recordset_count'] ?? null; $this->container['at_next_link'] = $data['at_next_link'] ?? null; $this->container['value'] = $data['value'] ?? null; } @@ -231,25 +230,25 @@ public function valid() /** - * Gets at_record_set_count + * Gets at_recordset_count * * @return float|null */ - public function getAtRecordSetCount() + public function getAtRecordsetCount() { - return $this->container['at_record_set_count']; + return $this->container['at_recordset_count']; } /** - * Sets at_record_set_count + * Sets at_recordset_count * - * @param float|null $at_record_set_count Total count of results + * @param float|null $at_recordset_count Total count of results * * @return self */ - public function setAtRecordSetCount($at_record_set_count) + public function setAtRecordsetCount($at_recordset_count) { - $this->container['at_record_set_count'] = $at_record_set_count; + $this->container['at_recordset_count'] = $at_recordset_count; return $this; } diff --git a/lib/Model/EInvoicing/V1/DirectorySearchResponse.php b/lib/Model/EInvoicing/V1/DirectorySearchResponse.php new file mode 100644 index 0000000..d7b9444 --- /dev/null +++ b/lib/Model/EInvoicing/V1/DirectorySearchResponse.php @@ -0,0 +1,393 @@ + + * @author Jonathan Wenger + * @copyright 2004-2025 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\SDK\Model\EInvoicing\V1; + +use \ArrayAccess; +use \Avalara\SDK\ObjectSerializer; +use \Avalara\SDK\Model\ModelInterface; +/** + * DirectorySearchResponse Class Doc Comment + * + * @category Class + * @description Response schema for directory search results + * @package Avalara\SDK + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class DirectorySearchResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DirectorySearchResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'at_record_set_count' => 'int', + 'at_next_link' => 'string', + 'value' => '\Avalara\SDK\Model\EInvoicing\V1\DirectorySearchResponseValueInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'at_record_set_count' => 'int32', + 'at_next_link' => null, + 'value' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'at_record_set_count' => '@recordSetCount', + 'at_next_link' => '@nextLink', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'at_record_set_count' => 'setAtRecordSetCount', + 'at_next_link' => 'setAtNextLink', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'at_record_set_count' => 'getAtRecordSetCount', + 'at_next_link' => 'getAtNextLink', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['at_record_set_count'] = $data['at_record_set_count'] ?? null; + $this->container['at_next_link'] = $data['at_next_link'] ?? null; + $this->container['value'] = $data['value'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets at_record_set_count + * + * @return int|null + */ + public function getAtRecordSetCount() + { + return $this->container['at_record_set_count']; + } + + /** + * Sets at_record_set_count + * + * @param int|null $at_record_set_count The count of records in the result set + * + * @return self + */ + public function setAtRecordSetCount($at_record_set_count) + { + $this->container['at_record_set_count'] = $at_record_set_count; + + return $this; + } + + /** + * Gets at_next_link + * + * @return string|null + */ + public function getAtNextLink() + { + return $this->container['at_next_link']; + } + + /** + * Sets at_next_link + * + * @param string|null $at_next_link The next page link to get the next set of results. + * + * @return self + */ + public function setAtNextLink($at_next_link) + { + $this->container['at_next_link'] = $at_next_link; + + return $this; + } + + /** + * Gets value + * + * @return \Avalara\SDK\Model\EInvoicing\V1\DirectorySearchResponseValueInner[]|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param \Avalara\SDK\Model\EInvoicing\V1\DirectorySearchResponseValueInner[]|null $value value + * + * @return self + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset):bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset):mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value):void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset):void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize():mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString():string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue():string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EInvoicing/V1/DirectorySearchResponseValueInner.php b/lib/Model/EInvoicing/V1/DirectorySearchResponseValueInner.php new file mode 100644 index 0000000..dc6668a --- /dev/null +++ b/lib/Model/EInvoicing/V1/DirectorySearchResponseValueInner.php @@ -0,0 +1,512 @@ + + * @author Jonathan Wenger + * @copyright 2004-2025 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\SDK\Model\EInvoicing\V1; + +use \ArrayAccess; +use \Avalara\SDK\ObjectSerializer; +use \Avalara\SDK\Model\ModelInterface; +/** + * DirectorySearchResponseValueInner Class Doc Comment + * + * @category Class + * @package Avalara\SDK + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class DirectorySearchResponseValueInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DirectorySearchResponse_value_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'name' => 'string', + 'network' => 'string', + 'registration_date' => '\DateTime', + 'identifiers' => '\Avalara\SDK\Model\EInvoicing\V1\DirectorySearchResponseValueInnerIdentifiersInner[]', + 'addresses' => '\Avalara\SDK\Model\EInvoicing\V1\DirectorySearchResponseValueInnerAddressesInner[]', + 'supported_document_types' => '\Avalara\SDK\Model\EInvoicing\V1\DirectorySearchResponseValueInnerSupportedDocumentTypesInner[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'network' => null, + 'registration_date' => 'date', + 'identifiers' => null, + 'addresses' => null, + 'supported_document_types' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'network' => 'network', + 'registration_date' => 'registrationDate', + 'identifiers' => 'identifiers', + 'addresses' => 'addresses', + 'supported_document_types' => 'supportedDocumentTypes' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'network' => 'setNetwork', + 'registration_date' => 'setRegistrationDate', + 'identifiers' => 'setIdentifiers', + 'addresses' => 'setAddresses', + 'supported_document_types' => 'setSupportedDocumentTypes' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'network' => 'getNetwork', + 'registration_date' => 'getRegistrationDate', + 'identifiers' => 'getIdentifiers', + 'addresses' => 'getAddresses', + 'supported_document_types' => 'getSupportedDocumentTypes' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['network'] = $data['network'] ?? null; + $this->container['registration_date'] = $data['registration_date'] ?? null; + $this->container['identifiers'] = $data['identifiers'] ?? null; + $this->container['addresses'] = $data['addresses'] ?? null; + $this->container['supported_document_types'] = $data['supported_document_types'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Avalara unique ID of the participant in the directory. + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Name of the participant (typically, the name of the business entity). + * + * @return self + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets network + * + * @return string|null + */ + public function getNetwork() + { + return $this->container['network']; + } + + /** + * Sets network + * + * @param string|null $network The network where the participant is present. + * + * @return self + */ + public function setNetwork($network) + { + $this->container['network'] = $network; + + return $this; + } + + /** + * Gets registration_date + * + * @return \DateTime|null + */ + public function getRegistrationDate() + { + return $this->container['registration_date']; + } + + /** + * Sets registration_date + * + * @param \DateTime|null $registration_date Registration date of the participant if available + * + * @return self + */ + public function setRegistrationDate($registration_date) + { + $this->container['registration_date'] = $registration_date; + + return $this; + } + + /** + * Gets identifiers + * + * @return \Avalara\SDK\Model\EInvoicing\V1\DirectorySearchResponseValueInnerIdentifiersInner[]|null + */ + public function getIdentifiers() + { + return $this->container['identifiers']; + } + + /** + * Sets identifiers + * + * @param \Avalara\SDK\Model\EInvoicing\V1\DirectorySearchResponseValueInnerIdentifiersInner[]|null $identifiers identifiers + * + * @return self + */ + public function setIdentifiers($identifiers) + { + $this->container['identifiers'] = $identifiers; + + return $this; + } + + /** + * Gets addresses + * + * @return \Avalara\SDK\Model\EInvoicing\V1\DirectorySearchResponseValueInnerAddressesInner[]|null + */ + public function getAddresses() + { + return $this->container['addresses']; + } + + /** + * Sets addresses + * + * @param \Avalara\SDK\Model\EInvoicing\V1\DirectorySearchResponseValueInnerAddressesInner[]|null $addresses addresses + * + * @return self + */ + public function setAddresses($addresses) + { + $this->container['addresses'] = $addresses; + + return $this; + } + + /** + * Gets supported_document_types + * + * @return \Avalara\SDK\Model\EInvoicing\V1\DirectorySearchResponseValueInnerSupportedDocumentTypesInner[]|null + */ + public function getSupportedDocumentTypes() + { + return $this->container['supported_document_types']; + } + + /** + * Sets supported_document_types + * + * @param \Avalara\SDK\Model\EInvoicing\V1\DirectorySearchResponseValueInnerSupportedDocumentTypesInner[]|null $supported_document_types supported_document_types + * + * @return self + */ + public function setSupportedDocumentTypes($supported_document_types) + { + $this->container['supported_document_types'] = $supported_document_types; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset):bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset):mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value):void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset):void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize():mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString():string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue():string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EInvoicing/V1/DirectorySearchResponseValueInnerAddressesInner.php b/lib/Model/EInvoicing/V1/DirectorySearchResponseValueInnerAddressesInner.php new file mode 100644 index 0000000..ea03468 --- /dev/null +++ b/lib/Model/EInvoicing/V1/DirectorySearchResponseValueInnerAddressesInner.php @@ -0,0 +1,452 @@ + + * @author Jonathan Wenger + * @copyright 2004-2025 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\SDK\Model\EInvoicing\V1; + +use \ArrayAccess; +use \Avalara\SDK\ObjectSerializer; +use \Avalara\SDK\Model\ModelInterface; +/** + * DirectorySearchResponseValueInnerAddressesInner Class Doc Comment + * + * @category Class + * @package Avalara\SDK + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class DirectorySearchResponseValueInnerAddressesInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DirectorySearchResponse_value_inner_addresses_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'line1' => 'string', + 'line2' => 'string', + 'city' => 'string', + 'state' => 'string', + 'country' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'line1' => null, + 'line2' => null, + 'city' => null, + 'state' => null, + 'country' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'line1' => 'line1', + 'line2' => 'line2', + 'city' => 'city', + 'state' => 'state', + 'country' => 'country' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'line1' => 'setLine1', + 'line2' => 'setLine2', + 'city' => 'setCity', + 'state' => 'setState', + 'country' => 'setCountry' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'line1' => 'getLine1', + 'line2' => 'getLine2', + 'city' => 'getCity', + 'state' => 'getState', + 'country' => 'getCountry' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['line1'] = $data['line1'] ?? null; + $this->container['line2'] = $data['line2'] ?? null; + $this->container['city'] = $data['city'] ?? null; + $this->container['state'] = $data['state'] ?? null; + $this->container['country'] = $data['country'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets line1 + * + * @return string|null + */ + public function getLine1() + { + return $this->container['line1']; + } + + /** + * Sets line1 + * + * @param string|null $line1 Address line 1 + * + * @return self + */ + public function setLine1($line1) + { + $this->container['line1'] = $line1; + + return $this; + } + + /** + * Gets line2 + * + * @return string|null + */ + public function getLine2() + { + return $this->container['line2']; + } + + /** + * Sets line2 + * + * @param string|null $line2 Address line 2 + * + * @return self + */ + public function setLine2($line2) + { + $this->container['line2'] = $line2; + + return $this; + } + + /** + * Gets city + * + * @return string|null + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string|null $city City + * + * @return self + */ + public function setCity($city) + { + $this->container['city'] = $city; + + return $this; + } + + /** + * Gets state + * + * @return string|null + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param string|null $state State + * + * @return self + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + /** + * Gets country + * + * @return string|null + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string|null $country Country + * + * @return self + */ + public function setCountry($country) + { + $this->container['country'] = $country; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset):bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset):mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value):void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset):void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize():mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString():string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue():string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EInvoicing/V1/DirectorySearchResponseValueInnerIdentifiersInner.php b/lib/Model/EInvoicing/V1/DirectorySearchResponseValueInnerIdentifiersInner.php new file mode 100644 index 0000000..583be5c --- /dev/null +++ b/lib/Model/EInvoicing/V1/DirectorySearchResponseValueInnerIdentifiersInner.php @@ -0,0 +1,362 @@ + + * @author Jonathan Wenger + * @copyright 2004-2025 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\SDK\Model\EInvoicing\V1; + +use \ArrayAccess; +use \Avalara\SDK\ObjectSerializer; +use \Avalara\SDK\Model\ModelInterface; +/** + * DirectorySearchResponseValueInnerIdentifiersInner Class Doc Comment + * + * @category Class + * @package Avalara\SDK + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class DirectorySearchResponseValueInnerIdentifiersInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DirectorySearchResponse_value_inner_identifiers_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'value' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'value' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['value'] = $data['value'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Peppol Participant ID if the participant is in Peppol network + * + * @return self + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value Value of the identifier + * + * @return self + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset):bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset):mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value):void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset):void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize():mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString():string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue():string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EInvoicing/V1/DirectorySearchResponseValueInnerSupportedDocumentTypesInner.php b/lib/Model/EInvoicing/V1/DirectorySearchResponseValueInnerSupportedDocumentTypesInner.php new file mode 100644 index 0000000..2ebe172 --- /dev/null +++ b/lib/Model/EInvoicing/V1/DirectorySearchResponseValueInnerSupportedDocumentTypesInner.php @@ -0,0 +1,422 @@ + + * @author Jonathan Wenger + * @copyright 2004-2025 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\SDK\Model\EInvoicing\V1; + +use \ArrayAccess; +use \Avalara\SDK\ObjectSerializer; +use \Avalara\SDK\Model\ModelInterface; +/** + * DirectorySearchResponseValueInnerSupportedDocumentTypesInner Class Doc Comment + * + * @category Class + * @package Avalara\SDK + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class DirectorySearchResponseValueInnerSupportedDocumentTypesInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DirectorySearchResponse_value_inner_supportedDocumentTypes_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'value' => 'string', + 'supported_by_trading_partner' => 'bool', + 'supported_by_avalara' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'value' => null, + 'supported_by_trading_partner' => null, + 'supported_by_avalara' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'value' => 'value', + 'supported_by_trading_partner' => 'supportedByTradingPartner', + 'supported_by_avalara' => 'supportedByAvalara' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'value' => 'setValue', + 'supported_by_trading_partner' => 'setSupportedByTradingPartner', + 'supported_by_avalara' => 'setSupportedByAvalara' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'value' => 'getValue', + 'supported_by_trading_partner' => 'getSupportedByTradingPartner', + 'supported_by_avalara' => 'getSupportedByAvalara' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['value'] = $data['value'] ?? null; + $this->container['supported_by_trading_partner'] = $data['supported_by_trading_partner'] ?? null; + $this->container['supported_by_avalara'] = $data['supported_by_avalara'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Document type name. + * + * @return self + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value Document type identifier. + * + * @return self + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets supported_by_trading_partner + * + * @return bool|null + */ + public function getSupportedByTradingPartner() + { + return $this->container['supported_by_trading_partner']; + } + + /** + * Sets supported_by_trading_partner + * + * @param bool|null $supported_by_trading_partner Does trading partner support receiving this document type + * + * @return self + */ + public function setSupportedByTradingPartner($supported_by_trading_partner) + { + $this->container['supported_by_trading_partner'] = $supported_by_trading_partner; + + return $this; + } + + /** + * Gets supported_by_avalara + * + * @return bool|null + */ + public function getSupportedByAvalara() + { + return $this->container['supported_by_avalara']; + } + + /** + * Sets supported_by_avalara + * + * @param bool|null $supported_by_avalara Does avalara support exchanging this document type + * + * @return self + */ + public function setSupportedByAvalara($supported_by_avalara) + { + $this->container['supported_by_avalara'] = $supported_by_avalara; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset):bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset):mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value):void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset):void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize():mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString():string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue():string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EInvoicing/V1/DocumentFetch.php b/lib/Model/EInvoicing/V1/DocumentFetch.php new file mode 100644 index 0000000..103c8d0 --- /dev/null +++ b/lib/Model/EInvoicing/V1/DocumentFetch.php @@ -0,0 +1,392 @@ + + * @author Jonathan Wenger + * @copyright 2004-2025 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\SDK\Model\EInvoicing\V1; + +use \ArrayAccess; +use \Avalara\SDK\ObjectSerializer; +use \Avalara\SDK\Model\ModelInterface; +/** + * DocumentFetch Class Doc Comment + * + * @category Class + * @package Avalara\SDK + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class DocumentFetch implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'documentFetch'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'status' => 'string', + 'event_date_time' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'status' => null, + 'event_date_time' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'status' => 'status', + 'event_date_time' => 'eventDateTime' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'status' => 'setStatus', + 'event_date_time' => 'setEventDateTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'status' => 'getStatus', + 'event_date_time' => 'getEventDateTime' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = $data['id'] ?? null; + $this->container['status'] = $data['status'] ?? null; + $this->container['event_date_time'] = $data['event_date_time'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id Unique ID for this document that can be used for status checking and file downloads. This is a UID created by the Avalara E-Invoicing platform. + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status Status of the document + * + * @return self + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets event_date_time + * + * @return string|null + */ + public function getEventDateTime() + { + return $this->container['event_date_time']; + } + + /** + * Sets event_date_time + * + * @param string|null $event_date_time The date and time when the inbound document was accepted by the Avalara E-Invoicing Platform + * + * @return self + */ + public function setEventDateTime($event_date_time) + { + $this->container['event_date_time'] = $event_date_time; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset):bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset):mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value):void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset):void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize():mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString():string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue():string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EInvoicing/V1/DocumentFetchRequest.php b/lib/Model/EInvoicing/V1/DocumentFetchRequest.php new file mode 100644 index 0000000..859ae77 --- /dev/null +++ b/lib/Model/EInvoicing/V1/DocumentFetchRequest.php @@ -0,0 +1,362 @@ + + * @author Jonathan Wenger + * @copyright 2004-2025 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\SDK\Model\EInvoicing\V1; + +use \ArrayAccess; +use \Avalara\SDK\ObjectSerializer; +use \Avalara\SDK\Model\ModelInterface; +/** + * DocumentFetchRequest Class Doc Comment + * + * @category Class + * @package Avalara\SDK + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class DocumentFetchRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DocumentFetchRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\Avalara\SDK\Model\EInvoicing\V1\DocumentFetchRequestDataInner[]', + 'metadata' => '\Avalara\SDK\Model\EInvoicing\V1\DocumentFetchRequestMetadata' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'metadata' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'metadata' => 'metadata' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'metadata' => 'setMetadata' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'metadata' => 'getMetadata' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + $this->container['metadata'] = $data['metadata'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Avalara\SDK\Model\EInvoicing\V1\DocumentFetchRequestDataInner[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Avalara\SDK\Model\EInvoicing\V1\DocumentFetchRequestDataInner[]|null $data Array of key-value pairs used to retrieve inbound documents from the Tax Authority + * + * @return self + */ + public function setData($data) + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets metadata + * + * @return \Avalara\SDK\Model\EInvoicing\V1\DocumentFetchRequestMetadata|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param \Avalara\SDK\Model\EInvoicing\V1\DocumentFetchRequestMetadata|null $metadata metadata + * + * @return self + */ + public function setMetadata($metadata) + { + $this->container['metadata'] = $metadata; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset):bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset):mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value):void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset):void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize():mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString():string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue():string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EInvoicing/V1/DocumentFetchRequestDataInner.php b/lib/Model/EInvoicing/V1/DocumentFetchRequestDataInner.php new file mode 100644 index 0000000..82c1ce1 --- /dev/null +++ b/lib/Model/EInvoicing/V1/DocumentFetchRequestDataInner.php @@ -0,0 +1,368 @@ + + * @author Jonathan Wenger + * @copyright 2004-2025 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\SDK\Model\EInvoicing\V1; + +use \ArrayAccess; +use \Avalara\SDK\ObjectSerializer; +use \Avalara\SDK\Model\ModelInterface; +/** + * DocumentFetchRequestDataInner Class Doc Comment + * + * @category Class + * @package Avalara\SDK + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class DocumentFetchRequestDataInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DocumentFetchRequest_data_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'key' => 'string', + 'value' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'key' => 'string', + 'value' => 'string' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'key' => 'key', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'key' => 'setKey', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'key' => 'getKey', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['key'] = $data['key'] ?? null; + $this->container['value'] = $data['value'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['key'] === null) { + $invalidProperties[] = "'key' can't be null"; + } + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets key + * + * @return string + */ + public function getKey() + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param string $key Descriptor of the identifier + * + * @return self + */ + public function setKey($key) + { + $this->container['key'] = $key; + + return $this; + } + + /** + * Gets value + * + * @return string + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string $value Value of the identifier + * + * @return self + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset):bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset):mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value):void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset):void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize():mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString():string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue():string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EInvoicing/V1/DocumentFetchRequestMetadata.php b/lib/Model/EInvoicing/V1/DocumentFetchRequestMetadata.php new file mode 100644 index 0000000..81267a5 --- /dev/null +++ b/lib/Model/EInvoicing/V1/DocumentFetchRequestMetadata.php @@ -0,0 +1,467 @@ + + * @author Jonathan Wenger + * @copyright 2004-2025 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\SDK\Model\EInvoicing\V1; + +use \ArrayAccess; +use \Avalara\SDK\ObjectSerializer; +use \Avalara\SDK\Model\ModelInterface; +/** + * DocumentFetchRequestMetadata Class Doc Comment + * + * @category Class + * @package Avalara\SDK + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class DocumentFetchRequestMetadata implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DocumentFetchRequest_metadata'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'workflow_id' => 'string', + 'data_format' => 'string', + 'data_format_version' => 'float', + 'country_code' => 'string', + 'country_mandate' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'workflow_id' => 'string', + 'data_format' => 'string', + 'data_format_version' => 'number', + 'country_code' => 'string', + 'country_mandate' => 'string' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'workflow_id' => 'workflowId', + 'data_format' => 'dataFormat', + 'data_format_version' => 'dataFormatVersion', + 'country_code' => 'countryCode', + 'country_mandate' => 'countryMandate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'workflow_id' => 'setWorkflowId', + 'data_format' => 'setDataFormat', + 'data_format_version' => 'setDataFormatVersion', + 'country_code' => 'setCountryCode', + 'country_mandate' => 'setCountryMandate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'workflow_id' => 'getWorkflowId', + 'data_format' => 'getDataFormat', + 'data_format_version' => 'getDataFormatVersion', + 'country_code' => 'getCountryCode', + 'country_mandate' => 'getCountryMandate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['workflow_id'] = $data['workflow_id'] ?? null; + $this->container['data_format'] = $data['data_format'] ?? null; + $this->container['data_format_version'] = $data['data_format_version'] ?? null; + $this->container['country_code'] = $data['country_code'] ?? null; + $this->container['country_mandate'] = $data['country_mandate'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['workflow_id'] === null) { + $invalidProperties[] = "'workflow_id' can't be null"; + } + if ($this->container['data_format'] === null) { + $invalidProperties[] = "'data_format' can't be null"; + } + if ($this->container['data_format_version'] === null) { + $invalidProperties[] = "'data_format_version' can't be null"; + } + if ($this->container['country_code'] === null) { + $invalidProperties[] = "'country_code' can't be null"; + } + if ($this->container['country_mandate'] === null) { + $invalidProperties[] = "'country_mandate' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets workflow_id + * + * @return string + */ + public function getWorkflowId() + { + return $this->container['workflow_id']; + } + + /** + * Sets workflow_id + * + * @param string $workflow_id Specifies a unique ID for this workflow. + * + * @return self + */ + public function setWorkflowId($workflow_id) + { + $this->container['workflow_id'] = $workflow_id; + + return $this; + } + + /** + * Gets data_format + * + * @return string + */ + public function getDataFormat() + { + return $this->container['data_format']; + } + + /** + * Sets data_format + * + * @param string $data_format Specifies the data format for this workflow + * + * @return self + */ + public function setDataFormat($data_format) + { + $this->container['data_format'] = $data_format; + + return $this; + } + + /** + * Gets data_format_version + * + * @return float + */ + public function getDataFormatVersion() + { + return $this->container['data_format_version']; + } + + /** + * Sets data_format_version + * + * @param float $data_format_version Specifies the data format version number + * + * @return self + */ + public function setDataFormatVersion($data_format_version) + { + $this->container['data_format_version'] = $data_format_version; + + return $this; + } + + /** + * Gets country_code + * + * @return string + */ + public function getCountryCode() + { + return $this->container['country_code']; + } + + /** + * Sets country_code + * + * @param string $country_code The two-letter ISO-3166 country code for the country for which document is being retrieved + * + * @return self + */ + public function setCountryCode($country_code) + { + $this->container['country_code'] = $country_code; + + return $this; + } + + /** + * Gets country_mandate + * + * @return string + */ + public function getCountryMandate() + { + return $this->container['country_mandate']; + } + + /** + * Sets country_mandate + * + * @param string $country_mandate The e-invoicing mandate for the specified country + * + * @return self + */ + public function setCountryMandate($country_mandate) + { + $this->container['country_mandate'] = $country_mandate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset):bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset):mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value):void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset):void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize():mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString():string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue():string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EInvoicing/V1/DocumentListResponse.php b/lib/Model/EInvoicing/V1/DocumentListResponse.php index 566ee17..8a0255b 100644 --- a/lib/Model/EInvoicing/V1/DocumentListResponse.php +++ b/lib/Model/EInvoicing/V1/DocumentListResponse.php @@ -13,7 +13,7 @@ /* * AvaTax Software Development Kit for PHP * - * (c) 2004-2022 Avalara, Inc. + * (c) 2004-2025 Avalara, Inc. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -26,9 +26,8 @@ * @package Avalara\SDK\API\EInvoicing\V1 * @author Sachin Baijal * @author Jonathan Wenger - * @copyright 2004-2022 Avalara, Inc. + * @copyright 2004-2025 Avalara, Inc. * @license https://www.apache.org/licenses/LICENSE-2.0 - * @version * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK */ @@ -73,7 +72,7 @@ class DocumentListResponse implements ModelInterface, ArrayAccess, \JsonSerializ * @var string[] */ protected static $openAPITypes = [ - 'at_record_set_count' => 'string', + 'at_recordset_count' => 'string', 'at_next_link' => 'string', 'value' => '\Avalara\SDK\Model\EInvoicing\V1\DocumentSummary[]' ]; @@ -86,7 +85,7 @@ class DocumentListResponse implements ModelInterface, ArrayAccess, \JsonSerializ * @psalm-var array */ protected static $openAPIFormats = [ - 'at_record_set_count' => null, + 'at_recordset_count' => null, 'at_next_link' => null, 'value' => null ]; @@ -118,7 +117,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'at_record_set_count' => '@recordSetCount', + 'at_recordset_count' => '@recordsetCount', 'at_next_link' => '@nextLink', 'value' => 'value' ]; @@ -129,7 +128,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'at_record_set_count' => 'setAtRecordSetCount', + 'at_recordset_count' => 'setAtRecordsetCount', 'at_next_link' => 'setAtNextLink', 'value' => 'setValue' ]; @@ -140,7 +139,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'at_record_set_count' => 'getAtRecordSetCount', + 'at_recordset_count' => 'getAtRecordsetCount', 'at_next_link' => 'getAtNextLink', 'value' => 'getValue' ]; @@ -202,7 +201,7 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['at_record_set_count'] = $data['at_record_set_count'] ?? null; + $this->container['at_recordset_count'] = $data['at_recordset_count'] ?? null; $this->container['at_next_link'] = $data['at_next_link'] ?? null; $this->container['value'] = $data['value'] ?? null; } @@ -235,25 +234,25 @@ public function valid() /** - * Gets at_record_set_count + * Gets at_recordset_count * * @return string|null */ - public function getAtRecordSetCount() + public function getAtRecordsetCount() { - return $this->container['at_record_set_count']; + return $this->container['at_recordset_count']; } /** - * Sets at_record_set_count + * Sets at_recordset_count * - * @param string|null $at_record_set_count Count of collections for the given date range + * @param string|null $at_recordset_count Count of collections for the given date range * * @return self */ - public function setAtRecordSetCount($at_record_set_count) + public function setAtRecordsetCount($at_recordset_count) { - $this->container['at_record_set_count'] = $at_record_set_count; + $this->container['at_recordset_count'] = $at_recordset_count; return $this; } @@ -295,7 +294,7 @@ public function getValue() /** * Sets value * - * @param \Avalara\SDK\Model\EInvoicing\V1\DocumentSummary[] $value Array of invoices matching query parameters + * @param \Avalara\SDK\Model\EInvoicing\V1\DocumentSummary[] $value Array of documents matching query parameters * * @return self */ diff --git a/lib/Model/EInvoicing/V1/DocumentStatusResponse.php b/lib/Model/EInvoicing/V1/DocumentStatusResponse.php index f9a21cb..b7ba7c3 100644 --- a/lib/Model/EInvoicing/V1/DocumentStatusResponse.php +++ b/lib/Model/EInvoicing/V1/DocumentStatusResponse.php @@ -13,7 +13,7 @@ /* * AvaTax Software Development Kit for PHP * - * (c) 2004-2022 Avalara, Inc. + * (c) 2004-2025 Avalara, Inc. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -26,9 +26,8 @@ * @package Avalara\SDK\API\EInvoicing\V1 * @author Sachin Baijal * @author Jonathan Wenger - * @copyright 2004-2022 Avalara, Inc. + * @copyright 2004-2025 Avalara, Inc. * @license https://www.apache.org/licenses/LICENSE-2.0 - * @version * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK */ @@ -268,7 +267,7 @@ public function getStatus() /** * Sets status * - * @param string|null $status Status of the transaction:
'Pending'
'Failed'
'Complete' + * @param string|null $status Status of the document * * @return self */ diff --git a/lib/Model/EInvoicing/V1/DocumentSubmissionError.php b/lib/Model/EInvoicing/V1/DocumentSubmissionError.php index a5b8606..27755bf 100644 --- a/lib/Model/EInvoicing/V1/DocumentSubmissionError.php +++ b/lib/Model/EInvoicing/V1/DocumentSubmissionError.php @@ -13,7 +13,7 @@ /* * AvaTax Software Development Kit for PHP * - * (c) 2004-2022 Avalara, Inc. + * (c) 2004-2025 Avalara, Inc. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -26,9 +26,8 @@ * @package Avalara\SDK\API\EInvoicing\V1 * @author Sachin Baijal * @author Jonathan Wenger - * @copyright 2004-2022 Avalara, Inc. + * @copyright 2004-2025 Avalara, Inc. * @license https://www.apache.org/licenses/LICENSE-2.0 - * @version * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK */ diff --git a/lib/Model/EInvoicing/V1/DocumentSubmitResponse.php b/lib/Model/EInvoicing/V1/DocumentSubmitResponse.php index 183280e..fb25b58 100644 --- a/lib/Model/EInvoicing/V1/DocumentSubmitResponse.php +++ b/lib/Model/EInvoicing/V1/DocumentSubmitResponse.php @@ -13,7 +13,7 @@ /* * AvaTax Software Development Kit for PHP * - * (c) 2004-2022 Avalara, Inc. + * (c) 2004-2025 Avalara, Inc. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -26,9 +26,8 @@ * @package Avalara\SDK\API\EInvoicing\V1 * @author Sachin Baijal * @author Jonathan Wenger - * @copyright 2004-2022 Avalara, Inc. + * @copyright 2004-2025 Avalara, Inc. * @license https://www.apache.org/licenses/LICENSE-2.0 - * @version * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK */ diff --git a/lib/Model/EInvoicing/V1/DocumentSummary.php b/lib/Model/EInvoicing/V1/DocumentSummary.php index c62838b..c5459f8 100644 --- a/lib/Model/EInvoicing/V1/DocumentSummary.php +++ b/lib/Model/EInvoicing/V1/DocumentSummary.php @@ -13,7 +13,7 @@ /* * AvaTax Software Development Kit for PHP * - * (c) 2004-2022 Avalara, Inc. + * (c) 2004-2025 Avalara, Inc. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -26,9 +26,8 @@ * @package Avalara\SDK\API\EInvoicing\V1 * @author Sachin Baijal * @author Jonathan Wenger - * @copyright 2004-2022 Avalara, Inc. + * @copyright 2004-2025 Avalara, Inc. * @license https://www.apache.org/licenses/LICENSE-2.0 - * @version * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK */ @@ -78,6 +77,8 @@ class DocumentSummary implements ModelInterface, ArrayAccess, \JsonSerializable 'status' => 'string', 'supplier_name' => 'string', 'customer_name' => 'string', + 'document_type' => 'string', + 'document_version' => 'string', 'document_number' => 'string', 'document_date' => 'string', 'flow' => 'string', @@ -100,6 +101,8 @@ class DocumentSummary implements ModelInterface, ArrayAccess, \JsonSerializable 'status' => null, 'supplier_name' => null, 'customer_name' => null, + 'document_type' => null, + 'document_version' => null, 'document_number' => null, 'document_date' => null, 'flow' => null, @@ -141,6 +144,8 @@ public static function openAPIFormats() 'status' => 'status', 'supplier_name' => 'supplierName', 'customer_name' => 'customerName', + 'document_type' => 'documentType', + 'document_version' => 'documentVersion', 'document_number' => 'documentNumber', 'document_date' => 'documentDate', 'flow' => 'flow', @@ -161,6 +166,8 @@ public static function openAPIFormats() 'status' => 'setStatus', 'supplier_name' => 'setSupplierName', 'customer_name' => 'setCustomerName', + 'document_type' => 'setDocumentType', + 'document_version' => 'setDocumentVersion', 'document_number' => 'setDocumentNumber', 'document_date' => 'setDocumentDate', 'flow' => 'setFlow', @@ -181,6 +188,8 @@ public static function openAPIFormats() 'status' => 'getStatus', 'supplier_name' => 'getSupplierName', 'customer_name' => 'getCustomerName', + 'document_type' => 'getDocumentType', + 'document_version' => 'getDocumentVersion', 'document_number' => 'getDocumentNumber', 'document_date' => 'getDocumentDate', 'flow' => 'getFlow', @@ -252,6 +261,8 @@ public function __construct(array $data = null) $this->container['status'] = $data['status'] ?? null; $this->container['supplier_name'] = $data['supplier_name'] ?? null; $this->container['customer_name'] = $data['customer_name'] ?? null; + $this->container['document_type'] = $data['document_type'] ?? null; + $this->container['document_version'] = $data['document_version'] ?? null; $this->container['document_number'] = $data['document_number'] ?? null; $this->container['document_date'] = $data['document_date'] ?? null; $this->container['flow'] = $data['flow'] ?? null; @@ -346,7 +357,7 @@ public function getStatus() /** * Sets status * - * @param string|null $status The transaction status:
'Pending'
'Failed'
'Complete' + * @param string|null $status The Document status * * @return self */ @@ -405,6 +416,54 @@ public function setCustomerName($customer_name) return $this; } + /** + * Gets document_type + * + * @return string|null + */ + public function getDocumentType() + { + return $this->container['document_type']; + } + + /** + * Sets document_type + * + * @param string|null $document_type The document type + * + * @return self + */ + public function setDocumentType($document_type) + { + $this->container['document_type'] = $document_type; + + return $this; + } + + /** + * Gets document_version + * + * @return string|null + */ + public function getDocumentVersion() + { + return $this->container['document_version']; + } + + /** + * Sets document_version + * + * @param string|null $document_version The document version + * + * @return self + */ + public function setDocumentVersion($document_version) + { + $this->container['document_version'] = $document_version; + + return $this; + } + /** * Gets document_number * @@ -418,7 +477,7 @@ public function getDocumentNumber() /** * Sets document_number * - * @param string|null $document_number The invoice document number + * @param string|null $document_number The document number * * @return self */ @@ -442,7 +501,7 @@ public function getDocumentDate() /** * Sets document_date * - * @param string|null $document_date The invoice issue date + * @param string|null $document_date The document issue date * * @return self */ @@ -466,7 +525,7 @@ public function getFlow() /** * Sets flow * - * @param string|null $flow The invoice direction, where issued = `out` and received = `in` + * @param string|null $flow The document direction, where issued = `out` and received = `in` * * @return self */ @@ -490,7 +549,7 @@ public function getCountryCode() /** * Sets country_code * - * @param string|null $country_code The two-letter ISO-3166 country code for the country where the e-invoice is being submitted + * @param string|null $country_code The two-letter ISO-3166 country code for the country where the document is being submitted * * @return self */ @@ -538,7 +597,7 @@ public function getInterface() /** * Sets interface * - * @param string|null $interface The interface where the invoice data is sent + * @param string|null $interface The interface where the document is sent * * @return self */ @@ -562,7 +621,7 @@ public function getReceiver() /** * Sets receiver * - * @param string|null $receiver The invoice recipient based on the interface + * @param string|null $receiver The document recipient based on the interface * * @return self */ diff --git a/lib/Model/EInvoicing/V1/ErrorResponse.php b/lib/Model/EInvoicing/V1/ErrorResponse.php new file mode 100644 index 0000000..7f07c5c --- /dev/null +++ b/lib/Model/EInvoicing/V1/ErrorResponse.php @@ -0,0 +1,422 @@ + + * @author Jonathan Wenger + * @copyright 2004-2025 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\SDK\Model\EInvoicing\V1; + +use \ArrayAccess; +use \Avalara\SDK\ObjectSerializer; +use \Avalara\SDK\Model\ModelInterface; +/** + * ErrorResponse Class Doc Comment + * + * @category Class + * @package Avalara\SDK + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class ErrorResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ErrorResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'title' => 'string', + 'status' => 'string', + 'detail' => 'string', + 'instance' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'title' => null, + 'status' => null, + 'detail' => null, + 'instance' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'title' => 'title', + 'status' => 'status', + 'detail' => 'detail', + 'instance' => 'instance' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'title' => 'setTitle', + 'status' => 'setStatus', + 'detail' => 'setDetail', + 'instance' => 'setInstance' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'title' => 'getTitle', + 'status' => 'getStatus', + 'detail' => 'getDetail', + 'instance' => 'getInstance' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['title'] = $data['title'] ?? null; + $this->container['status'] = $data['status'] ?? null; + $this->container['detail'] = $data['detail'] ?? null; + $this->container['instance'] = $data['instance'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets title + * + * @return string|null + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title title + * + * @return self + */ + public function setTitle($title) + { + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status status + * + * @return self + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets detail + * + * @return string|null + */ + public function getDetail() + { + return $this->container['detail']; + } + + /** + * Sets detail + * + * @param string|null $detail detail + * + * @return self + */ + public function setDetail($detail) + { + $this->container['detail'] = $detail; + + return $this; + } + + /** + * Gets instance + * + * @return string|null + */ + public function getInstance() + { + return $this->container['instance']; + } + + /** + * Sets instance + * + * @param string|null $instance instance + * + * @return self + */ + public function setInstance($instance) + { + $this->container['instance'] = $instance; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset):bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset):mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value):void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset):void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize():mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString():string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue():string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EInvoicing/V1/FetchDocumentsRequest.php b/lib/Model/EInvoicing/V1/FetchDocumentsRequest.php new file mode 100644 index 0000000..e6f2ec2 --- /dev/null +++ b/lib/Model/EInvoicing/V1/FetchDocumentsRequest.php @@ -0,0 +1,363 @@ + + * @author Jonathan Wenger + * @copyright 2004-2022 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @version + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\\SDK\Model\\EInvoicing\\V1; + +use \ArrayAccess; +use \Avalara\\SDK\ObjectSerializer; +use \Avalara\\SDK\Model\ModelInterface; +/** + * FetchDocumentsRequest Class Doc Comment + * + * @category Class + * @package Avalara\\SDK + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class FetchDocumentsRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FetchDocuments_request'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\Avalara\\SDK\Model\\EInvoicing\\V1\FetchDocumentsRequestDataInner[]', + 'metadata' => '\Avalara\\SDK\Model\\EInvoicing\\V1\FetchDocumentsRequestMetadata' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'metadata' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'metadata' => 'metadata' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'metadata' => 'setMetadata' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'metadata' => 'getMetadata' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['data'] = $data['data'] ?? null; + $this->container['metadata'] = $data['metadata'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \Avalara\\SDK\Model\\EInvoicing\\V1\FetchDocumentsRequestDataInner[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Avalara\\SDK\Model\\EInvoicing\\V1\FetchDocumentsRequestDataInner[]|null $data Array of key-value pairs used to retrieve inbound documents from the Tax Authority + * + * @return self + */ + public function setData($data) + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets metadata + * + * @return \Avalara\\SDK\Model\\EInvoicing\\V1\FetchDocumentsRequestMetadata|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param \Avalara\\SDK\Model\\EInvoicing\\V1\FetchDocumentsRequestMetadata|null $metadata metadata + * + * @return self + */ + public function setMetadata($metadata) + { + $this->container['metadata'] = $metadata; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset):bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset):mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value):void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset):void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize():mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString():string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue():string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EInvoicing/V1/FetchDocumentsRequestDataInner.php b/lib/Model/EInvoicing/V1/FetchDocumentsRequestDataInner.php new file mode 100644 index 0000000..40242b6 --- /dev/null +++ b/lib/Model/EInvoicing/V1/FetchDocumentsRequestDataInner.php @@ -0,0 +1,369 @@ + + * @author Jonathan Wenger + * @copyright 2004-2022 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @version + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\\SDK\Model\\EInvoicing\\V1; + +use \ArrayAccess; +use \Avalara\\SDK\ObjectSerializer; +use \Avalara\\SDK\Model\ModelInterface; +/** + * FetchDocumentsRequestDataInner Class Doc Comment + * + * @category Class + * @package Avalara\\SDK + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class FetchDocumentsRequestDataInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FetchDocuments_request_data_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'key' => 'string', + 'value' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'key' => 'string', + 'value' => 'string' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'key' => 'key', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'key' => 'setKey', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'key' => 'getKey', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['key'] = $data['key'] ?? null; + $this->container['value'] = $data['value'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['key'] === null) { + $invalidProperties[] = "'key' can't be null"; + } + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets key + * + * @return string + */ + public function getKey() + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param string $key Descriptor of the identifier + * + * @return self + */ + public function setKey($key) + { + $this->container['key'] = $key; + + return $this; + } + + /** + * Gets value + * + * @return string + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string $value Value of the identifier + * + * @return self + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset):bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset):mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value):void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset):void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize():mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString():string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue():string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EInvoicing/V1/FetchDocumentsRequestMetadata.php b/lib/Model/EInvoicing/V1/FetchDocumentsRequestMetadata.php new file mode 100644 index 0000000..8a82afe --- /dev/null +++ b/lib/Model/EInvoicing/V1/FetchDocumentsRequestMetadata.php @@ -0,0 +1,468 @@ + + * @author Jonathan Wenger + * @copyright 2004-2022 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @version + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\\SDK\Model\\EInvoicing\\V1; + +use \ArrayAccess; +use \Avalara\\SDK\ObjectSerializer; +use \Avalara\\SDK\Model\ModelInterface; +/** + * FetchDocumentsRequestMetadata Class Doc Comment + * + * @category Class + * @package Avalara\\SDK + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class FetchDocumentsRequestMetadata implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FetchDocuments_request_metadata'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'workflow_id' => 'string', + 'data_format' => 'string', + 'data_format_version' => 'float', + 'country_code' => 'string', + 'country_mandate' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'workflow_id' => 'string', + 'data_format' => 'string', + 'data_format_version' => 'number', + 'country_code' => 'string', + 'country_mandate' => 'string' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'workflow_id' => 'workflowId', + 'data_format' => 'dataFormat', + 'data_format_version' => 'dataFormatVersion', + 'country_code' => 'countryCode', + 'country_mandate' => 'countryMandate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'workflow_id' => 'setWorkflowId', + 'data_format' => 'setDataFormat', + 'data_format_version' => 'setDataFormatVersion', + 'country_code' => 'setCountryCode', + 'country_mandate' => 'setCountryMandate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'workflow_id' => 'getWorkflowId', + 'data_format' => 'getDataFormat', + 'data_format_version' => 'getDataFormatVersion', + 'country_code' => 'getCountryCode', + 'country_mandate' => 'getCountryMandate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['workflow_id'] = $data['workflow_id'] ?? null; + $this->container['data_format'] = $data['data_format'] ?? null; + $this->container['data_format_version'] = $data['data_format_version'] ?? null; + $this->container['country_code'] = $data['country_code'] ?? null; + $this->container['country_mandate'] = $data['country_mandate'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['workflow_id'] === null) { + $invalidProperties[] = "'workflow_id' can't be null"; + } + if ($this->container['data_format'] === null) { + $invalidProperties[] = "'data_format' can't be null"; + } + if ($this->container['data_format_version'] === null) { + $invalidProperties[] = "'data_format_version' can't be null"; + } + if ($this->container['country_code'] === null) { + $invalidProperties[] = "'country_code' can't be null"; + } + if ($this->container['country_mandate'] === null) { + $invalidProperties[] = "'country_mandate' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets workflow_id + * + * @return string + */ + public function getWorkflowId() + { + return $this->container['workflow_id']; + } + + /** + * Sets workflow_id + * + * @param string $workflow_id Specifies a unique ID for this workflow. + * + * @return self + */ + public function setWorkflowId($workflow_id) + { + $this->container['workflow_id'] = $workflow_id; + + return $this; + } + + /** + * Gets data_format + * + * @return string + */ + public function getDataFormat() + { + return $this->container['data_format']; + } + + /** + * Sets data_format + * + * @param string $data_format Specifies the data format for this workflow + * + * @return self + */ + public function setDataFormat($data_format) + { + $this->container['data_format'] = $data_format; + + return $this; + } + + /** + * Gets data_format_version + * + * @return float + */ + public function getDataFormatVersion() + { + return $this->container['data_format_version']; + } + + /** + * Sets data_format_version + * + * @param float $data_format_version Specifies the data format version number + * + * @return self + */ + public function setDataFormatVersion($data_format_version) + { + $this->container['data_format_version'] = $data_format_version; + + return $this; + } + + /** + * Gets country_code + * + * @return string + */ + public function getCountryCode() + { + return $this->container['country_code']; + } + + /** + * Sets country_code + * + * @param string $country_code The two-letter ISO-3166 country code for the country for which document is being retrieved + * + * @return self + */ + public function setCountryCode($country_code) + { + $this->container['country_code'] = $country_code; + + return $this; + } + + /** + * Gets country_mandate + * + * @return string + */ + public function getCountryMandate() + { + return $this->container['country_mandate']; + } + + /** + * Sets country_mandate + * + * @param string $country_mandate The e-invoicing mandate for the specified country + * + * @return self + */ + public function setCountryMandate($country_mandate) + { + $this->container['country_mandate'] = $country_mandate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset):bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset):mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value):void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset):void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize():mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString():string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue():string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EInvoicing/V1/ForbiddenError.php b/lib/Model/EInvoicing/V1/ForbiddenError.php index 852217b..be517db 100644 --- a/lib/Model/EInvoicing/V1/ForbiddenError.php +++ b/lib/Model/EInvoicing/V1/ForbiddenError.php @@ -13,7 +13,7 @@ /* * AvaTax Software Development Kit for PHP * - * (c) 2004-2022 Avalara, Inc. + * (c) 2004-2025 Avalara, Inc. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -26,9 +26,8 @@ * @package Avalara\SDK\API\EInvoicing\V1 * @author Sachin Baijal * @author Jonathan Wenger - * @copyright 2004-2022 Avalara, Inc. + * @copyright 2004-2025 Avalara, Inc. * @license https://www.apache.org/licenses/LICENSE-2.0 - * @version * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK */ diff --git a/lib/Model/EInvoicing/V1/InputDataFormats.php b/lib/Model/EInvoicing/V1/InputDataFormats.php index 7bdaf24..4dd023d 100644 --- a/lib/Model/EInvoicing/V1/InputDataFormats.php +++ b/lib/Model/EInvoicing/V1/InputDataFormats.php @@ -13,7 +13,7 @@ /* * AvaTax Software Development Kit for PHP * - * (c) 2004-2022 Avalara, Inc. + * (c) 2004-2025 Avalara, Inc. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -26,9 +26,8 @@ * @package Avalara\SDK\API\EInvoicing\V1 * @author Sachin Baijal * @author Jonathan Wenger - * @copyright 2004-2022 Avalara, Inc. + * @copyright 2004-2025 Avalara, Inc. * @license https://www.apache.org/licenses/LICENSE-2.0 - * @version * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK */ @@ -65,7 +64,7 @@ class InputDataFormats implements ModelInterface, ArrayAccess, \JsonSerializable * * @var string */ - protected static $openAPIModelName = 'InputDataFormats'; + protected static $openAPIModelName = 'inputDataFormats'; /** * Array of property to type mappings. Used for (de)serialization @@ -238,7 +237,7 @@ public function getFormat() /** * Sets format * - * @param string|null $format Invoice format + * @param string|null $format Document format * * @return self */ diff --git a/lib/Model/EInvoicing/V1/InternalServerError.php b/lib/Model/EInvoicing/V1/InternalServerError.php index b48d933..ec758b9 100644 --- a/lib/Model/EInvoicing/V1/InternalServerError.php +++ b/lib/Model/EInvoicing/V1/InternalServerError.php @@ -13,7 +13,7 @@ /* * AvaTax Software Development Kit for PHP * - * (c) 2004-2022 Avalara, Inc. + * (c) 2004-2025 Avalara, Inc. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -26,9 +26,8 @@ * @package Avalara\SDK\API\EInvoicing\V1 * @author Sachin Baijal * @author Jonathan Wenger - * @copyright 2004-2022 Avalara, Inc. + * @copyright 2004-2025 Avalara, Inc. * @license https://www.apache.org/licenses/LICENSE-2.0 - * @version * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK */ diff --git a/lib/Model/EInvoicing/V1/Mandate.php b/lib/Model/EInvoicing/V1/Mandate.php index a3f20f1..0fbdde7 100644 --- a/lib/Model/EInvoicing/V1/Mandate.php +++ b/lib/Model/EInvoicing/V1/Mandate.php @@ -13,7 +13,7 @@ /* * AvaTax Software Development Kit for PHP * - * (c) 2004-2022 Avalara, Inc. + * (c) 2004-2025 Avalara, Inc. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -26,9 +26,8 @@ * @package Avalara\SDK\API\EInvoicing\V1 * @author Sachin Baijal * @author Jonathan Wenger - * @copyright 2004-2022 Avalara, Inc. + * @copyright 2004-2025 Avalara, Inc. * @license https://www.apache.org/licenses/LICENSE-2.0 - * @version * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK */ @@ -273,7 +272,7 @@ public function getMandateId() /** * Sets mandate_id * - * @param string|null $mandate_id Mandate UUID + * @param string|null $mandate_id The `mandateId` is comprised of the country code, mandate type, and the network or regulation type (for example, AU-B2G-PEPPOL). Keep in mind the following when specifying a `mandateId`. - A country can have multiple mandate types (B2C, B2B, B2G). - A entity/company can opt in for multiple mandates. - A `mandateId` is the combination of country + mandate type + network/regulation. * * @return self */ @@ -297,7 +296,7 @@ public function getCountryMandate() /** * Sets country_mandate * - * @param string|null $country_mandate Country mandate name + * @param string|null $country_mandate **[LEGACY]** This field is retained for backward compatibility. It is recommended to use `mandateId` instead. The `countryMandate` similar to the `mandateId` is comprised of the country code, mandate type, and the network or regulation type (for example, AU-B2G-PEPPOL). * * @return self */ diff --git a/lib/Model/EInvoicing/V1/MandateDataInputField.php b/lib/Model/EInvoicing/V1/MandateDataInputField.php new file mode 100644 index 0000000..b480c97 --- /dev/null +++ b/lib/Model/EInvoicing/V1/MandateDataInputField.php @@ -0,0 +1,723 @@ + + * @author Jonathan Wenger + * @copyright 2004-2025 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\SDK\Model\EInvoicing\V1; + +use \ArrayAccess; +use \Avalara\SDK\ObjectSerializer; +use \Avalara\SDK\Model\ModelInterface; +/** + * MandateDataInputField Class Doc Comment + * + * @category Class + * @description The Data Input Field + * @package Avalara\SDK + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class MandateDataInputField implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MandateDataInputField'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'field_id' => 'string', + 'document_type' => 'string', + 'document_version' => 'string', + 'path' => 'string', + 'path_type' => 'string', + 'field_name' => 'string', + 'namespace' => '\Avalara\SDK\Model\EInvoicing\V1\MandateDataInputFieldNamespace', + 'example_or_fixed_value' => 'string', + 'accepted_values' => 'string[]', + 'documentation_link' => 'string', + 'data_type' => 'string', + 'description' => 'string', + 'optionality' => 'string', + 'cardinality' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'field_id' => null, + 'document_type' => null, + 'document_version' => null, + 'path' => null, + 'path_type' => null, + 'field_name' => null, + 'namespace' => null, + 'example_or_fixed_value' => null, + 'accepted_values' => null, + 'documentation_link' => null, + 'data_type' => null, + 'description' => null, + 'optionality' => null, + 'cardinality' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'field_id' => 'fieldId', + 'document_type' => 'documentType', + 'document_version' => 'documentVersion', + 'path' => 'path', + 'path_type' => 'pathType', + 'field_name' => 'fieldName', + 'namespace' => 'namespace', + 'example_or_fixed_value' => 'exampleOrFixedValue', + 'accepted_values' => 'acceptedValues', + 'documentation_link' => 'documentationLink', + 'data_type' => 'dataType', + 'description' => 'description', + 'optionality' => 'optionality', + 'cardinality' => 'cardinality' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'field_id' => 'setFieldId', + 'document_type' => 'setDocumentType', + 'document_version' => 'setDocumentVersion', + 'path' => 'setPath', + 'path_type' => 'setPathType', + 'field_name' => 'setFieldName', + 'namespace' => 'setNamespace', + 'example_or_fixed_value' => 'setExampleOrFixedValue', + 'accepted_values' => 'setAcceptedValues', + 'documentation_link' => 'setDocumentationLink', + 'data_type' => 'setDataType', + 'description' => 'setDescription', + 'optionality' => 'setOptionality', + 'cardinality' => 'setCardinality' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'field_id' => 'getFieldId', + 'document_type' => 'getDocumentType', + 'document_version' => 'getDocumentVersion', + 'path' => 'getPath', + 'path_type' => 'getPathType', + 'field_name' => 'getFieldName', + 'namespace' => 'getNamespace', + 'example_or_fixed_value' => 'getExampleOrFixedValue', + 'accepted_values' => 'getAcceptedValues', + 'documentation_link' => 'getDocumentationLink', + 'data_type' => 'getDataType', + 'description' => 'getDescription', + 'optionality' => 'getOptionality', + 'cardinality' => 'getCardinality' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['field_id'] = $data['field_id'] ?? null; + $this->container['document_type'] = $data['document_type'] ?? null; + $this->container['document_version'] = $data['document_version'] ?? null; + $this->container['path'] = $data['path'] ?? null; + $this->container['path_type'] = $data['path_type'] ?? null; + $this->container['field_name'] = $data['field_name'] ?? null; + $this->container['namespace'] = $data['namespace'] ?? null; + $this->container['example_or_fixed_value'] = $data['example_or_fixed_value'] ?? null; + $this->container['accepted_values'] = $data['accepted_values'] ?? null; + $this->container['documentation_link'] = $data['documentation_link'] ?? null; + $this->container['data_type'] = $data['data_type'] ?? null; + $this->container['description'] = $data['description'] ?? null; + $this->container['optionality'] = $data['optionality'] ?? null; + $this->container['cardinality'] = $data['cardinality'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets field_id + * + * @return string|null + */ + public function getFieldId() + { + return $this->container['field_id']; + } + + /** + * Sets field_id + * + * @param string|null $field_id Field ID + * + * @return self + */ + public function setFieldId($field_id) + { + $this->container['field_id'] = $field_id; + + return $this; + } + + /** + * Gets document_type + * + * @return string|null + */ + public function getDocumentType() + { + return $this->container['document_type']; + } + + /** + * Sets document_type + * + * @param string|null $document_type The document type + * + * @return self + */ + public function setDocumentType($document_type) + { + $this->container['document_type'] = $document_type; + + return $this; + } + + /** + * Gets document_version + * + * @return string|null + */ + public function getDocumentVersion() + { + return $this->container['document_version']; + } + + /** + * Sets document_version + * + * @param string|null $document_version The document version + * + * @return self + */ + public function setDocumentVersion($document_version) + { + $this->container['document_version'] = $document_version; + + return $this; + } + + /** + * Gets path + * + * @return string|null + */ + public function getPath() + { + return $this->container['path']; + } + + /** + * Sets path + * + * @param string|null $path Path to this field + * + * @return self + */ + public function setPath($path) + { + $this->container['path'] = $path; + + return $this; + } + + /** + * Gets path_type + * + * @return string|null + */ + public function getPathType() + { + return $this->container['path_type']; + } + + /** + * Sets path_type + * + * @param string|null $path_type The type of path + * + * @return self + */ + public function setPathType($path_type) + { + $this->container['path_type'] = $path_type; + + return $this; + } + + /** + * Gets field_name + * + * @return string|null + */ + public function getFieldName() + { + return $this->container['field_name']; + } + + /** + * Sets field_name + * + * @param string|null $field_name Field name + * + * @return self + */ + public function setFieldName($field_name) + { + $this->container['field_name'] = $field_name; + + return $this; + } + + /** + * Gets namespace + * + * @return \Avalara\SDK\Model\EInvoicing\V1\MandateDataInputFieldNamespace|null + */ + public function getNamespace() + { + return $this->container['namespace']; + } + + /** + * Sets namespace + * + * @param \Avalara\SDK\Model\EInvoicing\V1\MandateDataInputFieldNamespace|null $namespace namespace + * + * @return self + */ + public function setNamespace($namespace) + { + $this->container['namespace'] = $namespace; + + return $this; + } + + /** + * Gets example_or_fixed_value + * + * @return string|null + */ + public function getExampleOrFixedValue() + { + return $this->container['example_or_fixed_value']; + } + + /** + * Sets example_or_fixed_value + * + * @param string|null $example_or_fixed_value An example of the content for this field + * + * @return self + */ + public function setExampleOrFixedValue($example_or_fixed_value) + { + $this->container['example_or_fixed_value'] = $example_or_fixed_value; + + return $this; + } + + /** + * Gets accepted_values + * + * @return string[]|null + */ + public function getAcceptedValues() + { + return $this->container['accepted_values']; + } + + /** + * Sets accepted_values + * + * @param string[]|null $accepted_values An Array representing the acceptable values for this field + * + * @return self + */ + public function setAcceptedValues($accepted_values) + { + $this->container['accepted_values'] = $accepted_values; + + return $this; + } + + /** + * Gets documentation_link + * + * @return string|null + */ + public function getDocumentationLink() + { + return $this->container['documentation_link']; + } + + /** + * Sets documentation_link + * + * @param string|null $documentation_link An example of the content for this field + * + * @return self + */ + public function setDocumentationLink($documentation_link) + { + $this->container['documentation_link'] = $documentation_link; + + return $this; + } + + /** + * Gets data_type + * + * @return string|null + */ + public function getDataType() + { + return $this->container['data_type']; + } + + /** + * Sets data_type + * + * @param string|null $data_type The data type of this field. + * + * @return self + */ + public function setDataType($data_type) + { + $this->container['data_type'] = $data_type; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description A description of this field + * + * @return self + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets optionality + * + * @return string|null + */ + public function getOptionality() + { + return $this->container['optionality']; + } + + /** + * Sets optionality + * + * @param string|null $optionality Determines if the field if Required/Conditional/Optional or not required. + * + * @return self + */ + public function setOptionality($optionality) + { + $this->container['optionality'] = $optionality; + + return $this; + } + + /** + * Gets cardinality + * + * @return string|null + */ + public function getCardinality() + { + return $this->container['cardinality']; + } + + /** + * Sets cardinality + * + * @param string|null $cardinality Represents the number of times an element can appear within the document + * + * @return self + */ + public function setCardinality($cardinality) + { + $this->container['cardinality'] = $cardinality; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset):bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset):mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value):void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset):void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize():mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString():string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue():string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EInvoicing/V1/MandateDataInputFieldNamespace.php b/lib/Model/EInvoicing/V1/MandateDataInputFieldNamespace.php new file mode 100644 index 0000000..afa9f08 --- /dev/null +++ b/lib/Model/EInvoicing/V1/MandateDataInputFieldNamespace.php @@ -0,0 +1,363 @@ + + * @author Jonathan Wenger + * @copyright 2004-2025 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\SDK\Model\EInvoicing\V1; + +use \ArrayAccess; +use \Avalara\SDK\ObjectSerializer; +use \Avalara\SDK\Model\ModelInterface; +/** + * MandateDataInputFieldNamespace Class Doc Comment + * + * @category Class + * @description The namespace of the UBL element + * @package Avalara\SDK + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class MandateDataInputFieldNamespace implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MandateDataInputField_namespace'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'prefix' => 'string', + 'value' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'prefix' => null, + 'value' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'prefix' => 'prefix', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'prefix' => 'setPrefix', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'prefix' => 'getPrefix', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['prefix'] = $data['prefix'] ?? null; + $this->container['value'] = $data['value'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets prefix + * + * @return string|null + */ + public function getPrefix() + { + return $this->container['prefix']; + } + + /** + * Sets prefix + * + * @param string|null $prefix The namespace prefix for the UBL Element + * + * @return self + */ + public function setPrefix($prefix) + { + $this->container['prefix'] = $prefix; + + return $this; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value value + * + * @return self + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset):bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset):mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value):void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset):void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize():mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString():string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue():string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EInvoicing/V1/MandatesResponse.php b/lib/Model/EInvoicing/V1/MandatesResponse.php index 0b99253..4ba33e1 100644 --- a/lib/Model/EInvoicing/V1/MandatesResponse.php +++ b/lib/Model/EInvoicing/V1/MandatesResponse.php @@ -13,7 +13,7 @@ /* * AvaTax Software Development Kit for PHP * - * (c) 2004-2022 Avalara, Inc. + * (c) 2004-2025 Avalara, Inc. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -26,9 +26,8 @@ * @package Avalara\SDK\API\EInvoicing\V1 * @author Sachin Baijal * @author Jonathan Wenger - * @copyright 2004-2022 Avalara, Inc. + * @copyright 2004-2025 Avalara, Inc. * @license https://www.apache.org/licenses/LICENSE-2.0 - * @version * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK */ @@ -73,7 +72,7 @@ class MandatesResponse implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'at_record_set_count' => 'float', + 'at_recordset_count' => 'float', 'at_next_link' => 'string', 'value' => '\Avalara\SDK\Model\EInvoicing\V1\Mandate[]' ]; @@ -86,7 +85,7 @@ class MandatesResponse implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'at_record_set_count' => null, + 'at_recordset_count' => null, 'at_next_link' => null, 'value' => null ]; @@ -118,7 +117,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'at_record_set_count' => '@recordSetCount', + 'at_recordset_count' => '@recordsetCount', 'at_next_link' => '@nextLink', 'value' => 'value' ]; @@ -129,7 +128,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'at_record_set_count' => 'setAtRecordSetCount', + 'at_recordset_count' => 'setAtRecordsetCount', 'at_next_link' => 'setAtNextLink', 'value' => 'setValue' ]; @@ -140,7 +139,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'at_record_set_count' => 'getAtRecordSetCount', + 'at_recordset_count' => 'getAtRecordsetCount', 'at_next_link' => 'getAtNextLink', 'value' => 'getValue' ]; @@ -202,7 +201,7 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['at_record_set_count'] = $data['at_record_set_count'] ?? null; + $this->container['at_recordset_count'] = $data['at_recordset_count'] ?? null; $this->container['at_next_link'] = $data['at_next_link'] ?? null; $this->container['value'] = $data['value'] ?? null; } @@ -232,25 +231,25 @@ public function valid() /** - * Gets at_record_set_count + * Gets at_recordset_count * * @return float|null */ - public function getAtRecordSetCount() + public function getAtRecordsetCount() { - return $this->container['at_record_set_count']; + return $this->container['at_recordset_count']; } /** - * Sets at_record_set_count + * Sets at_recordset_count * - * @param float|null $at_record_set_count Total count of results + * @param float|null $at_recordset_count Total count of results * * @return self */ - public function setAtRecordSetCount($at_record_set_count) + public function setAtRecordsetCount($at_recordset_count) { - $this->container['at_record_set_count'] = $at_record_set_count; + $this->container['at_recordset_count'] = $at_recordset_count; return $this; } diff --git a/lib/Model/EInvoicing/V1/ModelInterface.php b/lib/Model/EInvoicing/V1/ModelInterface.php index 44109dd..b138ddd 100644 --- a/lib/Model/EInvoicing/V1/ModelInterface.php +++ b/lib/Model/EInvoicing/V1/ModelInterface.php @@ -13,7 +13,7 @@ /* * AvaTax Software Development Kit for PHP * - * (c) 2004-2022 Avalara, Inc. + * (c) 2004-2025 Avalara, Inc. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -26,9 +26,8 @@ * @package Avalara\SDK\API\EInvoicing\V1 * @author Sachin Baijal * @author Jonathan Wenger - * @copyright 2004-2022 Avalara, Inc. + * @copyright 2004-2025 Avalara, Inc. * @license https://www.apache.org/licenses/LICENSE-2.0 - * @version * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK */ diff --git a/lib/Model/EInvoicing/V1/NotFoundError.php b/lib/Model/EInvoicing/V1/NotFoundError.php index d6211b7..4bf9d14 100644 --- a/lib/Model/EInvoicing/V1/NotFoundError.php +++ b/lib/Model/EInvoicing/V1/NotFoundError.php @@ -13,7 +13,7 @@ /* * AvaTax Software Development Kit for PHP * - * (c) 2004-2022 Avalara, Inc. + * (c) 2004-2025 Avalara, Inc. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -26,9 +26,8 @@ * @package Avalara\SDK\API\EInvoicing\V1 * @author Sachin Baijal * @author Jonathan Wenger - * @copyright 2004-2022 Avalara, Inc. + * @copyright 2004-2025 Avalara, Inc. * @license https://www.apache.org/licenses/LICENSE-2.0 - * @version * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK */ diff --git a/lib/Model/EInvoicing/V1/NotUsedForField.php b/lib/Model/EInvoicing/V1/NotUsedForField.php index d1d23e6..24d0286 100644 --- a/lib/Model/EInvoicing/V1/NotUsedForField.php +++ b/lib/Model/EInvoicing/V1/NotUsedForField.php @@ -13,7 +13,7 @@ /* * AvaTax Software Development Kit for PHP * - * (c) 2004-2022 Avalara, Inc. + * (c) 2004-2025 Avalara, Inc. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -26,9 +26,8 @@ * @package Avalara\SDK\API\EInvoicing\V1 * @author Sachin Baijal * @author Jonathan Wenger - * @copyright 2004-2022 Avalara, Inc. + * @copyright 2004-2025 Avalara, Inc. * @license https://www.apache.org/licenses/LICENSE-2.0 - * @version * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK */ diff --git a/lib/Model/EInvoicing/V1/RequiredWhenField.php b/lib/Model/EInvoicing/V1/RequiredWhenField.php index abde239..b75ddc1 100644 --- a/lib/Model/EInvoicing/V1/RequiredWhenField.php +++ b/lib/Model/EInvoicing/V1/RequiredWhenField.php @@ -13,7 +13,7 @@ /* * AvaTax Software Development Kit for PHP * - * (c) 2004-2022 Avalara, Inc. + * (c) 2004-2025 Avalara, Inc. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -26,9 +26,8 @@ * @package Avalara\SDK\API\EInvoicing\V1 * @author Sachin Baijal * @author Jonathan Wenger - * @copyright 2004-2022 Avalara, Inc. + * @copyright 2004-2025 Avalara, Inc. * @license https://www.apache.org/licenses/LICENSE-2.0 - * @version * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK */ diff --git a/lib/Model/EInvoicing/V1/StatusEvent.php b/lib/Model/EInvoicing/V1/StatusEvent.php index 54baaec..e193406 100644 --- a/lib/Model/EInvoicing/V1/StatusEvent.php +++ b/lib/Model/EInvoicing/V1/StatusEvent.php @@ -13,7 +13,7 @@ /* * AvaTax Software Development Kit for PHP * - * (c) 2004-2022 Avalara, Inc. + * (c) 2004-2025 Avalara, Inc. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -26,9 +26,8 @@ * @package Avalara\SDK\API\EInvoicing\V1 * @author Sachin Baijal * @author Jonathan Wenger - * @copyright 2004-2022 Avalara, Inc. + * @copyright 2004-2025 Avalara, Inc. * @license https://www.apache.org/licenses/LICENSE-2.0 - * @version * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK */ @@ -74,7 +73,9 @@ class StatusEvent implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'event_date_time' => 'string', - 'message' => 'string' + 'message' => 'string', + 'response_key' => 'string', + 'response_value' => 'string' ]; /** @@ -86,7 +87,9 @@ class StatusEvent implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPIFormats = [ 'event_date_time' => null, - 'message' => null + 'message' => null, + 'response_key' => null, + 'response_value' => null ]; /** @@ -117,7 +120,9 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'event_date_time' => 'eventDateTime', - 'message' => 'message' + 'message' => 'message', + 'response_key' => 'responseKey', + 'response_value' => 'responseValue' ]; /** @@ -127,7 +132,9 @@ public static function openAPIFormats() */ protected static $setters = [ 'event_date_time' => 'setEventDateTime', - 'message' => 'setMessage' + 'message' => 'setMessage', + 'response_key' => 'setResponseKey', + 'response_value' => 'setResponseValue' ]; /** @@ -137,7 +144,9 @@ public static function openAPIFormats() */ protected static $getters = [ 'event_date_time' => 'getEventDateTime', - 'message' => 'getMessage' + 'message' => 'getMessage', + 'response_key' => 'getResponseKey', + 'response_value' => 'getResponseValue' ]; /** @@ -199,6 +208,8 @@ public function __construct(array $data = null) { $this->container['event_date_time'] = $data['event_date_time'] ?? null; $this->container['message'] = $data['message'] ?? null; + $this->container['response_key'] = $data['response_key'] ?? null; + $this->container['response_value'] = $data['response_value'] ?? null; } /** @@ -272,6 +283,54 @@ public function setMessage($message) return $this; } + + /** + * Gets response_key + * + * @return string|null + */ + public function getResponseKey() + { + return $this->container['response_key']; + } + + /** + * Sets response_key + * + * @param string|null $response_key The type of number or acknowledgement returned by the tax authority (if applicable). For example, it could be an identification key, acknowledgement code, or any other relevant identifier. + * + * @return self + */ + public function setResponseKey($response_key) + { + $this->container['response_key'] = $response_key; + + return $this; + } + + /** + * Gets response_value + * + * @return string|null + */ + public function getResponseValue() + { + return $this->container['response_value']; + } + + /** + * Sets response_value + * + * @param string|null $response_value The corresponding value associated with the response key. This value is provided by the tax authority in response to the event. + * + * @return self + */ + public function setResponseValue($response_value) + { + $this->container['response_value'] = $response_value; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/EInvoicing/V1/SubmitDocumentMetadata.php b/lib/Model/EInvoicing/V1/SubmitDocumentMetadata.php index a9c692f..65ad754 100644 --- a/lib/Model/EInvoicing/V1/SubmitDocumentMetadata.php +++ b/lib/Model/EInvoicing/V1/SubmitDocumentMetadata.php @@ -13,7 +13,7 @@ /* * AvaTax Software Development Kit for PHP * - * (c) 2004-2022 Avalara, Inc. + * (c) 2004-2025 Avalara, Inc. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -26,9 +26,8 @@ * @package Avalara\SDK\API\EInvoicing\V1 * @author Sachin Baijal * @author Jonathan Wenger - * @copyright 2004-2022 Avalara, Inc. + * @copyright 2004-2025 Avalara, Inc. * @license https://www.apache.org/licenses/LICENSE-2.0 - * @version * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK */ @@ -48,7 +47,7 @@ * SubmitDocumentMetadata Class Doc Comment * * @category Class - * @description Key value pairs of metadata for a document submission. dataFormat can be ubl-invoice or ubl-creditnote: <br><pre>{ \"workflowId\": \"partner-einvoicing\", \"dataFormat\": \"ubl-invoice\", \"dataFormatVersion\": \"2.1\", \"countryCode\": \"SA\", \"countryMandate\": \"SA-Phase1-B2B\" }</pre> <br> + * @description Key value pairs of metadata for a document submission <br><pre>{ \"workflowId\": \"partner-einvoicing\", \"dataFormat\": \"ubl-invoice\", \"dataFormatVersion\": \"2.1\", \"countryCode\": \"SA\", \"countryMandate\": \"SA-Phase1-B2B\" }</pre> <br> * @package Avalara\SDK * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -343,7 +342,7 @@ public function getCountryCode() /** * Sets country_code * - * @param string $country_code The two-letter ISO-3166 country code for the country where the e-invoice is being submitted + * @param string $country_code The two-letter ISO-3166 country code for the country where the document is being submitted * * @return self */ diff --git a/lib/Model/EInvoicing/V1/SubmitInteropDocument202Response.php b/lib/Model/EInvoicing/V1/SubmitInteropDocument202Response.php new file mode 100644 index 0000000..e3a3c53 --- /dev/null +++ b/lib/Model/EInvoicing/V1/SubmitInteropDocument202Response.php @@ -0,0 +1,362 @@ + + * @author Jonathan Wenger + * @copyright 2004-2025 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK + + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Avalara\SDK\Model\EInvoicing\V1; + +use \ArrayAccess; +use \Avalara\SDK\ObjectSerializer; +use \Avalara\SDK\Model\ModelInterface; +/** + * SubmitInteropDocument202Response Class Doc Comment + * + * @category Class + * @package Avalara\SDK + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null + */ +class SubmitInteropDocument202Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SubmitInteropDocument_202_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'interchange_id' => 'string', + 'message' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'interchange_id' => null, + 'message' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'interchange_id' => 'interchangeId', + 'message' => 'message' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'interchange_id' => 'setInterchangeId', + 'message' => 'setMessage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'interchange_id' => 'getInterchangeId', + 'message' => 'getMessage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['interchange_id'] = $data['interchange_id'] ?? null; + $this->container['message'] = $data['message'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets interchange_id + * + * @return string|null + */ + public function getInterchangeId() + { + return $this->container['interchange_id']; + } + + /** + * Sets interchange_id + * + * @param string|null $interchange_id The unique interchange ID for this submission. + * + * @return self + */ + public function setInterchangeId($interchange_id) + { + $this->container['interchange_id'] = $interchange_id; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message A message indicating that the document has been accepted. + * + * @return self + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset):bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset):mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value):void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset):void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize():mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString():string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue():string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EInvoicing/V1/WorkflowIds.php b/lib/Model/EInvoicing/V1/WorkflowIds.php index f1be32a..369d05a 100644 --- a/lib/Model/EInvoicing/V1/WorkflowIds.php +++ b/lib/Model/EInvoicing/V1/WorkflowIds.php @@ -13,7 +13,7 @@ /* * AvaTax Software Development Kit for PHP * - * (c) 2004-2022 Avalara, Inc. + * (c) 2004-2025 Avalara, Inc. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -26,9 +26,8 @@ * @package Avalara\SDK\API\EInvoicing\V1 * @author Sachin Baijal * @author Jonathan Wenger - * @copyright 2004-2022 Avalara, Inc. + * @copyright 2004-2025 Avalara, Inc. * @license https://www.apache.org/licenses/LICENSE-2.0 - * @version * @link https://github.com/avadev/AvaTax-REST-V3-PHP-SDK */ diff --git a/test/Integration/DocumentsApiTest.php b/test/Integration/DocumentsApiTest.php index 73f903d..86fa23b 100644 --- a/test/Integration/DocumentsApiTest.php +++ b/test/Integration/DocumentsApiTest.php @@ -44,7 +44,6 @@ public function testGetDocumentsList() $request_options = new \Avalara\SDK\API\EInvoicing\V1\GetDocumentListRequest(); - $request_options->setAvalaraVersion('1.0'); try { $result=$apiInstance->getDocumentListAsync($request_options);