From 944e1884685f52e0f9603cd94998045010847d3f Mon Sep 17 00:00:00 2001 From: Jonathan Wenger Date: Fri, 20 Dec 2024 09:49:05 -0800 Subject: [PATCH] Updates for 24.12.10 --- README.md | 116 +- docs/EInvoicing/V1/BatchSearch.md | 30 + docs/EInvoicing/V1/BatchSearchListResponse.md | 16 + docs/EInvoicing/V1/ConditionalForField.md | 2 +- docs/EInvoicing/V1/DataInputField.md | 2 +- docs/EInvoicing/V1/DataInputFieldsApi.md | 10 +- docs/EInvoicing/V1/DataInputFieldsResponse.md | 4 +- docs/EInvoicing/V1/DirectorySearchResponse.md | 16 + .../V1/DirectorySearchResponseValueInner.md | 19 + ...ySearchResponseValueInnerAddressesInner.md | 17 + ...earchResponseValueInnerIdentifiersInner.md | 14 + ...seValueInnerSupportedDocumentTypesInner.md | 16 + docs/EInvoicing/V1/DocumentFetch.md | 15 + docs/EInvoicing/V1/DocumentListResponse.md | 4 +- docs/EInvoicing/V1/DocumentStatusResponse.md | 2 +- docs/EInvoicing/V1/DocumentSummary.md | 16 +- docs/EInvoicing/V1/DocumentsApi.md | 122 +- docs/EInvoicing/V1/ErrorResponse.md | 16 + docs/EInvoicing/V1/FetchDocumentsRequest.md | 14 + .../V1/FetchDocumentsRequestDataInner.md | 14 + .../V1/FetchDocumentsRequestMetadata.md | 17 + docs/EInvoicing/V1/InputDataFormats.md | 2 +- docs/EInvoicing/V1/InteropApi.md | 101 ++ docs/EInvoicing/V1/Mandate.md | 4 +- docs/EInvoicing/V1/MandateDataInputField.md | 27 + .../V1/MandateDataInputFieldNamespace.md | 15 + docs/EInvoicing/V1/MandatesApi.md | 98 +- docs/EInvoicing/V1/MandatesResponse.md | 4 +- docs/EInvoicing/V1/StatusEvent.md | 2 + docs/EInvoicing/V1/SubmitDocumentMetadata.md | 4 +- .../V1/SubmitInteropDocument202Response.md | 14 + docs/EInvoicing/V1/TradingPartnersApi.md | 472 +++++++ pom.xml | 80 +- src/main/java/Avalara/SDK/JSON.java | 6 +- .../api/EInvoicing/V1/DataInputFieldsApi.java | 16 +- .../SDK/api/EInvoicing/V1/DocumentsApi.java | 246 +++- .../SDK/api/EInvoicing/V1/InteropApi.java | 310 +++++ .../SDK/api/EInvoicing/V1/MandatesApi.java | 235 +++- .../api/EInvoicing/V1/TradingPartnersApi.java | 1182 +++++++++++++++++ .../EInvoicing/V1/AbstractOpenApiSchema.java | 2 +- .../EInvoicing/V1/BadDownloadRequest.java | 50 +- .../SDK/model/EInvoicing/V1/BadRequest.java | 46 +- .../SDK/model/EInvoicing/V1/BatchSearch.java | 444 +++++++ .../V1/BatchSearchListResponse.java | 290 ++++ .../EInvoicing/V1/ConditionalForField.java | 64 +- .../model/EInvoicing/V1/DataInputField.java | 134 +- .../V1/DataInputFieldNotUsedFor.java | 42 +- .../V1/DataInputFieldOptionalFor.java | 42 +- .../V1/DataInputFieldRequiredFor.java | 42 +- .../V1/DataInputFieldsResponse.java | 96 +- .../V1/DirectorySearchResponse.java | 290 ++++ .../V1/DirectorySearchResponseValueInner.java | 447 +++++++ ...earchResponseValueInnerAddressesInner.java | 329 +++++ ...rchResponseValueInnerIdentifiersInner.java | 242 ++++ ...ValueInnerSupportedDocumentTypesInner.java | 294 ++++ .../model/EInvoicing/V1/DocumentFetch.java | 271 ++++ .../EInvoicing/V1/DocumentListResponse.java | 84 +- .../EInvoicing/V1/DocumentStatusResponse.java | 54 +- .../V1/DocumentSubmissionError.java | 46 +- .../EInvoicing/V1/DocumentSubmitResponse.java | 42 +- .../model/EInvoicing/V1/DocumentSummary.java | 160 ++- .../model/EInvoicing/V1/ErrorResponse.java | 300 +++++ .../EInvoicing/V1/FetchDocumentsRequest.java | 266 ++++ .../V1/FetchDocumentsRequestDataInner.java | 251 ++++ .../V1/FetchDocumentsRequestMetadata.java | 339 +++++ .../model/EInvoicing/V1/ForbiddenError.java | 42 +- .../model/EInvoicing/V1/InputDataFormats.java | 50 +- .../EInvoicing/V1/InternalServerError.java | 46 +- .../SDK/model/EInvoicing/V1/Mandate.java | 78 +- .../EInvoicing/V1/MandateDataInputField.java | 603 +++++++++ .../V1/MandateDataInputFieldNamespace.java | 242 ++++ .../model/EInvoicing/V1/MandatesResponse.java | 96 +- .../model/EInvoicing/V1/NotFoundError.java | 46 +- .../model/EInvoicing/V1/NotUsedForField.java | 42 +- .../EInvoicing/V1/RequiredWhenField.java | 42 +- .../SDK/model/EInvoicing/V1/StatusEvent.java | 120 +- .../EInvoicing/V1/SubmitDocumentMetadata.java | 62 +- .../V1/SubmitInteropDocument202Response.java | 242 ++++ .../SDK/model/EInvoicing/V1/WorkflowIds.java | 46 +- 79 files changed, 8850 insertions(+), 874 deletions(-) create mode 100644 docs/EInvoicing/V1/BatchSearch.md create mode 100644 docs/EInvoicing/V1/BatchSearchListResponse.md create mode 100644 docs/EInvoicing/V1/DirectorySearchResponse.md create mode 100644 docs/EInvoicing/V1/DirectorySearchResponseValueInner.md create mode 100644 docs/EInvoicing/V1/DirectorySearchResponseValueInnerAddressesInner.md create mode 100644 docs/EInvoicing/V1/DirectorySearchResponseValueInnerIdentifiersInner.md create mode 100644 docs/EInvoicing/V1/DirectorySearchResponseValueInnerSupportedDocumentTypesInner.md create mode 100644 docs/EInvoicing/V1/DocumentFetch.md create mode 100644 docs/EInvoicing/V1/ErrorResponse.md create mode 100644 docs/EInvoicing/V1/FetchDocumentsRequest.md create mode 100644 docs/EInvoicing/V1/FetchDocumentsRequestDataInner.md create mode 100644 docs/EInvoicing/V1/FetchDocumentsRequestMetadata.md create mode 100644 docs/EInvoicing/V1/InteropApi.md create mode 100644 docs/EInvoicing/V1/MandateDataInputField.md create mode 100644 docs/EInvoicing/V1/MandateDataInputFieldNamespace.md create mode 100644 docs/EInvoicing/V1/SubmitInteropDocument202Response.md create mode 100644 docs/EInvoicing/V1/TradingPartnersApi.md create mode 100644 src/main/java/Avalara/SDK/api/EInvoicing/V1/InteropApi.java create mode 100644 src/main/java/Avalara/SDK/api/EInvoicing/V1/TradingPartnersApi.java create mode 100644 src/main/java/Avalara/SDK/model/EInvoicing/V1/BatchSearch.java create mode 100644 src/main/java/Avalara/SDK/model/EInvoicing/V1/BatchSearchListResponse.java create mode 100644 src/main/java/Avalara/SDK/model/EInvoicing/V1/DirectorySearchResponse.java create mode 100644 src/main/java/Avalara/SDK/model/EInvoicing/V1/DirectorySearchResponseValueInner.java create mode 100644 src/main/java/Avalara/SDK/model/EInvoicing/V1/DirectorySearchResponseValueInnerAddressesInner.java create mode 100644 src/main/java/Avalara/SDK/model/EInvoicing/V1/DirectorySearchResponseValueInnerIdentifiersInner.java create mode 100644 src/main/java/Avalara/SDK/model/EInvoicing/V1/DirectorySearchResponseValueInnerSupportedDocumentTypesInner.java create mode 100644 src/main/java/Avalara/SDK/model/EInvoicing/V1/DocumentFetch.java create mode 100644 src/main/java/Avalara/SDK/model/EInvoicing/V1/ErrorResponse.java create mode 100644 src/main/java/Avalara/SDK/model/EInvoicing/V1/FetchDocumentsRequest.java create mode 100644 src/main/java/Avalara/SDK/model/EInvoicing/V1/FetchDocumentsRequestDataInner.java create mode 100644 src/main/java/Avalara/SDK/model/EInvoicing/V1/FetchDocumentsRequestMetadata.java create mode 100644 src/main/java/Avalara/SDK/model/EInvoicing/V1/MandateDataInputField.java create mode 100644 src/main/java/Avalara/SDK/model/EInvoicing/V1/MandateDataInputFieldNamespace.java create mode 100644 src/main/java/Avalara/SDK/model/EInvoicing/V1/SubmitInteropDocument202Response.java diff --git a/README.md b/README.md index 10ac31e..bfa44e0 100644 --- a/README.md +++ b/README.md @@ -237,10 +237,44 @@ 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 *DocumentsApi* | [**downloadDocument**](docs/EInvoicing/V1/DocumentsApi.md#downloaddocument) | **GET** /documents/{documentId}/$download | Returns a copy of the document *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 *MandatesApi* | [**getMandates**](docs/EInvoicing/V1/MandatesApi.md#getmandates) | **GET** /mandates | List country mandates that are supported by the Avalara E-Invoicing platform + +### EInvoicing V1 API Documentation + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*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** /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 +*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 + + +### EInvoicing V1 API Documentation + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*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** /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 @@ -269,6 +303,84 @@ Class | Method | HTTP request | Description - [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.WorkflowIds](docs/EInvoicing/V1/WorkflowIds.md) + + + +### EInvoicing V1 Model Documentation + + - [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.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.DocumentFetch](docs/EInvoicing/V1/DocumentFetch.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.FetchDocumentsRequest](docs/EInvoicing/V1/FetchDocumentsRequest.md) + - [Avalara.SDK.model.EInvoicing.V1.FetchDocumentsRequestDataInner](docs/EInvoicing/V1/FetchDocumentsRequestDataInner.md) + - [Avalara.SDK.model.EInvoicing.V1.FetchDocumentsRequestMetadata](docs/EInvoicing/V1/FetchDocumentsRequestMetadata.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.SubmitDocumentMetadata](docs/EInvoicing/V1/SubmitDocumentMetadata.md) + - [Avalara.SDK.model.EInvoicing.V1.WorkflowIds](docs/EInvoicing/V1/WorkflowIds.md) + + + +### EInvoicing V1 Model Documentation + + - [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.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.FetchDocumentsRequest](docs/EInvoicing/V1/FetchDocumentsRequest.md) + - [Avalara.SDK.model.EInvoicing.V1.FetchDocumentsRequestDataInner](docs/EInvoicing/V1/FetchDocumentsRequestDataInner.md) + - [Avalara.SDK.model.EInvoicing.V1.FetchDocumentsRequestMetadata](docs/EInvoicing/V1/FetchDocumentsRequestMetadata.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.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/V1/BatchSearch.md b/docs/EInvoicing/V1/BatchSearch.md new file mode 100644 index 0000000..2fca756 --- /dev/null +++ b/docs/EInvoicing/V1/BatchSearch.md @@ -0,0 +1,30 @@ + + +# BatchSearch + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | ID of the batch search | [optional] | +|**name** | **String** | Name of the batch report | [optional] | +|**createdBy** | **String** | Email of the user who created the batch search | [optional] | +|**created** | **OffsetDateTime** | Timestamp when the batch search was created | [optional] | +|**lastModified** | **OffsetDateTime** | Timestamp when the batch search was created | [optional] | +|**status** | [**StatusEnum**](#StatusEnum) | Status of the batch search | [optional] | +|**error** | [**ErrorResponse**](ErrorResponse.md) | | [optional] | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| ACCEPTED | "Accepted" | +| RUNNING | "Running" | +| COMPLETED | "Completed" | +| FAILED | "Failed" | + + + diff --git a/docs/EInvoicing/V1/BatchSearchListResponse.md b/docs/EInvoicing/V1/BatchSearchListResponse.md new file mode 100644 index 0000000..dd6d2fc --- /dev/null +++ b/docs/EInvoicing/V1/BatchSearchListResponse.md @@ -0,0 +1,16 @@ + + +# BatchSearchListResponse + +Schema for batch search list + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**atRecordSetCount** | **Integer** | The count of records in the result set | [optional] | +|**atNextLink** | **String** | Next Link | [optional] | +|**value** | [**List<BatchSearch>**](BatchSearch.md) | | [optional] | + + + diff --git a/docs/EInvoicing/V1/ConditionalForField.md b/docs/EInvoicing/V1/ConditionalForField.md index 1c70d97..bf57d0f 100644 --- a/docs/EInvoicing/V1/ConditionalForField.md +++ b/docs/EInvoicing/V1/ConditionalForField.md @@ -9,7 +9,7 @@ Mandates for which this field is conditional | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**countryMandate** | **String** | | [optional] | -|**requiredWhen** | [**List<RequiredWhenField>**](RequiredWhenField.md) | Array of scenarios which describe when a particular field is conditional for a country mandate | [optional] | +|**requiredWhen** | **List<RequiredWhenField>** | Array of scenarios which describe when a particular field is conditional for a country mandate | [optional] | diff --git a/docs/EInvoicing/V1/DataInputField.md b/docs/EInvoicing/V1/DataInputField.md index daabfe8..ea92426 100644 --- a/docs/EInvoicing/V1/DataInputField.md +++ b/docs/EInvoicing/V1/DataInputField.md @@ -12,7 +12,7 @@ The Data Input Field |**fieldId** | **String** | Field ID | [optional] | |**applicableDocumentRoots** | **List<Object>** | | [optional] | |**path** | **String** | Path to this field | [optional] | -|**nameSpace** | **String** | Namespace of this field | [optional] | +|**namespace** | **String** | Namespace of this field | [optional] | |**fieldName** | **String** | Field name | [optional] | |**exampleOrFixedValue** | **String** | An example of the content for this field | [optional] | |**acceptedValues** | **Object** | An object representing the acceptable values for this field | [optional] | diff --git a/docs/EInvoicing/V1/DataInputFieldsApi.md b/docs/EInvoicing/V1/DataInputFieldsApi.md index 37e64ad..7345118 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 @@ -12,7 +12,7 @@ Method | HTTP request | Description > DataInputFieldsResponse getDataInputFields(avalaraVersion, xAvalaraClient, $filter, $top, $skip, $count, $countOnly) -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 <code>mandates</code> endpoint to retrieve all available country mandates. You can use the $filter query parameter to retrieve fields for a particular mandate @@ -44,8 +44,8 @@ public class Example { ApiClient apiClient = new ApiClient(configuration); DataInputFieldsApi apiInstance = new DataInputFieldsApi(apiClient); - String avalaraVersion = "1.0"; // String | The HTTP Header meant to specify the version of the API intended to be used - String xAvalaraClient = "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\" + String avalaraVersion = "1.2"; // String | The HTTP Header meant to specify the version of the API intended to be used + String xAvalaraClient = "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. String $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. BigDecimal $top = new BigDecimal("10"); // BigDecimal | 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. BigDecimal $skip = new BigDecimal("10"); // BigDecimal | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. @@ -71,7 +71,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **avalaraVersion** | **String**| The HTTP Header meant to specify the version of the API intended to be used | - **xAvalaraClient** | **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] + **xAvalaraClient** | **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** | **BigDecimal**| 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** | **BigDecimal**| 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/DataInputFieldsResponse.md b/docs/EInvoicing/V1/DataInputFieldsResponse.md index 3f36612..0d68d94 100644 --- a/docs/EInvoicing/V1/DataInputFieldsResponse.md +++ b/docs/EInvoicing/V1/DataInputFieldsResponse.md @@ -7,9 +7,9 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**atRecordSetCount** | **BigDecimal** | Total count of results | [optional] | +|**atRecordsetCount** | **BigDecimal** | Total count of results | [optional] | |**atNextLink** | **String** | | [optional] | -|**value** | [**List<DataInputField>**](DataInputField.md) | Array of Data Input Fields | [optional] | +|**value** | **List<DataInputField>** | Array of Data Input Fields | [optional] | diff --git a/docs/EInvoicing/V1/DirectorySearchResponse.md b/docs/EInvoicing/V1/DirectorySearchResponse.md new file mode 100644 index 0000000..753e2c5 --- /dev/null +++ b/docs/EInvoicing/V1/DirectorySearchResponse.md @@ -0,0 +1,16 @@ + + +# DirectorySearchResponse + +Response schema for directory search results + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**atRecordSetCount** | **Integer** | The count of records in the result set | [optional] | +|**atNextLink** | **String** | The next page link to get the next set of results. | [optional] | +|**value** | [**List<DirectorySearchResponseValueInner>**](DirectorySearchResponseValueInner.md) | | [optional] | + + + diff --git a/docs/EInvoicing/V1/DirectorySearchResponseValueInner.md b/docs/EInvoicing/V1/DirectorySearchResponseValueInner.md new file mode 100644 index 0000000..9c3c69c --- /dev/null +++ b/docs/EInvoicing/V1/DirectorySearchResponseValueInner.md @@ -0,0 +1,19 @@ + + +# 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] | +|**registrationDate** | **LocalDate** | Registration date of the participant if available | [optional] | +|**identifiers** | [**List<DirectorySearchResponseValueInnerIdentifiersInner>**](DirectorySearchResponseValueInnerIdentifiersInner.md) | | [optional] | +|**addresses** | [**List<DirectorySearchResponseValueInnerAddressesInner>**](DirectorySearchResponseValueInnerAddressesInner.md) | | [optional] | +|**supportedDocumentTypes** | [**List<DirectorySearchResponseValueInnerSupportedDocumentTypesInner>**](DirectorySearchResponseValueInnerSupportedDocumentTypesInner.md) | | [optional] | + + + diff --git a/docs/EInvoicing/V1/DirectorySearchResponseValueInnerAddressesInner.md b/docs/EInvoicing/V1/DirectorySearchResponseValueInnerAddressesInner.md new file mode 100644 index 0000000..745f5b6 --- /dev/null +++ b/docs/EInvoicing/V1/DirectorySearchResponseValueInnerAddressesInner.md @@ -0,0 +1,17 @@ + + +# 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] | + + + diff --git a/docs/EInvoicing/V1/DirectorySearchResponseValueInnerIdentifiersInner.md b/docs/EInvoicing/V1/DirectorySearchResponseValueInnerIdentifiersInner.md new file mode 100644 index 0000000..6f23278 --- /dev/null +++ b/docs/EInvoicing/V1/DirectorySearchResponseValueInnerIdentifiersInner.md @@ -0,0 +1,14 @@ + + +# 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] | + + + diff --git a/docs/EInvoicing/V1/DirectorySearchResponseValueInnerSupportedDocumentTypesInner.md b/docs/EInvoicing/V1/DirectorySearchResponseValueInnerSupportedDocumentTypesInner.md new file mode 100644 index 0000000..9b0c641 --- /dev/null +++ b/docs/EInvoicing/V1/DirectorySearchResponseValueInnerSupportedDocumentTypesInner.md @@ -0,0 +1,16 @@ + + +# DirectorySearchResponseValueInnerSupportedDocumentTypesInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | Document type name. | [optional] | +|**value** | **String** | Document type identifier. | [optional] | +|**supportedByTradingPartner** | **Boolean** | Does trading partner support receiving this document type | [optional] | +|**supportedByAvalara** | **Boolean** | Does avalara support exchanging this document type | [optional] | + + + diff --git a/docs/EInvoicing/V1/DocumentFetch.md b/docs/EInvoicing/V1/DocumentFetch.md new file mode 100644 index 0000000..6365f61 --- /dev/null +++ b/docs/EInvoicing/V1/DocumentFetch.md @@ -0,0 +1,15 @@ + + +# 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] | +|**eventDateTime** | **String** | The date and time when the inbound document was accepted by the Avalara E-Invoicing Platform | [optional] | + + + diff --git a/docs/EInvoicing/V1/DocumentListResponse.md b/docs/EInvoicing/V1/DocumentListResponse.md index 27a121e..9a800d8 100644 --- a/docs/EInvoicing/V1/DocumentListResponse.md +++ b/docs/EInvoicing/V1/DocumentListResponse.md @@ -8,9 +8,9 @@ Returns the requested list of documents | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**atRecordSetCount** | **String** | Count of collections for the given date range | [optional] | +|**atRecordsetCount** | **String** | Count of collections for the given date range | [optional] | |**atNextLink** | **String** | | [optional] | -|**value** | [**List<DocumentSummary>**](DocumentSummary.md) | Array of invoices matching query parameters | | +|**value** | [**List<DocumentSummary>**](DocumentSummary.md) | Array of documents matching query parameters | | diff --git a/docs/EInvoicing/V1/DocumentStatusResponse.md b/docs/EInvoicing/V1/DocumentStatusResponse.md index 44b77c7..5988af3 100644 --- a/docs/EInvoicing/V1/DocumentStatusResponse.md +++ b/docs/EInvoicing/V1/DocumentStatusResponse.md @@ -9,7 +9,7 @@ Returns the current document ID and status | 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** | [**List<StatusEvent>**](StatusEvent.md) | | [optional] | diff --git a/docs/EInvoicing/V1/DocumentSummary.md b/docs/EInvoicing/V1/DocumentSummary.md index dc7e45a..22b477a 100644 --- a/docs/EInvoicing/V1/DocumentSummary.md +++ b/docs/EInvoicing/V1/DocumentSummary.md @@ -10,16 +10,18 @@ Displays a summary of information about the document |------------ | ------------- | ------------- | -------------| |**id** | **String** | The unique ID for this document | [optional] | |**processDateTime** | **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] | |**supplierName** | **String** | The name of the supplier in the transaction | [optional] | |**customerName** | **String** | The name of the customer in the transaction | [optional] | -|**documentNumber** | **String** | The invoice document number | [optional] | -|**documentDate** | **String** | The invoice issue date | [optional] | -|**flow** | **String** | The invoice direction, where issued = `out` and received = `in` | [optional] | -|**countryCode** | **String** | The two-letter ISO-3166 country code for the country where the e-invoice is being submitted | [optional] | +|**documentType** | **String** | The document type | [optional] | +|**documentVersion** | **String** | The document version | [optional] | +|**documentNumber** | **String** | The document number | [optional] | +|**documentDate** | **String** | The document issue date | [optional] | +|**flow** | **String** | The document direction, where issued = `out` and received = `in` | [optional] | +|**countryCode** | **String** | The two-letter ISO-3166 country code for the country where the document is being submitted | [optional] | |**countryMandate** | **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] | diff --git a/docs/EInvoicing/V1/DocumentsApi.md b/docs/EInvoicing/V1/DocumentsApi.md index 92a86fe..9e820d5 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 @@ -17,7 +18,7 @@ Method | HTTP request | Description 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 @@ -47,10 +48,10 @@ public class Example { ApiClient apiClient = new ApiClient(configuration); DocumentsApi apiInstance = new DocumentsApi(apiClient); - String avalaraVersion = "1.0"; // String | The HTTP Header meant to specify the version of the API intended to be used + String avalaraVersion = "1.2"; // String | The HTTP Header meant to specify the version of the API intended to be used String accept = "application/pdf"; // String | This header indicates the MIME type of the document String documentId = "documentId_example"; // String | The unique ID for this document that was returned in the POST /einvoicing/document response body - String xAvalaraClient = "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\" + String xAvalaraClient = "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 { File result = apiInstance.downloadDocument(avalaraVersion, accept, documentId, xAvalaraClient); System.out.println(result); @@ -73,7 +74,7 @@ Name | Type | Description | Notes **avalaraVersion** | **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 | **documentId** | **String**| The unique ID for this document that was returned in the POST /einvoicing/document response body | - **xAvalaraClient** | **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] + **xAvalaraClient** | **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 @@ -99,6 +100,91 @@ Name | Type | Description | Notes | **406** | Unsupported document format was requested in the Accept header | - | +## fetchDocuments + +> DocumentFetch fetchDocuments(avalaraVersion, fetchDocumentsRequest, xAvalaraClient) + +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 + +```java +// Import classes: +import Avalara.SDK.ApiClient; +import Avalara.SDK.ApiException; +import Avalara.SDK.Configuration; +import Avalara.SDK.auth.*; +import Avalara.SDK.models.*; +import Avalara.SDK.api.EInvoicing.V1.DocumentsApi; + +public class Example { + public static void main(String[] args) { + Configuration configuration = new Configuration(); + configuration.setAppName("Test"); + configuration.setAppVersion("1.0"); + configuration.setMachineName("LocalBox"); + configuration.setTimeout(5000); + configuration.setEnvironment(AvaTaxEnvironment.Sandbox); + // Configure HTTP basic authorization + configuration.setUsername("YOUR USERNAME"); + configuration.setPassword("YOUR PASSWORD"); + // Configure OAuth2 access token for authorization + configuration.setBearerToken("YOUR ACCESS TOKEN"); + + ApiClient apiClient = new ApiClient(configuration); + + DocumentsApi apiInstance = new DocumentsApi(apiClient); + String avalaraVersion = "1.2"; // String | The HTTP Header meant to specify the version of the API intended to be used + FetchDocumentsRequest fetchDocumentsRequest = new FetchDocumentsRequest(); // FetchDocumentsRequest | + String xAvalaraClient = "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 { + DocumentFetch result = apiInstance.fetchDocuments(avalaraVersion, fetchDocumentsRequest, xAvalaraClient); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DocumentsApi#fetchDocuments"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **avalaraVersion** | **String**| The HTTP Header meant to specify the version of the API intended to be used | + **fetchDocumentsRequest** | [**FetchDocumentsRequest**](FetchDocumentsRequest.md)| | + **xAvalaraClient** | **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 + +[**DocumentFetch**](DocumentFetch.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Accepted DocumentFetch Request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **500** | Internal Server Error | - | + + ## getDocumentList > DocumentListResponse getDocumentList(avalaraVersion, xAvalaraClient, startDate, endDate, flow, $count, $countOnly, $filter, $top, $skip) @@ -135,14 +221,14 @@ public class Example { ApiClient apiClient = new ApiClient(configuration); DocumentsApi apiInstance = new DocumentsApi(apiClient); - String avalaraVersion = "1.0"; // String | The HTTP Header meant to specify the version of the API intended to be used - String xAvalaraClient = "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\" + String avalaraVersion = "1.2"; // String | The HTTP Header meant to specify the version of the API intended to be used + String xAvalaraClient = "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. OffsetDateTime startDate = OffsetDateTime.now(); // OffsetDateTime | Start date of documents to return. This defaults to the previous month. OffsetDateTime endDate = OffsetDateTime.now(); // OffsetDateTime | End date of documents to return. This defaults to the current date. String flow = "out"; // String | Optionally filter by document direction, where issued = `out` and received = `in` String $count = "true"; // String | When set to true, the count of the collection is also returned in the response body String $countOnly = "false"; // String | When set to true, only the count of the collection is returned - String $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. + String $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. BigDecimal $top = new BigDecimal("10"); // BigDecimal | 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. String $skip = "10"; // String | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. try { @@ -165,7 +251,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **avalaraVersion** | **String**| The HTTP Header meant to specify the version of the API intended to be used | - **xAvalaraClient** | **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] + **xAvalaraClient** | **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] **startDate** | **OffsetDateTime**| Start date of documents to return. This defaults to the previous month. | [optional] **endDate** | **OffsetDateTime**| 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] @@ -234,9 +320,9 @@ public class Example { ApiClient apiClient = new ApiClient(configuration); DocumentsApi apiInstance = new DocumentsApi(apiClient); - String avalaraVersion = "1.0"; // String | The HTTP Header meant to specify the version of the API intended to be used + String avalaraVersion = "1.2"; // String | The HTTP Header meant to specify the version of the API intended to be used String documentId = "documentId_example"; // String | The unique ID for this document that was returned in the POST /einvoicing/documents response body - String xAvalaraClient = "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\" + String xAvalaraClient = "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 { DocumentStatusResponse result = apiInstance.getDocumentStatus(avalaraVersion, documentId, xAvalaraClient); System.out.println(result); @@ -258,7 +344,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **avalaraVersion** | **String**| The HTTP Header meant to specify the version of the API intended to be used | **documentId** | **String**| The unique ID for this document that was returned in the POST /einvoicing/documents response body | - **xAvalaraClient** | **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] + **xAvalaraClient** | **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 @@ -289,7 +375,7 @@ Name | Type | Description | Notes 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.<br><br>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.<br><br>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.<br><br>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.<br><br>Furthermore, the unique ID enables the download of a copy of the generated document for reference purposes. ### Example @@ -319,10 +405,10 @@ public class Example { ApiClient apiClient = new ApiClient(configuration); DocumentsApi apiInstance = new DocumentsApi(apiClient); - String avalaraVersion = "1.0"; // String | The HTTP Header meant to specify the version of the API intended to be used + String avalaraVersion = "1.2"; // String | The HTTP Header meant to specify the version of the API intended to be used SubmitDocumentMetadata metadata = new SubmitDocumentMetadata(); // SubmitDocumentMetadata | - SubmitDocumentData data = new SubmitDocumentData(); // SubmitDocumentData | - String xAvalaraClient = "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\" + Object data = null; // Object | The document to be submitted, as indicated by the metadata fields 'dataFormat' and 'dataFormatVersion' + String xAvalaraClient = "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 { DocumentSubmitResponse result = apiInstance.submitDocument(avalaraVersion, metadata, data, xAvalaraClient); System.out.println(result); @@ -344,8 +430,8 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **avalaraVersion** | **String**| The HTTP Header meant to specify the version of the API intended to be used | **metadata** | [**SubmitDocumentMetadata**](SubmitDocumentMetadata.md)| | - **data** | [**SubmitDocumentData**](SubmitDocumentData.md)| | - **xAvalaraClient** | **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** | [**Object**](Object.md)| The document to be submitted, as indicated by the metadata fields 'dataFormat' and 'dataFormatVersion' | + **xAvalaraClient** | **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/ErrorResponse.md b/docs/EInvoicing/V1/ErrorResponse.md new file mode 100644 index 0000000..5cea52d --- /dev/null +++ b/docs/EInvoicing/V1/ErrorResponse.md @@ -0,0 +1,16 @@ + + +# ErrorResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**title** | **String** | | [optional] | +|**status** | **String** | | [optional] | +|**detail** | **String** | | [optional] | +|**instance** | **String** | | [optional] | + + + diff --git a/docs/EInvoicing/V1/FetchDocumentsRequest.md b/docs/EInvoicing/V1/FetchDocumentsRequest.md new file mode 100644 index 0000000..11615a8 --- /dev/null +++ b/docs/EInvoicing/V1/FetchDocumentsRequest.md @@ -0,0 +1,14 @@ + + +# FetchDocumentsRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**List<FetchDocumentsRequestDataInner>**](FetchDocumentsRequestDataInner.md) | Array of key-value pairs used to retrieve inbound documents from the Tax Authority | [optional] | +|**metadata** | [**FetchDocumentsRequestMetadata**](FetchDocumentsRequestMetadata.md) | | [optional] | + + + diff --git a/docs/EInvoicing/V1/FetchDocumentsRequestDataInner.md b/docs/EInvoicing/V1/FetchDocumentsRequestDataInner.md new file mode 100644 index 0000000..ff388a3 --- /dev/null +++ b/docs/EInvoicing/V1/FetchDocumentsRequestDataInner.md @@ -0,0 +1,14 @@ + + +# FetchDocumentsRequestDataInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**key** | **String** | Descriptor of the identifier | | +|**value** | **String** | Value of the identifier | | + + + diff --git a/docs/EInvoicing/V1/FetchDocumentsRequestMetadata.md b/docs/EInvoicing/V1/FetchDocumentsRequestMetadata.md new file mode 100644 index 0000000..983d8f9 --- /dev/null +++ b/docs/EInvoicing/V1/FetchDocumentsRequestMetadata.md @@ -0,0 +1,17 @@ + + +# FetchDocumentsRequestMetadata + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**workflowId** | **String** | Specifies a unique ID for this workflow. | | +|**dataFormat** | **String** | Specifies the data format for this workflow | | +|**dataFormatVersion** | **BigDecimal** | Specifies the data format version number | | +|**countryCode** | **String** | The two-letter ISO-3166 country code for the country for which document is being retrieved | | +|**countryMandate** | **String** | The e-invoicing mandate for the specified country | | + + + diff --git a/docs/EInvoicing/V1/InputDataFormats.md b/docs/EInvoicing/V1/InputDataFormats.md index cfc6e4e..3137446 100644 --- a/docs/EInvoicing/V1/InputDataFormats.md +++ b/docs/EInvoicing/V1/InputDataFormats.md @@ -8,7 +8,7 @@ Format and version used when inputting the data | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**format** | **String** | Invoice format | [optional] | +|**format** | **String** | Document format | [optional] | |**versions** | **List<String>** | | [optional] | diff --git a/docs/EInvoicing/V1/InteropApi.md b/docs/EInvoicing/V1/InteropApi.md new file mode 100644 index 0000000..1076b51 --- /dev/null +++ b/docs/EInvoicing/V1/InteropApi.md @@ -0,0 +1,101 @@ +# 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 + +> SubmitInteropDocument202Response submitInteropDocument(documentType, interchangeType, avalaraVersion, xAvalaraClient, xCorrelationID, fileName) + +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 + +```java +// Import classes: +import Avalara.SDK.ApiClient; +import Avalara.SDK.ApiException; +import Avalara.SDK.Configuration; +import Avalara.SDK.auth.*; +import Avalara.SDK.models.*; +import Avalara.SDK.api.EInvoicing.V1.InteropApi; + +public class Example { + public static void main(String[] args) { + Configuration configuration = new Configuration(); + configuration.setAppName("Test"); + configuration.setAppVersion("1.0"); + configuration.setMachineName("LocalBox"); + configuration.setTimeout(5000); + configuration.setEnvironment(AvaTaxEnvironment.Sandbox); + // Configure HTTP basic authorization + configuration.setUsername("YOUR USERNAME"); + configuration.setPassword("YOUR PASSWORD"); + // Configure OAuth2 access token for authorization + configuration.setBearerToken("YOUR ACCESS TOKEN"); + + ApiClient apiClient = new ApiClient(configuration); + + InteropApi apiInstance = new InteropApi(apiClient); + String documentType = "ubl-invoice-2.1"; // String | Type of the document being uploaded. Partners will be configured in Avalara system to send only certain types of documents. + String interchangeType = "FI-B2B"; // 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. + String avalaraVersion = "1.2"; // String | The HTTP Header meant to specify the version of the API intended to be used + String xAvalaraClient = "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\" + String xCorrelationID = "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 fileName = new File("/path/to/file"); // File | The file to be uploaded (e.g., UBL XML, CII XML). + try { + SubmitInteropDocument202Response result = apiInstance.submitInteropDocument(documentType, interchangeType, avalaraVersion, xAvalaraClient, xCorrelationID, fileName); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling InteropApi#submitInteropDocument"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **documentType** | **String**| Type of the document being uploaded. Partners will be configured in Avalara system to send only certain types of documents. | [enum: ubl-invoice-2.1, ubl-creditnote-2.1, ubl-applicationresponse-2.1] + **interchangeType** | **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. | [enum: FI-B2B, FI-B2C, FI-B2G] + **avalaraVersion** | **String**| The HTTP Header meant to specify the version of the API intended to be used | + **xAvalaraClient** | **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] + **xCorrelationID** | **String**| The caller can use this as an identifier to use as a correlation id to trace the call. | [optional] + **fileName** | **File**| The file to be uploaded (e.g., UBL XML, CII XML). | [optional] + +### Return type + +[**SubmitInteropDocument202Response**](SubmitInteropDocument202Response.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **202** | Document Accepted. This doesn't mean it is processed. This is just a transport ack. | * X-Correlation-ID -
| +| **400** | Bad/Invalid Request. | * X-Correlation-Id -
| +| **401** | Unauthorized | * X-Correlation-Id -
| +| **403** | Forbidden | * X-Correlation-Id -
| +| **500** | Internal server error | * X-Correlation-Id -
| + diff --git a/docs/EInvoicing/V1/Mandate.md b/docs/EInvoicing/V1/Mandate.md index 4135bc2..a91a04a 100644 --- a/docs/EInvoicing/V1/Mandate.md +++ b/docs/EInvoicing/V1/Mandate.md @@ -7,8 +7,8 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**mandateId** | **String** | Mandate UUID | [optional] | -|**countryMandate** | **String** | Country mandate name | [optional] | +|**mandateId** | **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] | +|**countryMandate** | **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] | |**countryCode** | **String** | Country code | [optional] | |**description** | **String** | Mandate description | [optional] | |**supportedByPartnerAPI** | **Boolean** | Indicates whether this mandate supported by the partner API | [optional] | diff --git a/docs/EInvoicing/V1/MandateDataInputField.md b/docs/EInvoicing/V1/MandateDataInputField.md new file mode 100644 index 0000000..e8f7514 --- /dev/null +++ b/docs/EInvoicing/V1/MandateDataInputField.md @@ -0,0 +1,27 @@ + + +# MandateDataInputField + +The Data Input Field + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**fieldId** | **String** | Field ID | [optional] | +|**documentType** | **String** | The document type | [optional] | +|**documentVersion** | **String** | The document version | [optional] | +|**path** | **String** | Path to this field | [optional] | +|**pathType** | **String** | The type of path | [optional] | +|**fieldName** | **String** | Field name | [optional] | +|**namespace** | [**MandateDataInputFieldNamespace**](MandateDataInputFieldNamespace.md) | | [optional] | +|**exampleOrFixedValue** | **String** | An example of the content for this field | [optional] | +|**acceptedValues** | **List<String>** | An Array representing the acceptable values for this field | [optional] | +|**documentationLink** | **String** | An example of the content for this field | [optional] | +|**dataType** | **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] | + + + diff --git a/docs/EInvoicing/V1/MandateDataInputFieldNamespace.md b/docs/EInvoicing/V1/MandateDataInputFieldNamespace.md new file mode 100644 index 0000000..8420339 --- /dev/null +++ b/docs/EInvoicing/V1/MandateDataInputFieldNamespace.md @@ -0,0 +1,15 @@ + + +# MandateDataInputFieldNamespace + +The namespace of the UBL element + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**prefix** | **String** | The namespace prefix for the UBL Element | [optional] | +|**value** | **String** | | [optional] | + + + diff --git a/docs/EInvoicing/V1/MandatesApi.md b/docs/EInvoicing/V1/MandatesApi.md index a377500..5e141f1 100644 --- a/docs/EInvoicing/V1/MandatesApi.md +++ b/docs/EInvoicing/V1/MandatesApi.md @@ -4,10 +4,102 @@ 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 + +> List<MandateDataInputField> getMandateDataInputFields(avalaraVersion, mandateId, documentType, documentVersion, xAvalaraClient) + +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 <code>/mandates</code> 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 + +```java +// Import classes: +import Avalara.SDK.ApiClient; +import Avalara.SDK.ApiException; +import Avalara.SDK.Configuration; +import Avalara.SDK.auth.*; +import Avalara.SDK.models.*; +import Avalara.SDK.api.EInvoicing.V1.MandatesApi; + +public class Example { + public static void main(String[] args) { + Configuration configuration = new Configuration(); + configuration.setAppName("Test"); + configuration.setAppVersion("1.0"); + configuration.setMachineName("LocalBox"); + configuration.setTimeout(5000); + configuration.setEnvironment(AvaTaxEnvironment.Sandbox); + // Configure HTTP basic authorization + configuration.setUsername("YOUR USERNAME"); + configuration.setPassword("YOUR PASSWORD"); + // Configure OAuth2 access token for authorization + configuration.setBearerToken("YOUR ACCESS TOKEN"); + + ApiClient apiClient = new ApiClient(configuration); + + MandatesApi apiInstance = new MandatesApi(apiClient); + String avalaraVersion = "1.2"; // String | The HTTP Header meant to specify the version of the API intended to be used + String mandateId = "AD-B2G-PEPPOL"; // String | The unique ID for the mandate that was returned in the GET /einvoicing/mandates response body + String documentType = "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) + String documentVersion = "2.1"; // String | Select the document version of the documentType (You may obtain the supported documentVersion from the GET /mandates endpoint) + String xAvalaraClient = "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 { + List result = apiInstance.getMandateDataInputFields(avalaraVersion, mandateId, documentType, documentVersion, xAvalaraClient); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling MandatesApi#getMandateDataInputFields"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **avalaraVersion** | **String**| The HTTP Header meant to specify the version of the API intended to be used | + **mandateId** | **String**| The unique ID for the mandate that was returned in the GET /einvoicing/mandates response body | + **documentType** | **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) | + **documentVersion** | **String**| Select the document version of the documentType (You may obtain the supported documentVersion from the GET /mandates endpoint) | + **xAvalaraClient** | **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 + +[**List<MandateDataInputField>**](MandateDataInputField.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request | - | +| **401** | Unauthorized | - | +| **403** | Forbidden | - | +| **404** | Resource not found | - | +| **500** | Internal Server Error | - | + + ## getMandates > MandatesResponse getMandates(avalaraVersion, xAvalaraClient, $filter, $top, $skip, $count, $countOnly) @@ -44,8 +136,8 @@ public class Example { ApiClient apiClient = new ApiClient(configuration); MandatesApi apiInstance = new MandatesApi(apiClient); - String avalaraVersion = "1.0"; // String | The HTTP Header meant to specify the version of the API intended to be used - String xAvalaraClient = "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\" + String avalaraVersion = "1.2"; // String | The HTTP Header meant to specify the version of the API intended to be used + String xAvalaraClient = "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. String $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. BigDecimal $top = new BigDecimal("10"); // BigDecimal | 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. BigDecimal $skip = new BigDecimal("10"); // BigDecimal | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. @@ -71,7 +163,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **avalaraVersion** | **String**| The HTTP Header meant to specify the version of the API intended to be used | - **xAvalaraClient** | **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] + **xAvalaraClient** | **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** | **BigDecimal**| 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** | **BigDecimal**| 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/MandatesResponse.md b/docs/EInvoicing/V1/MandatesResponse.md index 228a564..750aa89 100644 --- a/docs/EInvoicing/V1/MandatesResponse.md +++ b/docs/EInvoicing/V1/MandatesResponse.md @@ -8,9 +8,9 @@ Mandate list response schema | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**atRecordSetCount** | **BigDecimal** | Total count of results | [optional] | +|**atRecordsetCount** | **BigDecimal** | Total count of results | [optional] | |**atNextLink** | **String** | | [optional] | -|**value** | [**List<Mandate>**](Mandate.md) | Mandates schema | [optional] | +|**value** | **List<Mandate>** | Mandates schema | [optional] | diff --git a/docs/EInvoicing/V1/StatusEvent.md b/docs/EInvoicing/V1/StatusEvent.md index 6e6f69d..c22217e 100644 --- a/docs/EInvoicing/V1/StatusEvent.md +++ b/docs/EInvoicing/V1/StatusEvent.md @@ -10,6 +10,8 @@ Displays when a status event occurred |------------ | ------------- | ------------- | -------------| |**eventDateTime** | **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] | +|**responseKey** | **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] | +|**responseValue** | **String** | The corresponding value associated with the response key. This value is provided by the tax authority in response to the event. | [optional] | diff --git a/docs/EInvoicing/V1/SubmitDocumentMetadata.md b/docs/EInvoicing/V1/SubmitDocumentMetadata.md index 90b6618..865bdc5 100644 --- a/docs/EInvoicing/V1/SubmitDocumentMetadata.md +++ b/docs/EInvoicing/V1/SubmitDocumentMetadata.md @@ -2,7 +2,7 @@ # SubmitDocumentMetadata -Key value pairs of metadata for a document submission. dataFormat can be ubl-invoice or ubl-creditnote:
{  \"workflowId\": \"partner-einvoicing\", \"dataFormat\": \"ubl-invoice\", \"dataFormatVersion\": \"2.1\", \"countryCode\": \"SA\", \"countryMandate\": \"SA-Phase1-B2B\" }

+Key value pairs of metadata for a document submission
{  \"workflowId\": \"partner-einvoicing\", \"dataFormat\": \"ubl-invoice\", \"dataFormatVersion\": \"2.1\", \"countryCode\": \"SA\", \"countryMandate\": \"SA-Phase1-B2B\" }

## Properties @@ -11,7 +11,7 @@ Key value pairs of metadata for a document submission. dataFormat can be ubl-inv |**workflowId** | **String** | Specifies a unique ID for this workflow. | | |**dataFormat** | **String** | Specifies the data format for this workflow. | | |**dataFormatVersion** | **String** | Specifies the data format version number. | | -|**countryCode** | **String** | The two-letter ISO-3166 country code for the country where the e-invoice is being submitted | | +|**countryCode** | **String** | The two-letter ISO-3166 country code for the country where the document is being submitted | | |**countryMandate** | **String** | The e-invoicing mandate for the specified country. | | diff --git a/docs/EInvoicing/V1/SubmitInteropDocument202Response.md b/docs/EInvoicing/V1/SubmitInteropDocument202Response.md new file mode 100644 index 0000000..2ae7572 --- /dev/null +++ b/docs/EInvoicing/V1/SubmitInteropDocument202Response.md @@ -0,0 +1,14 @@ + + +# SubmitInteropDocument202Response + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**interchangeId** | **String** | The unique interchange ID for this submission. | [optional] | +|**message** | **String** | A message indicating that the document has been accepted. | [optional] | + + + diff --git a/docs/EInvoicing/V1/TradingPartnersApi.md b/docs/EInvoicing/V1/TradingPartnersApi.md new file mode 100644 index 0000000..5ccc284 --- /dev/null +++ b/docs/EInvoicing/V1/TradingPartnersApi.md @@ -0,0 +1,472 @@ +# 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 + +> batchSearchParticipants(avalaraVersion, name, notificationEmail, _file, xAvalaraClient, xCorrelationID) + +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 + +```java +// Import classes: +import Avalara.SDK.ApiClient; +import Avalara.SDK.ApiException; +import Avalara.SDK.Configuration; +import Avalara.SDK.auth.*; +import Avalara.SDK.models.*; +import Avalara.SDK.api.EInvoicing.V1.TradingPartnersApi; + +public class Example { + public static void main(String[] args) { + Configuration configuration = new Configuration(); + configuration.setAppName("Test"); + configuration.setAppVersion("1.0"); + configuration.setMachineName("LocalBox"); + configuration.setTimeout(5000); + configuration.setEnvironment(AvaTaxEnvironment.Sandbox); + // Configure HTTP basic authorization + configuration.setUsername("YOUR USERNAME"); + configuration.setPassword("YOUR PASSWORD"); + // Configure OAuth2 access token for authorization + configuration.setBearerToken("YOUR ACCESS TOKEN"); + + ApiClient apiClient = new ApiClient(configuration); + + TradingPartnersApi apiInstance = new TradingPartnersApi(apiClient); + String avalaraVersion = "1.2"; // String | The HTTP Header meant to specify the version of the API intended to be used + String name = "Automotive Companies in London Search"; // String | The human readable name given to this batch search. + String notificationEmail = "user@example.com"; // String | The email address of the user to whom the batch search completion notification must go to. + File _file = new File("/path/to/file"); // File | CSV file containing search parameters. + String xAvalaraClient = "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\" + String xCorrelationID = "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(avalaraVersion, name, notificationEmail, _file, xAvalaraClient, xCorrelationID); + } catch (ApiException e) { + System.err.println("Exception when calling TradingPartnersApi#batchSearchParticipants"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **avalaraVersion** | **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. | + **notificationEmail** | **String**| The email address of the user to whom the batch search completion notification must go to. | + **_file** | **File**| CSV file containing search parameters. | + **xAvalaraClient** | **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] + **xCorrelationID** | **String**| The caller can use this as an identifier to use as a correlation id to trace the call. | [optional] + +### Return type + +null (empty response body) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **202** | Batch search file accepted for processing the search. | * X-Correlation-Id -
| +| **400** | Invalid request | * X-Correlation-Id -
| +| **401** | Unauthorized | * X-Correlation-Id -
| +| **403** | Forbidden | * X-Correlation-Id -
| +| **500** | Internal server error | * X-Correlation-Id -
| + + +## downloadBatchSearchReport + +> File downloadBatchSearchReport(avalaraVersion, id, xAvalaraClient, xCorrelationID) + +Download batch search results in a csv file. + +Downloads the report for a specific batch search using the batch search ID. + +### Example + +```java +// Import classes: +import Avalara.SDK.ApiClient; +import Avalara.SDK.ApiException; +import Avalara.SDK.Configuration; +import Avalara.SDK.auth.*; +import Avalara.SDK.models.*; +import Avalara.SDK.api.EInvoicing.V1.TradingPartnersApi; + +public class Example { + public static void main(String[] args) { + Configuration configuration = new Configuration(); + configuration.setAppName("Test"); + configuration.setAppVersion("1.0"); + configuration.setMachineName("LocalBox"); + configuration.setTimeout(5000); + configuration.setEnvironment(AvaTaxEnvironment.Sandbox); + // Configure HTTP basic authorization + configuration.setUsername("YOUR USERNAME"); + configuration.setPassword("YOUR PASSWORD"); + // Configure OAuth2 access token for authorization + configuration.setBearerToken("YOUR ACCESS TOKEN"); + + ApiClient apiClient = new ApiClient(configuration); + + TradingPartnersApi apiInstance = new TradingPartnersApi(apiClient); + String avalaraVersion = "1.2"; // String | The HTTP Header meant to specify the version of the API intended to be used + String id = "2f5ea4b5-4dae-445a-b3e4-9f65a61eaa99"; // String | The ID of the batch search whose report is to be downloaded. + String xAvalaraClient = "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\" + String xCorrelationID = "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 { + File result = apiInstance.downloadBatchSearchReport(avalaraVersion, id, xAvalaraClient, xCorrelationID); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TradingPartnersApi#downloadBatchSearchReport"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **avalaraVersion** | **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. | + **xAvalaraClient** | **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] + **xCorrelationID** | **String**| The caller can use this as an identifier to use as a correlation id to trace the call. | [optional] + +### Return type + +[**File**](File.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: text/csv, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful report download | * X-Correlation-Id -
| +| **401** | Unauthorized | * X-Correlation-Id -
| +| **403** | Forbidden | * X-Correlation-Id -
| +| **404** | Report not found | * X-Correlation-Id -
| +| **500** | Internal server error | * X-Correlation-Id -
| + + +## getBatchSearchDetail + +> BatchSearch getBatchSearchDetail(avalaraVersion, id, xAvalaraClient, xCorrelationID) + +Get the batch search details for a given id. + +Get the batch search details for a given id. + +### Example + +```java +// Import classes: +import Avalara.SDK.ApiClient; +import Avalara.SDK.ApiException; +import Avalara.SDK.Configuration; +import Avalara.SDK.auth.*; +import Avalara.SDK.models.*; +import Avalara.SDK.api.EInvoicing.V1.TradingPartnersApi; + +public class Example { + public static void main(String[] args) { + Configuration configuration = new Configuration(); + configuration.setAppName("Test"); + configuration.setAppVersion("1.0"); + configuration.setMachineName("LocalBox"); + configuration.setTimeout(5000); + configuration.setEnvironment(AvaTaxEnvironment.Sandbox); + // Configure HTTP basic authorization + configuration.setUsername("YOUR USERNAME"); + configuration.setPassword("YOUR PASSWORD"); + // Configure OAuth2 access token for authorization + configuration.setBearerToken("YOUR ACCESS TOKEN"); + + ApiClient apiClient = new ApiClient(configuration); + + TradingPartnersApi apiInstance = new TradingPartnersApi(apiClient); + String avalaraVersion = "1.2"; // String | The HTTP Header meant to specify the version of the API intended to be used + String id = "2f5ea4b5-4dae-445a-b3e4-9f65a61eaa99"; // String | The ID of the batch search that was submitted earlier. + String xAvalaraClient = "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\" + String xCorrelationID = "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 { + BatchSearch result = apiInstance.getBatchSearchDetail(avalaraVersion, id, xAvalaraClient, xCorrelationID); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TradingPartnersApi#getBatchSearchDetail"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **avalaraVersion** | **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. | + **xAvalaraClient** | **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] + **xCorrelationID** | **String**| The caller can use this as an identifier to use as a correlation id to trace the call. | [optional] + +### Return type + +[**BatchSearch**](BatchSearch.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Get the batch search details for a given id. | * X-Correlation-Id -
| +| **401** | Unauthorized | * X-Correlation-Id -
| +| **403** | Forbidden | * X-Correlation-Id -
| +| **500** | Internal server error | * X-Correlation-Id -
| + + +## listBatchSearches + +> BatchSearchListResponse listBatchSearches(avalaraVersion, xAvalaraClient, $filter, count, $top, $skip, $orderBy, xCorrelationID) + +List all batch searches that were previously submitted. + +Retrieves all batch searches performed by the user. + +### Example + +```java +// Import classes: +import Avalara.SDK.ApiClient; +import Avalara.SDK.ApiException; +import Avalara.SDK.Configuration; +import Avalara.SDK.auth.*; +import Avalara.SDK.models.*; +import Avalara.SDK.api.EInvoicing.V1.TradingPartnersApi; + +public class Example { + public static void main(String[] args) { + Configuration configuration = new Configuration(); + configuration.setAppName("Test"); + configuration.setAppVersion("1.0"); + configuration.setMachineName("LocalBox"); + configuration.setTimeout(5000); + configuration.setEnvironment(AvaTaxEnvironment.Sandbox); + // Configure HTTP basic authorization + configuration.setUsername("YOUR USERNAME"); + configuration.setPassword("YOUR PASSWORD"); + // Configure OAuth2 access token for authorization + configuration.setBearerToken("YOUR ACCESS TOKEN"); + + ApiClient apiClient = new ApiClient(configuration); + + TradingPartnersApi apiInstance = new TradingPartnersApi(apiClient); + String avalaraVersion = "1.2"; // String | The HTTP Header meant to specify the version of the API intended to be used + String xAvalaraClient = "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\" + String $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. + Boolean count = true; // Boolean | When set to true, the count of the collection is included as @recordSetCount in the response body. + String $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. + String $skip = "10"; // String | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. + String $orderBy = "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. + String xCorrelationID = "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 { + BatchSearchListResponse result = apiInstance.listBatchSearches(avalaraVersion, xAvalaraClient, $filter, count, $top, $skip, $orderBy, xCorrelationID); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TradingPartnersApi#listBatchSearches"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **avalaraVersion** | **String**| The HTTP Header meant to specify the version of the API intended to be used | + **xAvalaraClient** | **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** | **Boolean**| 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] + **$orderBy** | **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] + **xCorrelationID** | **String**| The caller can use this as an identifier to use as a correlation id to trace the call. | [optional] + +### Return type + +[**BatchSearchListResponse**](BatchSearchListResponse.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | List of batch searches | * X-Correlation-Id -
| +| **401** | Unauthorized | * X-Correlation-Id -
| +| **403** | Forbidden | * X-Correlation-Id -
| +| **500** | Internal server error | * X-Correlation-Id -
| + + +## searchParticipants + +> DirectorySearchResponse searchParticipants(avalaraVersion, $search, xAvalaraClient, count, $filter, $top, $skip, $orderBy, xCorrelationID) + +Returns a list of participants matching the input query. + +Returns a list of participants matching the input query. + +### Example + +```java +// Import classes: +import Avalara.SDK.ApiClient; +import Avalara.SDK.ApiException; +import Avalara.SDK.Configuration; +import Avalara.SDK.auth.*; +import Avalara.SDK.models.*; +import Avalara.SDK.api.EInvoicing.V1.TradingPartnersApi; + +public class Example { + public static void main(String[] args) { + Configuration configuration = new Configuration(); + configuration.setAppName("Test"); + configuration.setAppVersion("1.0"); + configuration.setMachineName("LocalBox"); + configuration.setTimeout(5000); + configuration.setEnvironment(AvaTaxEnvironment.Sandbox); + // Configure HTTP basic authorization + configuration.setUsername("YOUR USERNAME"); + configuration.setPassword("YOUR PASSWORD"); + // Configure OAuth2 access token for authorization + configuration.setBearerToken("YOUR ACCESS TOKEN"); + + ApiClient apiClient = new ApiClient(configuration); + + TradingPartnersApi apiInstance = new TradingPartnersApi(apiClient); + String avalaraVersion = "1.2"; // String | The HTTP Header meant to specify the version of the API intended to be used + String $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. + String xAvalaraClient = "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\" + Boolean count = true; // Boolean | When set to true, the count of the collection is included as @recordSetCount in the response body. + String $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. + String $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. + String $skip = "10"; // String | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. + String $orderBy = "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. + String xCorrelationID = "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 { + DirectorySearchResponse result = apiInstance.searchParticipants(avalaraVersion, $search, xAvalaraClient, count, $filter, $top, $skip, $orderBy, xCorrelationID); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TradingPartnersApi#searchParticipants"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **avalaraVersion** | **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. | + **xAvalaraClient** | **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** | **Boolean**| 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] + **$orderBy** | **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] + **xCorrelationID** | **String**| The caller can use this as an identifier to use as a correlation id to trace the call. | [optional] + +### Return type + +[**DirectorySearchResponse**](DirectorySearchResponse.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | * X-Correlation-Id -
| +| **400** | Bad request | * X-Correlation-Id -
| +| **401** | Unauthorized | * X-Correlation-Id -
| +| **403** | Forbidden | * X-Correlation-Id -
| +| **500** | Internal server error | * X-Correlation-Id -
| + diff --git a/pom.xml b/pom.xml index fb2165b..836be1c 100644 --- a/pom.xml +++ b/pom.xml @@ -1,17 +1,17 @@ 4.0.0 - net.avalara - avalara-sdk + Avalara.SDK + Avalara.SDK jar Avalara.SDK - 24.2.29 - https://github.com/avadev/Avalara-SDK-Java + + https://github.com/avasachinbaijal/AvaTax-REST-V3-JRE-SDK OpenAPI Java - git@github.com:avadev/Avalara-SDK-Java.git - git@github.com:avadev/Avalara-SDK-Java.git - https://github.com/avadev/Avalara-SDK-Java + git@github.com:avasachinbaijal/AvaTax-REST-V3-JRE-SDK.git + git@github.com:avasachinbaijal/AvaTax-REST-V3-JRE-SDK.git + https://github.com/avasachinbaijal/AvaTax-REST-V3-JRE-SDK @@ -24,8 +24,8 @@ - Jonathan Wenger - jonathan.wenger@avalara.com + SachinBaijal + sachin.baijal@avalara.com Avalara https://developer.avalara.com/ @@ -36,17 +36,6 @@ https://developer.avalara.com/ - - - ossrh - https://oss.sonatype.org/content/repositories/snapshots - - - ossrh - https://oss.sonatype.org/service/local/staging/deploy/maven2/ - - - @@ -237,23 +226,33 @@ - - org.apache.maven.plugins - maven-gpg-plugin - 3.2.1 - - - sign-artifacts - verify - - sign - - - - + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.0.1 + + + sign-artifacts + verify + + sign + + + + + + + + + io.swagger @@ -296,11 +295,6 @@ joda-time ${jodatime-version} - - org.threeten - threetenbp - ${threetenbp-version} - jakarta.annotation jakarta.annotation-api @@ -335,11 +329,6 @@ 3.12.4 test - - io.github.cdimascio - dotenv-java - 3.0.0 - 1.8 @@ -352,8 +341,7 @@ 3.12.0 0.2.6 2.10.9 - 1.5.0 - 9.43.3 + 9.43.4 1.3.5 2.1.1 4.13.2 diff --git a/src/main/java/Avalara/SDK/JSON.java b/src/main/java/Avalara/SDK/JSON.java index fbd2856..3f85273 100644 --- a/src/main/java/Avalara/SDK/JSON.java +++ b/src/main/java/Avalara/SDK/JSON.java @@ -10,9 +10,9 @@ import com.google.gson.JsonElement; import io.gsonfire.GsonFireBuilder; import io.gsonfire.TypeSelector; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.format.DateTimeFormatter; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import Avalara.SDK.model.EInvoicing.V1.*; import okio.ByteString; diff --git a/src/main/java/Avalara/SDK/api/EInvoicing/V1/DataInputFieldsApi.java b/src/main/java/Avalara/SDK/api/EInvoicing/V1/DataInputFieldsApi.java index 0355e1f..f708ee3 100644 --- a/src/main/java/Avalara/SDK/api/EInvoicing/V1/DataInputFieldsApi.java +++ b/src/main/java/Avalara/SDK/api/EInvoicing/V1/DataInputFieldsApi.java @@ -28,6 +28,8 @@ import Avalara.SDK.Pair; import Avalara.SDK.ProgressRequestBody; import Avalara.SDK.ProgressResponseBody; +import Avalara.SDK.AvalaraMicroservice; + import com.google.gson.reflect.TypeToken; @@ -112,7 +114,7 @@ public okhttp3.Call getDataInputFieldsCall(GetDataInputFieldsRequest requestPara Object localVarPostBody = null; // create path and map variables - String localVarPath = "/einvoicing/data-input-fields"; + String localVarPath = "/data-input-fields"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -121,7 +123,7 @@ public okhttp3.Call getDataInputFieldsCall(GetDataInputFieldsRequest requestPara Map localVarFormParams = new HashMap(); // Set avalara-version header from swagger.json version number - localVarHeaderParams.put("avalara-version", "1.0"); + localVarHeaderParams.put("avalara-version", "1.2"); if (requestParameters.get$filter() != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("$filter", requestParameters.get$filter())); @@ -166,7 +168,7 @@ public okhttp3.Call getDataInputFieldsCall(GetDataInputFieldsRequest requestPara if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "Bearer" }; + String[] localVarAuthNames = new String[] { "OAuth", "Bearer" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback, requiredScopes); } @@ -185,7 +187,7 @@ private okhttp3.Call getDataInputFieldsValidateBeforeCall(GetDataInputFieldsRequ } /** - * 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 <code>mandates</code> endpoint to retrieve all available country mandates. You can use the $filter query parameter to retrieve fields for a particular mandate * @param requestOptions Object which represents the options available for a given API/request * @return DataInputFieldsResponse @@ -205,7 +207,7 @@ public DataInputFieldsResponse getDataInputFields(GetDataInputFieldsRequest requ } /** - * 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 <code>mandates</code> endpoint to retrieve all available country mandates. You can use the $filter query parameter to retrieve fields for a particular mandate * @param requestOptions Object which represents the options available for a given API/request * @return ApiResponse<DataInputFieldsResponse> @@ -226,7 +228,7 @@ public ApiResponse getDataInputFieldsWithHttpInfo(GetDa } /** - * Returns the mandatory and conditional invoice or creditnote input fields for different country mandates (asynchronously) + * Returns the optionality of document fields for different country mandates (asynchronously) * This endpoint provides a list of required, conditional, and optional fields for each country mandate. You can use the <code>mandates</code> endpoint to retrieve all available country mandates. You can use the $filter query parameter to retrieve fields for a particular mandate * @param requestOptions Object which represents the options available for a given API/request * @param _callback The callback to be executed when the API call finishes @@ -252,7 +254,7 @@ public okhttp3.Call getDataInputFieldsAsync(GetDataInputFieldsRequest requestPar * Represents the Request object for the GetDataInputFields API * * @param avalaraVersion The HTTP Header meant to specify the version of the API intended to be used - * @param xAvalaraClient 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 xAvalaraClient 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 $filter 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. (optional) * @param $top 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. (optional) * @param $skip If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. (optional) diff --git a/src/main/java/Avalara/SDK/api/EInvoicing/V1/DocumentsApi.java b/src/main/java/Avalara/SDK/api/EInvoicing/V1/DocumentsApi.java index 816d576..83c9046 100644 --- a/src/main/java/Avalara/SDK/api/EInvoicing/V1/DocumentsApi.java +++ b/src/main/java/Avalara/SDK/api/EInvoicing/V1/DocumentsApi.java @@ -28,6 +28,8 @@ import Avalara.SDK.Pair; import Avalara.SDK.ProgressRequestBody; import Avalara.SDK.ProgressResponseBody; +import Avalara.SDK.AvalaraMicroservice; + import com.google.gson.reflect.TypeToken; @@ -38,15 +40,17 @@ import Avalara.SDK.model.EInvoicing.V1.BadDownloadRequest; import Avalara.SDK.model.EInvoicing.V1.BadRequest; import java.math.BigDecimal; +import Avalara.SDK.model.EInvoicing.V1.DocumentFetch; import Avalara.SDK.model.EInvoicing.V1.DocumentListResponse; import Avalara.SDK.model.EInvoicing.V1.DocumentStatusResponse; import Avalara.SDK.model.EInvoicing.V1.DocumentSubmissionError; import Avalara.SDK.model.EInvoicing.V1.DocumentSubmitResponse; +import Avalara.SDK.model.EInvoicing.V1.FetchDocumentsRequest; import java.io.File; import Avalara.SDK.model.EInvoicing.V1.ForbiddenError; +import Avalara.SDK.model.EInvoicing.V1.InternalServerError; import Avalara.SDK.model.EInvoicing.V1.NotFoundError; import java.time.OffsetDateTime; -import Avalara.SDK.model.EInvoicing.V1.SubmitDocumentData; import Avalara.SDK.model.EInvoicing.V1.SubmitDocumentMetadata; import java.lang.reflect.Type; @@ -122,7 +126,7 @@ public okhttp3.Call downloadDocumentCall(DownloadDocumentRequest requestParamete Object localVarPostBody = null; // create path and map variables - String localVarPath = "/einvoicing/documents/{documentId}/$download" + String localVarPath = "/documents/{documentId}/$download" .replaceAll("\\{" + "documentId" + "\\}", localVarApiClient.escapeString(requestParameters.documentId.toString())); List localVarQueryParams = new ArrayList(); @@ -132,7 +136,7 @@ public okhttp3.Call downloadDocumentCall(DownloadDocumentRequest requestParamete Map localVarFormParams = new HashMap(); // Set avalara-version header from swagger.json version number - localVarHeaderParams.put("avalara-version", "1.0"); + localVarHeaderParams.put("avalara-version", "1.2"); if (requestParameters.getAvalaraVersion() != null) { localVarHeaderParams.put("avalara-version", localVarApiClient.parameterToString(requestParameters.getAvalaraVersion())); @@ -161,7 +165,7 @@ public okhttp3.Call downloadDocumentCall(DownloadDocumentRequest requestParamete if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "Bearer" }; + String[] localVarAuthNames = new String[] { "OAuth", "Bearer" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback, requiredScopes); } @@ -191,7 +195,7 @@ private okhttp3.Call downloadDocumentValidateBeforeCall(DownloadDocumentRequest /** * 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. * @param requestOptions Object which represents the options available for a given API/request * @return File * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -212,7 +216,7 @@ public File downloadDocument(DownloadDocumentRequest requestParameters) throws A /** * 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. * @param requestOptions Object which represents the options available for a given API/request * @return ApiResponse<File> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -234,7 +238,7 @@ public ApiResponse downloadDocumentWithHttpInfo(DownloadDocumentRequest re /** * Returns a copy of the document (asynchronously) - * 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. * @param requestOptions Object which represents the options available for a given API/request * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -262,7 +266,7 @@ public okhttp3.Call downloadDocumentAsync(DownloadDocumentRequest requestParamet * @param avalaraVersion The HTTP Header meant to specify the version of the API intended to be used * @param accept This header indicates the MIME type of the document * @param documentId The unique ID for this document that was returned in the POST /einvoicing/document response body - * @param xAvalaraClient 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 xAvalaraClient 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) */ public class DownloadDocumentRequest { private String avalaraVersion; @@ -291,6 +295,194 @@ public DownloadDocumentRequest getDownloadDocumentRequest() { return this.new DownloadDocumentRequest(); } + /** + * Build call for fetchDocuments + * @param requestOptions Object which represents the options available for a given API/request + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 Accepted DocumentFetch Request -
401 Unauthorized -
403 Forbidden -
500 Internal Server Error -
+ */ + public okhttp3.Call fetchDocumentsCall(FetchDocumentsRequest requestParameters, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + //OAuth2 Scopes + String requiredScopes = ""; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = requestParameters.getFetchDocumentsRequest(); + + // create path and map variables + String localVarPath = "/documents/$fetch"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + // Set avalara-version header from swagger.json version number + localVarHeaderParams.put("avalara-version", "1.2"); + + if (requestParameters.getAvalaraVersion() != null) { + localVarHeaderParams.put("avalara-version", localVarApiClient.parameterToString(requestParameters.getAvalaraVersion())); + } + + if (requestParameters.getXAvalaraClient() != null) { + localVarHeaderParams.put("X-Avalara-Client", localVarApiClient.parameterToString(requestParameters.getXAvalaraClient())); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + String[] localVarAuthNames = new String[] { "OAuth", "Bearer" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback, requiredScopes); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call fetchDocumentsValidateBeforeCall(FetchDocumentsRequest requestParameters, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'requestParameters.avalaraVersion' is set + if (requestParameters.getAvalaraVersion() == null) { + throw new ApiException("Missing the required parameter 'requestParameters.avalaraVersion' when calling fetchDocuments(Async)"); + } + + // verify the required parameter 'requestParameters.fetchDocumentsRequest' is set + if (requestParameters.getFetchDocumentsRequest() == null) { + throw new ApiException("Missing the required parameter 'requestParameters.fetchDocumentsRequest' when calling fetchDocuments(Async)"); + } + + + okhttp3.Call localVarCall = fetchDocumentsCall(requestParameters, _callback); + return localVarCall; + + } + + /** + * 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. + * @param requestOptions Object which represents the options available for a given API/request + * @return DocumentFetch + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 Accepted DocumentFetch Request -
401 Unauthorized -
403 Forbidden -
500 Internal Server Error -
+ */ + public DocumentFetch fetchDocuments(FetchDocumentsRequest requestParameters) throws ApiException { + ApiResponse localVarResp = fetchDocumentsWithHttpInfo(requestParameters); + return localVarResp.getData(); + } + + /** + * 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. + * @param requestOptions Object which represents the options available for a given API/request + * @return ApiResponse<DocumentFetch> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 Accepted DocumentFetch Request -
401 Unauthorized -
403 Forbidden -
500 Internal Server Error -
+ */ + public ApiResponse fetchDocumentsWithHttpInfo(FetchDocumentsRequest requestParameters) throws ApiException { + okhttp3.Call localVarCall = fetchDocumentsValidateBeforeCall(requestParameters, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Fetch the inbound document from a tax authority (asynchronously) + * 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. + * @param requestOptions Object which represents the options available for a given API/request + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 Accepted DocumentFetch Request -
401 Unauthorized -
403 Forbidden -
500 Internal Server Error -
+ */ + public okhttp3.Call fetchDocumentsAsync(FetchDocumentsRequest requestParameters, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = fetchDocumentsValidateBeforeCall(requestParameters, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Represents the Request object for the FetchDocuments API + * + * @param avalaraVersion The HTTP Header meant to specify the version of the API intended to be used + * @param fetchDocumentsRequest + * @param xAvalaraClient 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) + */ + public class FetchDocumentsRequest { + private String avalaraVersion; + private FetchDocumentsRequest fetchDocumentsRequest; + private String xAvalaraClient; + + public FetchDocumentsRequest () { + } + + public String getAvalaraVersion() { return avalaraVersion; } + public void setAvalaraVersion(String avalaraVersion) { this.avalaraVersion = avalaraVersion; } + public FetchDocumentsRequest getFetchDocumentsRequest() { return fetchDocumentsRequest; } + public void setFetchDocumentsRequest(FetchDocumentsRequest fetchDocumentsRequest) { this.fetchDocumentsRequest = fetchDocumentsRequest; } + public String getXAvalaraClient() { return xAvalaraClient; } + public void setXAvalaraClient(String xAvalaraClient) { this.xAvalaraClient = xAvalaraClient; } + } + + /** + * Getter function to instantiate Request class + * @returns FetchDocumentsRequest + */ + public FetchDocumentsRequest getFetchDocumentsRequest() { + return this.new FetchDocumentsRequest(); + } + /** * Build call for getDocumentList * @param requestOptions Object which represents the options available for a given API/request @@ -327,7 +519,7 @@ public okhttp3.Call getDocumentListCall(GetDocumentListRequest requestParameters Object localVarPostBody = null; // create path and map variables - String localVarPath = "/einvoicing/documents"; + String localVarPath = "/documents"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -336,7 +528,7 @@ public okhttp3.Call getDocumentListCall(GetDocumentListRequest requestParameters Map localVarFormParams = new HashMap(); // Set avalara-version header from swagger.json version number - localVarHeaderParams.put("avalara-version", "1.0"); + localVarHeaderParams.put("avalara-version", "1.2"); if (requestParameters.getStartDate() != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("startDate", requestParameters.getStartDate())); @@ -393,7 +585,7 @@ public okhttp3.Call getDocumentListCall(GetDocumentListRequest requestParameters if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "Bearer" }; + String[] localVarAuthNames = new String[] { "OAuth", "Bearer" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback, requiredScopes); } @@ -479,7 +671,7 @@ public okhttp3.Call getDocumentListAsync(GetDocumentListRequest requestParameter * Represents the Request object for the GetDocumentList API * * @param avalaraVersion The HTTP Header meant to specify the version of the API intended to be used - * @param xAvalaraClient 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 xAvalaraClient 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 startDate Start date of documents to return. This defaults to the previous month. (optional) * @param endDate End date of documents to return. This defaults to the current date. (optional) * @param flow Optionally filter by document direction, where issued = `out` and received = `in` (optional) @@ -570,7 +762,7 @@ public okhttp3.Call getDocumentStatusCall(GetDocumentStatusRequest requestParame Object localVarPostBody = null; // create path and map variables - String localVarPath = "/einvoicing/document/{documentId}/status" + String localVarPath = "/documents/{documentId}/status" .replaceAll("\\{" + "documentId" + "\\}", localVarApiClient.escapeString(requestParameters.documentId.toString())); List localVarQueryParams = new ArrayList(); @@ -580,7 +772,7 @@ public okhttp3.Call getDocumentStatusCall(GetDocumentStatusRequest requestParame Map localVarFormParams = new HashMap(); // Set avalara-version header from swagger.json version number - localVarHeaderParams.put("avalara-version", "1.0"); + localVarHeaderParams.put("avalara-version", "1.2"); if (requestParameters.getAvalaraVersion() != null) { localVarHeaderParams.put("avalara-version", localVarApiClient.parameterToString(requestParameters.getAvalaraVersion())); @@ -605,7 +797,7 @@ public okhttp3.Call getDocumentStatusCall(GetDocumentStatusRequest requestParame if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "Bearer" }; + String[] localVarAuthNames = new String[] { "OAuth", "Bearer" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback, requiredScopes); } @@ -697,7 +889,7 @@ public okhttp3.Call getDocumentStatusAsync(GetDocumentStatusRequest requestParam * * @param avalaraVersion The HTTP Header meant to specify the version of the API intended to be used * @param documentId The unique ID for this document that was returned in the POST /einvoicing/documents response body - * @param xAvalaraClient 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 xAvalaraClient 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) */ public class GetDocumentStatusRequest { private String avalaraVersion; @@ -759,7 +951,7 @@ public okhttp3.Call submitDocumentCall(SubmitDocumentRequest requestParameters, Object localVarPostBody = null; // create path and map variables - String localVarPath = "/einvoicing/documents"; + String localVarPath = "/documents"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -768,7 +960,7 @@ public okhttp3.Call submitDocumentCall(SubmitDocumentRequest requestParameters, Map localVarFormParams = new HashMap(); // Set avalara-version header from swagger.json version number - localVarHeaderParams.put("avalara-version", "1.0"); + localVarHeaderParams.put("avalara-version", "1.2"); if (requestParameters.getMetadata() != null) { localVarFormParams.put("metadata", requestParameters.getMetadata()); @@ -801,7 +993,7 @@ public okhttp3.Call submitDocumentCall(SubmitDocumentRequest requestParameters, if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "Bearer" }; + String[] localVarAuthNames = new String[] { "OAuth", "Bearer" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback, requiredScopes); } @@ -831,7 +1023,7 @@ private okhttp3.Call submitDocumentValidateBeforeCall(SubmitDocumentRequest requ /** * 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.<br><br>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.<br><br>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.<br><br>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.<br><br>Furthermore, the unique ID enables the download of a copy of the generated document for reference purposes. * @param requestOptions Object which represents the options available for a given API/request * @return DocumentSubmitResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -851,7 +1043,7 @@ public DocumentSubmitResponse submitDocument(SubmitDocumentRequest requestParame /** * 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.<br><br>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.<br><br>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.<br><br>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.<br><br>Furthermore, the unique ID enables the download of a copy of the generated document for reference purposes. * @param requestOptions Object which represents the options available for a given API/request * @return ApiResponse<DocumentSubmitResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body @@ -872,7 +1064,7 @@ public ApiResponse submitDocumentWithHttpInfo(SubmitDocu /** * Submits a document to Avalara E-Invoicing API (asynchronously) - * 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.<br><br>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.<br><br>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.<br><br>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.<br><br>Furthermore, the unique ID enables the download of a copy of the generated document for reference purposes. * @param requestOptions Object which represents the options available for a given API/request * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -898,13 +1090,13 @@ public okhttp3.Call submitDocumentAsync(SubmitDocumentRequest requestParameters, * * @param avalaraVersion The HTTP Header meant to specify the version of the API intended to be used * @param metadata - * @param data - * @param xAvalaraClient 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 data The document to be submitted, as indicated by the metadata fields 'dataFormat' and 'dataFormatVersion' + * @param xAvalaraClient 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) */ public class SubmitDocumentRequest { private String avalaraVersion; private SubmitDocumentMetadata metadata; - private SubmitDocumentData data; + private Object data; private String xAvalaraClient; public SubmitDocumentRequest () { @@ -914,8 +1106,8 @@ public SubmitDocumentRequest () { public void setAvalaraVersion(String avalaraVersion) { this.avalaraVersion = avalaraVersion; } public SubmitDocumentMetadata getMetadata() { return metadata; } public void setMetadata(SubmitDocumentMetadata metadata) { this.metadata = metadata; } - public SubmitDocumentData getData() { return data; } - public void setData(SubmitDocumentData data) { this.data = data; } + public Object getData() { return data; } + public void setData(Object data) { this.data = data; } public String getXAvalaraClient() { return xAvalaraClient; } public void setXAvalaraClient(String xAvalaraClient) { this.xAvalaraClient = xAvalaraClient; } } diff --git a/src/main/java/Avalara/SDK/api/EInvoicing/V1/InteropApi.java b/src/main/java/Avalara/SDK/api/EInvoicing/V1/InteropApi.java new file mode 100644 index 0000000..aab9459 --- /dev/null +++ b/src/main/java/Avalara/SDK/api/EInvoicing/V1/InteropApi.java @@ -0,0 +1,310 @@ +/* + * AvaTax Software Development Kit for Java (JRE) + * + * (c) 2004-2022 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * Avalara E-Invoicing API + * + * An API that supports sending data for an E-Invoicing compliance use-case. + * + * @author Sachin Baijal + * @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-JRE-SDK + */ + +package Avalara.SDK.api.EInvoicing.V1; + +import Avalara.SDK.ApiCallback; +import Avalara.SDK.ApiClient; +import Avalara.SDK.ApiException; +import Avalara.SDK.ApiResponse; +import Avalara.SDK.Configuration; +import Avalara.SDK.Pair; +import Avalara.SDK.ProgressRequestBody; +import Avalara.SDK.ProgressResponseBody; +import Avalara.SDK.AvalaraMicroservice; + + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; +import java.util.*; + + +import Avalara.SDK.model.EInvoicing.V1.ErrorResponse; +import java.io.File; +import Avalara.SDK.model.EInvoicing.V1.SubmitInteropDocument202Response; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class InteropApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public InteropApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + SetConfiguration(apiClient); + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for submitInteropDocument + * @param requestOptions Object which represents the options available for a given API/request + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
202 Document Accepted. This doesn't mean it is processed. This is just a transport ack. * X-Correlation-ID -
400 Bad/Invalid Request. * X-Correlation-Id -
401 Unauthorized * X-Correlation-Id -
403 Forbidden * X-Correlation-Id -
500 Internal server error * X-Correlation-Id -
+ */ + public okhttp3.Call submitInteropDocumentCall(SubmitInteropDocumentRequest requestParameters, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + //OAuth2 Scopes + String requiredScopes = ""; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/interop/documents"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + // Set avalara-version header from swagger.json version number + localVarHeaderParams.put("avalara-version", "1.2"); + + if (requestParameters.getFileName() != null) { + localVarFormParams.put("fileName", requestParameters.getFileName()); + } + + if (requestParameters.getDocumentType() != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("documentType", requestParameters.getDocumentType())); + } + + if (requestParameters.getInterchangeType() != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("interchangeType", requestParameters.getInterchangeType())); + } + + if (requestParameters.getAvalaraVersion() != null) { + localVarHeaderParams.put("avalara-version", localVarApiClient.parameterToString(requestParameters.getAvalaraVersion())); + } + + if (requestParameters.getXAvalaraClient() != null) { + localVarHeaderParams.put("X-Avalara-Client", localVarApiClient.parameterToString(requestParameters.getXAvalaraClient())); + } + + if (requestParameters.getXCorrelationID() != null) { + localVarHeaderParams.put("X-Correlation-ID", localVarApiClient.parameterToString(requestParameters.getXCorrelationID())); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "multipart/form-data" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + String[] localVarAuthNames = new String[] { "OAuth", "Bearer" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback, requiredScopes); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call submitInteropDocumentValidateBeforeCall(SubmitInteropDocumentRequest requestParameters, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'requestParameters.documentType' is set + if (requestParameters.getDocumentType() == null) { + throw new ApiException("Missing the required parameter 'requestParameters.documentType' when calling submitInteropDocument(Async)"); + } + + // verify the required parameter 'requestParameters.interchangeType' is set + if (requestParameters.getInterchangeType() == null) { + throw new ApiException("Missing the required parameter 'requestParameters.interchangeType' when calling submitInteropDocument(Async)"); + } + + // verify the required parameter 'requestParameters.avalaraVersion' is set + if (requestParameters.getAvalaraVersion() == null) { + throw new ApiException("Missing the required parameter 'requestParameters.avalaraVersion' when calling submitInteropDocument(Async)"); + } + + + okhttp3.Call localVarCall = submitInteropDocumentCall(requestParameters, _callback); + return localVarCall; + + } + + /** + * 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. + * @param requestOptions Object which represents the options available for a given API/request + * @return SubmitInteropDocument202Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
202 Document Accepted. This doesn't mean it is processed. This is just a transport ack. * X-Correlation-ID -
400 Bad/Invalid Request. * X-Correlation-Id -
401 Unauthorized * X-Correlation-Id -
403 Forbidden * X-Correlation-Id -
500 Internal server error * X-Correlation-Id -
+ */ + public SubmitInteropDocument202Response submitInteropDocument(SubmitInteropDocumentRequest requestParameters) throws ApiException { + ApiResponse localVarResp = submitInteropDocumentWithHttpInfo(requestParameters); + return localVarResp.getData(); + } + + /** + * 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. + * @param requestOptions Object which represents the options available for a given API/request + * @return ApiResponse<SubmitInteropDocument202Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
202 Document Accepted. This doesn't mean it is processed. This is just a transport ack. * X-Correlation-ID -
400 Bad/Invalid Request. * X-Correlation-Id -
401 Unauthorized * X-Correlation-Id -
403 Forbidden * X-Correlation-Id -
500 Internal server error * X-Correlation-Id -
+ */ + public ApiResponse submitInteropDocumentWithHttpInfo(SubmitInteropDocumentRequest requestParameters) throws ApiException { + okhttp3.Call localVarCall = submitInteropDocumentValidateBeforeCall(requestParameters, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Submit a document (asynchronously) + * This API used by the interoperability partners to submit a document to their trading partners in Avalara on behalf of their customers. + * @param requestOptions Object which represents the options available for a given API/request + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
202 Document Accepted. This doesn't mean it is processed. This is just a transport ack. * X-Correlation-ID -
400 Bad/Invalid Request. * X-Correlation-Id -
401 Unauthorized * X-Correlation-Id -
403 Forbidden * X-Correlation-Id -
500 Internal server error * X-Correlation-Id -
+ */ + public okhttp3.Call submitInteropDocumentAsync(SubmitInteropDocumentRequest requestParameters, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = submitInteropDocumentValidateBeforeCall(requestParameters, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Represents the Request object for the SubmitInteropDocument API + * + * @param documentType Type of the document being uploaded. Partners will be configured in Avalara system to send only certain types of documents. + * @param interchangeType 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. + * @param avalaraVersion The HTTP Header meant to specify the version of the API intended to be used + * @param xAvalaraClient 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 xCorrelationID The caller can use this as an identifier to use as a correlation id to trace the call. (optional) + * @param fileName The file to be uploaded (e.g., UBL XML, CII XML). (optional) + */ + public class SubmitInteropDocumentRequest { + private String documentType; + private String interchangeType; + private String avalaraVersion; + private String xAvalaraClient; + private String xCorrelationID; + private File fileName; + + public SubmitInteropDocumentRequest () { + } + + public String getDocumentType() { return documentType; } + public void setDocumentType(String documentType) { this.documentType = documentType; } + public String getInterchangeType() { return interchangeType; } + public void setInterchangeType(String interchangeType) { this.interchangeType = interchangeType; } + public String getAvalaraVersion() { return avalaraVersion; } + public void setAvalaraVersion(String avalaraVersion) { this.avalaraVersion = avalaraVersion; } + public String getXAvalaraClient() { return xAvalaraClient; } + public void setXAvalaraClient(String xAvalaraClient) { this.xAvalaraClient = xAvalaraClient; } + public String getXCorrelationID() { return xCorrelationID; } + public void setXCorrelationID(String xCorrelationID) { this.xCorrelationID = xCorrelationID; } + public File getFileName() { return fileName; } + public void setFileName(File fileName) { this.fileName = fileName; } + } + + /** + * Getter function to instantiate Request class + * @returns SubmitInteropDocumentRequest + */ + public SubmitInteropDocumentRequest getSubmitInteropDocumentRequest() { + return this.new SubmitInteropDocumentRequest(); + } + + private void SetConfiguration(ApiClient client) { + if (client == null) throw new MissingFormatArgumentException("client"); + this.localVarApiClient.setSdkVersion(""); + } +} + diff --git a/src/main/java/Avalara/SDK/api/EInvoicing/V1/MandatesApi.java b/src/main/java/Avalara/SDK/api/EInvoicing/V1/MandatesApi.java index 928b53f..69899b4 100644 --- a/src/main/java/Avalara/SDK/api/EInvoicing/V1/MandatesApi.java +++ b/src/main/java/Avalara/SDK/api/EInvoicing/V1/MandatesApi.java @@ -28,6 +28,8 @@ import Avalara.SDK.Pair; import Avalara.SDK.ProgressRequestBody; import Avalara.SDK.ProgressResponseBody; +import Avalara.SDK.AvalaraMicroservice; + import com.google.gson.reflect.TypeToken; @@ -35,9 +37,11 @@ import java.util.*; +import Avalara.SDK.model.EInvoicing.V1.BadRequest; import java.math.BigDecimal; import Avalara.SDK.model.EInvoicing.V1.ForbiddenError; import Avalara.SDK.model.EInvoicing.V1.InternalServerError; +import Avalara.SDK.model.EInvoicing.V1.MandateDataInputField; import Avalara.SDK.model.EInvoicing.V1.MandatesResponse; import Avalara.SDK.model.EInvoicing.V1.NotFoundError; @@ -77,6 +81,229 @@ public void setCustomBaseUrl(String customBaseUrl) { this.localCustomBaseUrl = customBaseUrl; } + /** + * Build call for getMandateDataInputFields + * @param requestOptions Object which represents the options available for a given API/request + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Resource not found -
500 Internal Server Error -
+ */ + public okhttp3.Call getMandateDataInputFieldsCall(GetMandateDataInputFieldsRequest requestParameters, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + //OAuth2 Scopes + String requiredScopes = ""; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/mandates/{mandateId}/data-input-fields" + .replaceAll("\\{" + "mandateId" + "\\}", localVarApiClient.escapeString(requestParameters.mandateId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + // Set avalara-version header from swagger.json version number + localVarHeaderParams.put("avalara-version", "1.2"); + + if (requestParameters.getDocumentType() != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("documentType", requestParameters.getDocumentType())); + } + + if (requestParameters.getDocumentVersion() != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("documentVersion", requestParameters.getDocumentVersion())); + } + + if (requestParameters.getAvalaraVersion() != null) { + localVarHeaderParams.put("avalara-version", localVarApiClient.parameterToString(requestParameters.getAvalaraVersion())); + } + + if (requestParameters.getXAvalaraClient() != null) { + localVarHeaderParams.put("X-Avalara-Client", localVarApiClient.parameterToString(requestParameters.getXAvalaraClient())); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + String[] localVarAuthNames = new String[] { "OAuth", "Bearer" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback, requiredScopes); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getMandateDataInputFieldsValidateBeforeCall(GetMandateDataInputFieldsRequest requestParameters, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'requestParameters.avalaraVersion' is set + if (requestParameters.getAvalaraVersion() == null) { + throw new ApiException("Missing the required parameter 'requestParameters.avalaraVersion' when calling getMandateDataInputFields(Async)"); + } + + // verify the required parameter 'requestParameters.mandateId' is set + if (requestParameters.getMandateId() == null) { + throw new ApiException("Missing the required parameter 'requestParameters.mandateId' when calling getMandateDataInputFields(Async)"); + } + + // verify the required parameter 'requestParameters.documentType' is set + if (requestParameters.getDocumentType() == null) { + throw new ApiException("Missing the required parameter 'requestParameters.documentType' when calling getMandateDataInputFields(Async)"); + } + + // verify the required parameter 'requestParameters.documentVersion' is set + if (requestParameters.getDocumentVersion() == null) { + throw new ApiException("Missing the required parameter 'requestParameters.documentVersion' when calling getMandateDataInputFields(Async)"); + } + + + okhttp3.Call localVarCall = getMandateDataInputFieldsCall(requestParameters, _callback); + return localVarCall; + + } + + /** + * 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 <code>/mandates</code> 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. + * @param requestOptions Object which represents the options available for a given API/request + * @return List<MandateDataInputField> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Resource not found -
500 Internal Server Error -
+ */ + public List getMandateDataInputFields(GetMandateDataInputFieldsRequest requestParameters) throws ApiException { + ApiResponse> localVarResp = getMandateDataInputFieldsWithHttpInfo(requestParameters); + return localVarResp.getData(); + } + + /** + * 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 <code>/mandates</code> 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. + * @param requestOptions Object which represents the options available for a given API/request + * @return ApiResponse<List<MandateDataInputField>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Resource not found -
500 Internal Server Error -
+ */ + public ApiResponse> getMandateDataInputFieldsWithHttpInfo(GetMandateDataInputFieldsRequest requestParameters) throws ApiException { + okhttp3.Call localVarCall = getMandateDataInputFieldsValidateBeforeCall(requestParameters, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Returns document field information for a country mandate, a selected document type, and its version (asynchronously) + * 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 <code>/mandates</code> 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. + * @param requestOptions Object which represents the options available for a given API/request + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Resource not found -
500 Internal Server Error -
+ */ + public okhttp3.Call getMandateDataInputFieldsAsync(GetMandateDataInputFieldsRequest requestParameters, final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = getMandateDataInputFieldsValidateBeforeCall(requestParameters, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Represents the Request object for the GetMandateDataInputFields API + * + * @param avalaraVersion The HTTP Header meant to specify the version of the API intended to be used + * @param mandateId The unique ID for the mandate that was returned in the GET /einvoicing/mandates response body + * @param documentType Select the documentType for which you wish to view the data-input-fields (You may obtain the supported documentTypes from the GET /mandates endpoint) + * @param documentVersion Select the document version of the documentType (You may obtain the supported documentVersion from the GET /mandates endpoint) + * @param xAvalaraClient 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) + */ + public class GetMandateDataInputFieldsRequest { + private String avalaraVersion; + private String mandateId; + private String documentType; + private String documentVersion; + private String xAvalaraClient; + + public GetMandateDataInputFieldsRequest () { + } + + public String getAvalaraVersion() { return avalaraVersion; } + public void setAvalaraVersion(String avalaraVersion) { this.avalaraVersion = avalaraVersion; } + public String getMandateId() { return mandateId; } + public void setMandateId(String mandateId) { this.mandateId = mandateId; } + public String getDocumentType() { return documentType; } + public void setDocumentType(String documentType) { this.documentType = documentType; } + public String getDocumentVersion() { return documentVersion; } + public void setDocumentVersion(String documentVersion) { this.documentVersion = documentVersion; } + public String getXAvalaraClient() { return xAvalaraClient; } + public void setXAvalaraClient(String xAvalaraClient) { this.xAvalaraClient = xAvalaraClient; } + } + + /** + * Getter function to instantiate Request class + * @returns GetMandateDataInputFieldsRequest + */ + public GetMandateDataInputFieldsRequest getGetMandateDataInputFieldsRequest() { + return this.new GetMandateDataInputFieldsRequest(); + } + /** * Build call for getMandates * @param requestOptions Object which represents the options available for a given API/request @@ -114,7 +341,7 @@ public okhttp3.Call getMandatesCall(GetMandatesRequest requestParameters, final Object localVarPostBody = null; // create path and map variables - String localVarPath = "/einvoicing/mandates"; + String localVarPath = "/mandates"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -123,7 +350,7 @@ public okhttp3.Call getMandatesCall(GetMandatesRequest requestParameters, final Map localVarFormParams = new HashMap(); // Set avalara-version header from swagger.json version number - localVarHeaderParams.put("avalara-version", "1.0"); + localVarHeaderParams.put("avalara-version", "1.2"); if (requestParameters.get$filter() != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("$filter", requestParameters.get$filter())); @@ -168,7 +395,7 @@ public okhttp3.Call getMandatesCall(GetMandatesRequest requestParameters, final if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } - String[] localVarAuthNames = new String[] { "Bearer" }; + String[] localVarAuthNames = new String[] { "OAuth", "Bearer" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback, requiredScopes); } @@ -257,7 +484,7 @@ public okhttp3.Call getMandatesAsync(GetMandatesRequest requestParameters, final * Represents the Request object for the GetMandates API * * @param avalaraVersion The HTTP Header meant to specify the version of the API intended to be used - * @param xAvalaraClient 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 xAvalaraClient 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 $filter 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. (optional) * @param $top 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. (optional) * @param $skip If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. (optional) diff --git a/src/main/java/Avalara/SDK/api/EInvoicing/V1/TradingPartnersApi.java b/src/main/java/Avalara/SDK/api/EInvoicing/V1/TradingPartnersApi.java new file mode 100644 index 0000000..6f15287 --- /dev/null +++ b/src/main/java/Avalara/SDK/api/EInvoicing/V1/TradingPartnersApi.java @@ -0,0 +1,1182 @@ +/* + * AvaTax Software Development Kit for Java (JRE) + * + * (c) 2004-2022 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * Avalara E-Invoicing API + * + * An API that supports sending data for an E-Invoicing compliance use-case. + * + * @author Sachin Baijal + * @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-JRE-SDK + */ + +package Avalara.SDK.api.EInvoicing.V1; + +import Avalara.SDK.ApiCallback; +import Avalara.SDK.ApiClient; +import Avalara.SDK.ApiException; +import Avalara.SDK.ApiResponse; +import Avalara.SDK.Configuration; +import Avalara.SDK.Pair; +import Avalara.SDK.ProgressRequestBody; +import Avalara.SDK.ProgressResponseBody; +import Avalara.SDK.AvalaraMicroservice; + + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; +import java.util.*; + + +import Avalara.SDK.model.EInvoicing.V1.BatchSearch; +import Avalara.SDK.model.EInvoicing.V1.BatchSearchListResponse; +import Avalara.SDK.model.EInvoicing.V1.DirectorySearchResponse; +import Avalara.SDK.model.EInvoicing.V1.ErrorResponse; +import java.io.File; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class TradingPartnersApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public TradingPartnersApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + SetConfiguration(apiClient); + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for batchSearchParticipants + * @param requestOptions Object which represents the options available for a given API/request + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
202 Batch search file accepted for processing the search. * X-Correlation-Id -
400 Invalid request * X-Correlation-Id -
401 Unauthorized * X-Correlation-Id -
403 Forbidden * X-Correlation-Id -
500 Internal server error * X-Correlation-Id -
+ */ + public okhttp3.Call batchSearchParticipantsCall(BatchSearchParticipantsRequest requestParameters, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + //OAuth2 Scopes + String requiredScopes = ""; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/trading-partners/batch-searches"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + // Set avalara-version header from swagger.json version number + localVarHeaderParams.put("avalara-version", "1.2"); + + if (requestParameters.get_file() != null) { + localVarFormParams.put("file", requestParameters.get_file()); + } + + if (requestParameters.getName() != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("name", requestParameters.getName())); + } + + if (requestParameters.getNotificationEmail() != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("notificationEmail", requestParameters.getNotificationEmail())); + } + + if (requestParameters.getAvalaraVersion() != null) { + localVarHeaderParams.put("avalara-version", localVarApiClient.parameterToString(requestParameters.getAvalaraVersion())); + } + + if (requestParameters.getXAvalaraClient() != null) { + localVarHeaderParams.put("X-Avalara-Client", localVarApiClient.parameterToString(requestParameters.getXAvalaraClient())); + } + + if (requestParameters.getXCorrelationID() != null) { + localVarHeaderParams.put("X-Correlation-ID", localVarApiClient.parameterToString(requestParameters.getXCorrelationID())); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "multipart/form-data" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + String[] localVarAuthNames = new String[] { "OAuth", "Bearer" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback, requiredScopes); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call batchSearchParticipantsValidateBeforeCall(BatchSearchParticipantsRequest requestParameters, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'requestParameters.avalaraVersion' is set + if (requestParameters.getAvalaraVersion() == null) { + throw new ApiException("Missing the required parameter 'requestParameters.avalaraVersion' when calling batchSearchParticipants(Async)"); + } + + // verify the required parameter 'requestParameters.name' is set + if (requestParameters.getName() == null) { + throw new ApiException("Missing the required parameter 'requestParameters.name' when calling batchSearchParticipants(Async)"); + } + + // verify the required parameter 'requestParameters.notificationEmail' is set + if (requestParameters.getNotificationEmail() == null) { + throw new ApiException("Missing the required parameter 'requestParameters.notificationEmail' when calling batchSearchParticipants(Async)"); + } + + // verify the required parameter 'requestParameters._file' is set + if (requestParameters.get_file() == null) { + throw new ApiException("Missing the required parameter 'requestParameters._file' when calling batchSearchParticipants(Async)"); + } + + + okhttp3.Call localVarCall = batchSearchParticipantsCall(requestParameters, _callback); + return localVarCall; + + } + + /** + * 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. + * @param requestOptions Object which represents the options available for a given API/request + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
202 Batch search file accepted for processing the search. * X-Correlation-Id -
400 Invalid request * X-Correlation-Id -
401 Unauthorized * X-Correlation-Id -
403 Forbidden * X-Correlation-Id -
500 Internal server error * X-Correlation-Id -
+ */ + public void batchSearchParticipants(BatchSearchParticipantsRequest requestParameters) throws ApiException { + batchSearchParticipantsWithHttpInfo(requestParameters); + } + + /** + * 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. + * @param requestOptions Object which represents the options available for a given API/request + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
202 Batch search file accepted for processing the search. * X-Correlation-Id -
400 Invalid request * X-Correlation-Id -
401 Unauthorized * X-Correlation-Id -
403 Forbidden * X-Correlation-Id -
500 Internal server error * X-Correlation-Id -
+ */ + public ApiResponse batchSearchParticipantsWithHttpInfo(BatchSearchParticipantsRequest requestParameters) throws ApiException { + okhttp3.Call localVarCall = batchSearchParticipantsValidateBeforeCall(requestParameters, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Creates a batch search and performs a batch search in the directory for participants in the background. (asynchronously) + * Handles batch search requests by uploading a file containing search parameters. + * @param requestOptions Object which represents the options available for a given API/request + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
202 Batch search file accepted for processing the search. * X-Correlation-Id -
400 Invalid request * X-Correlation-Id -
401 Unauthorized * X-Correlation-Id -
403 Forbidden * X-Correlation-Id -
500 Internal server error * X-Correlation-Id -
+ */ + public okhttp3.Call batchSearchParticipantsAsync(BatchSearchParticipantsRequest requestParameters, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = batchSearchParticipantsValidateBeforeCall(requestParameters, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Represents the Request object for the BatchSearchParticipants API + * + * @param avalaraVersion The HTTP Header meant to specify the version of the API intended to be used + * @param name The human readable name given to this batch search. + * @param notificationEmail The email address of the user to whom the batch search completion notification must go to. + * @param _file CSV file containing search parameters. + * @param xAvalaraClient 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 xCorrelationID The caller can use this as an identifier to use as a correlation id to trace the call. (optional) + */ + public class BatchSearchParticipantsRequest { + private String avalaraVersion; + private String name; + private String notificationEmail; + private File _file; + private String xAvalaraClient; + private String xCorrelationID; + + public BatchSearchParticipantsRequest () { + } + + public String getAvalaraVersion() { return avalaraVersion; } + public void setAvalaraVersion(String avalaraVersion) { this.avalaraVersion = avalaraVersion; } + public String getName() { return name; } + public void setName(String name) { this.name = name; } + public String getNotificationEmail() { return notificationEmail; } + public void setNotificationEmail(String notificationEmail) { this.notificationEmail = notificationEmail; } + public File get_file() { return _file; } + public void set_file(File _file) { this._file = _file; } + public String getXAvalaraClient() { return xAvalaraClient; } + public void setXAvalaraClient(String xAvalaraClient) { this.xAvalaraClient = xAvalaraClient; } + public String getXCorrelationID() { return xCorrelationID; } + public void setXCorrelationID(String xCorrelationID) { this.xCorrelationID = xCorrelationID; } + } + + /** + * Getter function to instantiate Request class + * @returns BatchSearchParticipantsRequest + */ + public BatchSearchParticipantsRequest getBatchSearchParticipantsRequest() { + return this.new BatchSearchParticipantsRequest(); + } + + /** + * Build call for downloadBatchSearchReport + * @param requestOptions Object which represents the options available for a given API/request + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 Successful report download * X-Correlation-Id -
401 Unauthorized * X-Correlation-Id -
403 Forbidden * X-Correlation-Id -
404 Report not found * X-Correlation-Id -
500 Internal server error * X-Correlation-Id -
+ */ + public okhttp3.Call downloadBatchSearchReportCall(DownloadBatchSearchReportRequest requestParameters, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + //OAuth2 Scopes + String requiredScopes = ""; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/trading-partners/batch-searches/{id}/$download-results" + .replaceAll("\\{" + "id" + "\\}", localVarApiClient.escapeString(requestParameters.id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + // Set avalara-version header from swagger.json version number + localVarHeaderParams.put("avalara-version", "1.2"); + + if (requestParameters.getAvalaraVersion() != null) { + localVarHeaderParams.put("avalara-version", localVarApiClient.parameterToString(requestParameters.getAvalaraVersion())); + } + + if (requestParameters.getXAvalaraClient() != null) { + localVarHeaderParams.put("X-Avalara-Client", localVarApiClient.parameterToString(requestParameters.getXAvalaraClient())); + } + + if (requestParameters.getXCorrelationID() != null) { + localVarHeaderParams.put("X-Correlation-ID", localVarApiClient.parameterToString(requestParameters.getXCorrelationID())); + } + + final String[] localVarAccepts = { + "text/csv", "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + String[] localVarAuthNames = new String[] { "OAuth", "Bearer" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback, requiredScopes); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call downloadBatchSearchReportValidateBeforeCall(DownloadBatchSearchReportRequest requestParameters, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'requestParameters.avalaraVersion' is set + if (requestParameters.getAvalaraVersion() == null) { + throw new ApiException("Missing the required parameter 'requestParameters.avalaraVersion' when calling downloadBatchSearchReport(Async)"); + } + + // verify the required parameter 'requestParameters.id' is set + if (requestParameters.getId() == null) { + throw new ApiException("Missing the required parameter 'requestParameters.id' when calling downloadBatchSearchReport(Async)"); + } + + + okhttp3.Call localVarCall = downloadBatchSearchReportCall(requestParameters, _callback); + return localVarCall; + + } + + /** + * Download batch search results in a csv file. + * Downloads the report for a specific batch search using the batch search ID. + * @param requestOptions Object which represents the options available for a given API/request + * @return File + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 Successful report download * X-Correlation-Id -
401 Unauthorized * X-Correlation-Id -
403 Forbidden * X-Correlation-Id -
404 Report not found * X-Correlation-Id -
500 Internal server error * X-Correlation-Id -
+ */ + public File downloadBatchSearchReport(DownloadBatchSearchReportRequest requestParameters) throws ApiException { + ApiResponse localVarResp = downloadBatchSearchReportWithHttpInfo(requestParameters); + return localVarResp.getData(); + } + + /** + * Download batch search results in a csv file. + * Downloads the report for a specific batch search using the batch search ID. + * @param requestOptions Object which represents the options available for a given API/request + * @return ApiResponse<File> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 Successful report download * X-Correlation-Id -
401 Unauthorized * X-Correlation-Id -
403 Forbidden * X-Correlation-Id -
404 Report not found * X-Correlation-Id -
500 Internal server error * X-Correlation-Id -
+ */ + public ApiResponse downloadBatchSearchReportWithHttpInfo(DownloadBatchSearchReportRequest requestParameters) throws ApiException { + okhttp3.Call localVarCall = downloadBatchSearchReportValidateBeforeCall(requestParameters, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Download batch search results in a csv file. (asynchronously) + * Downloads the report for a specific batch search using the batch search ID. + * @param requestOptions Object which represents the options available for a given API/request + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 Successful report download * X-Correlation-Id -
401 Unauthorized * X-Correlation-Id -
403 Forbidden * X-Correlation-Id -
404 Report not found * X-Correlation-Id -
500 Internal server error * X-Correlation-Id -
+ */ + public okhttp3.Call downloadBatchSearchReportAsync(DownloadBatchSearchReportRequest requestParameters, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = downloadBatchSearchReportValidateBeforeCall(requestParameters, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Represents the Request object for the DownloadBatchSearchReport API + * + * @param avalaraVersion The HTTP Header meant to specify the version of the API intended to be used + * @param id The ID of the batch search whose report is to be downloaded. + * @param xAvalaraClient 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 xCorrelationID The caller can use this as an identifier to use as a correlation id to trace the call. (optional) + */ + public class DownloadBatchSearchReportRequest { + private String avalaraVersion; + private String id; + private String xAvalaraClient; + private String xCorrelationID; + + public DownloadBatchSearchReportRequest () { + } + + public String getAvalaraVersion() { return avalaraVersion; } + public void setAvalaraVersion(String avalaraVersion) { this.avalaraVersion = avalaraVersion; } + public String getId() { return id; } + public void setId(String id) { this.id = id; } + public String getXAvalaraClient() { return xAvalaraClient; } + public void setXAvalaraClient(String xAvalaraClient) { this.xAvalaraClient = xAvalaraClient; } + public String getXCorrelationID() { return xCorrelationID; } + public void setXCorrelationID(String xCorrelationID) { this.xCorrelationID = xCorrelationID; } + } + + /** + * Getter function to instantiate Request class + * @returns DownloadBatchSearchReportRequest + */ + public DownloadBatchSearchReportRequest getDownloadBatchSearchReportRequest() { + return this.new DownloadBatchSearchReportRequest(); + } + + /** + * Build call for getBatchSearchDetail + * @param requestOptions Object which represents the options available for a given API/request + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 Get the batch search details for a given id. * X-Correlation-Id -
401 Unauthorized * X-Correlation-Id -
403 Forbidden * X-Correlation-Id -
500 Internal server error * X-Correlation-Id -
+ */ + public okhttp3.Call getBatchSearchDetailCall(GetBatchSearchDetailRequest requestParameters, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + //OAuth2 Scopes + String requiredScopes = ""; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/trading-partners/batch-searches/{id}" + .replaceAll("\\{" + "id" + "\\}", localVarApiClient.escapeString(requestParameters.id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + // Set avalara-version header from swagger.json version number + localVarHeaderParams.put("avalara-version", "1.2"); + + if (requestParameters.getAvalaraVersion() != null) { + localVarHeaderParams.put("avalara-version", localVarApiClient.parameterToString(requestParameters.getAvalaraVersion())); + } + + if (requestParameters.getXAvalaraClient() != null) { + localVarHeaderParams.put("X-Avalara-Client", localVarApiClient.parameterToString(requestParameters.getXAvalaraClient())); + } + + if (requestParameters.getXCorrelationID() != null) { + localVarHeaderParams.put("X-Correlation-ID", localVarApiClient.parameterToString(requestParameters.getXCorrelationID())); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + String[] localVarAuthNames = new String[] { "OAuth", "Bearer" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback, requiredScopes); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getBatchSearchDetailValidateBeforeCall(GetBatchSearchDetailRequest requestParameters, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'requestParameters.avalaraVersion' is set + if (requestParameters.getAvalaraVersion() == null) { + throw new ApiException("Missing the required parameter 'requestParameters.avalaraVersion' when calling getBatchSearchDetail(Async)"); + } + + // verify the required parameter 'requestParameters.id' is set + if (requestParameters.getId() == null) { + throw new ApiException("Missing the required parameter 'requestParameters.id' when calling getBatchSearchDetail(Async)"); + } + + + okhttp3.Call localVarCall = getBatchSearchDetailCall(requestParameters, _callback); + return localVarCall; + + } + + /** + * Get the batch search details for a given id. + * Get the batch search details for a given id. + * @param requestOptions Object which represents the options available for a given API/request + * @return BatchSearch + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 Get the batch search details for a given id. * X-Correlation-Id -
401 Unauthorized * X-Correlation-Id -
403 Forbidden * X-Correlation-Id -
500 Internal server error * X-Correlation-Id -
+ */ + public BatchSearch getBatchSearchDetail(GetBatchSearchDetailRequest requestParameters) throws ApiException { + ApiResponse localVarResp = getBatchSearchDetailWithHttpInfo(requestParameters); + return localVarResp.getData(); + } + + /** + * Get the batch search details for a given id. + * Get the batch search details for a given id. + * @param requestOptions Object which represents the options available for a given API/request + * @return ApiResponse<BatchSearch> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 Get the batch search details for a given id. * X-Correlation-Id -
401 Unauthorized * X-Correlation-Id -
403 Forbidden * X-Correlation-Id -
500 Internal server error * X-Correlation-Id -
+ */ + public ApiResponse getBatchSearchDetailWithHttpInfo(GetBatchSearchDetailRequest requestParameters) throws ApiException { + okhttp3.Call localVarCall = getBatchSearchDetailValidateBeforeCall(requestParameters, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get the batch search details for a given id. (asynchronously) + * Get the batch search details for a given id. + * @param requestOptions Object which represents the options available for a given API/request + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 Get the batch search details for a given id. * X-Correlation-Id -
401 Unauthorized * X-Correlation-Id -
403 Forbidden * X-Correlation-Id -
500 Internal server error * X-Correlation-Id -
+ */ + public okhttp3.Call getBatchSearchDetailAsync(GetBatchSearchDetailRequest requestParameters, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getBatchSearchDetailValidateBeforeCall(requestParameters, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Represents the Request object for the GetBatchSearchDetail API + * + * @param avalaraVersion The HTTP Header meant to specify the version of the API intended to be used + * @param id The ID of the batch search that was submitted earlier. + * @param xAvalaraClient 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 xCorrelationID The caller can use this as an identifier to use as a correlation id to trace the call. (optional) + */ + public class GetBatchSearchDetailRequest { + private String avalaraVersion; + private String id; + private String xAvalaraClient; + private String xCorrelationID; + + public GetBatchSearchDetailRequest () { + } + + public String getAvalaraVersion() { return avalaraVersion; } + public void setAvalaraVersion(String avalaraVersion) { this.avalaraVersion = avalaraVersion; } + public String getId() { return id; } + public void setId(String id) { this.id = id; } + public String getXAvalaraClient() { return xAvalaraClient; } + public void setXAvalaraClient(String xAvalaraClient) { this.xAvalaraClient = xAvalaraClient; } + public String getXCorrelationID() { return xCorrelationID; } + public void setXCorrelationID(String xCorrelationID) { this.xCorrelationID = xCorrelationID; } + } + + /** + * Getter function to instantiate Request class + * @returns GetBatchSearchDetailRequest + */ + public GetBatchSearchDetailRequest getGetBatchSearchDetailRequest() { + return this.new GetBatchSearchDetailRequest(); + } + + /** + * Build call for listBatchSearches + * @param requestOptions Object which represents the options available for a given API/request + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 List of batch searches * X-Correlation-Id -
401 Unauthorized * X-Correlation-Id -
403 Forbidden * X-Correlation-Id -
500 Internal server error * X-Correlation-Id -
+ */ + public okhttp3.Call listBatchSearchesCall(ListBatchSearchesRequest requestParameters, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + //OAuth2 Scopes + String requiredScopes = ""; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/trading-partners/batch-searches"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + // Set avalara-version header from swagger.json version number + localVarHeaderParams.put("avalara-version", "1.2"); + + if (requestParameters.get$filter() != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("$filter", requestParameters.get$filter())); + } + + if (requestParameters.getCount() != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("count", requestParameters.getCount())); + } + + if (requestParameters.get$top() != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("$top", requestParameters.get$top())); + } + + if (requestParameters.get$skip() != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("$skip", requestParameters.get$skip())); + } + + if (requestParameters.get$orderBy() != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("$orderBy", requestParameters.get$orderBy())); + } + + if (requestParameters.getAvalaraVersion() != null) { + localVarHeaderParams.put("avalara-version", localVarApiClient.parameterToString(requestParameters.getAvalaraVersion())); + } + + if (requestParameters.getXAvalaraClient() != null) { + localVarHeaderParams.put("X-Avalara-Client", localVarApiClient.parameterToString(requestParameters.getXAvalaraClient())); + } + + if (requestParameters.getXCorrelationID() != null) { + localVarHeaderParams.put("X-Correlation-ID", localVarApiClient.parameterToString(requestParameters.getXCorrelationID())); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + String[] localVarAuthNames = new String[] { "OAuth", "Bearer" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback, requiredScopes); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listBatchSearchesValidateBeforeCall(ListBatchSearchesRequest requestParameters, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'requestParameters.avalaraVersion' is set + if (requestParameters.getAvalaraVersion() == null) { + throw new ApiException("Missing the required parameter 'requestParameters.avalaraVersion' when calling listBatchSearches(Async)"); + } + + + okhttp3.Call localVarCall = listBatchSearchesCall(requestParameters, _callback); + return localVarCall; + + } + + /** + * List all batch searches that were previously submitted. + * Retrieves all batch searches performed by the user. + * @param requestOptions Object which represents the options available for a given API/request + * @return BatchSearchListResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 List of batch searches * X-Correlation-Id -
401 Unauthorized * X-Correlation-Id -
403 Forbidden * X-Correlation-Id -
500 Internal server error * X-Correlation-Id -
+ */ + public BatchSearchListResponse listBatchSearches(ListBatchSearchesRequest requestParameters) throws ApiException { + ApiResponse localVarResp = listBatchSearchesWithHttpInfo(requestParameters); + return localVarResp.getData(); + } + + /** + * List all batch searches that were previously submitted. + * Retrieves all batch searches performed by the user. + * @param requestOptions Object which represents the options available for a given API/request + * @return ApiResponse<BatchSearchListResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 List of batch searches * X-Correlation-Id -
401 Unauthorized * X-Correlation-Id -
403 Forbidden * X-Correlation-Id -
500 Internal server error * X-Correlation-Id -
+ */ + public ApiResponse listBatchSearchesWithHttpInfo(ListBatchSearchesRequest requestParameters) throws ApiException { + okhttp3.Call localVarCall = listBatchSearchesValidateBeforeCall(requestParameters, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List all batch searches that were previously submitted. (asynchronously) + * Retrieves all batch searches performed by the user. + * @param requestOptions Object which represents the options available for a given API/request + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 List of batch searches * X-Correlation-Id -
401 Unauthorized * X-Correlation-Id -
403 Forbidden * X-Correlation-Id -
500 Internal server error * X-Correlation-Id -
+ */ + public okhttp3.Call listBatchSearchesAsync(ListBatchSearchesRequest requestParameters, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listBatchSearchesValidateBeforeCall(requestParameters, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Represents the Request object for the ListBatchSearches API + * + * @param avalaraVersion The HTTP Header meant to specify the version of the API intended to be used + * @param xAvalaraClient 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 $filter 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. (optional) + * @param count When set to true, the count of the collection is included as @recordSetCount in the response body. (optional) + * @param $top 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. (optional) + * @param $skip If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. (optional) + * @param $orderBy 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 xCorrelationID The caller can use this as an identifier to use as a correlation id to trace the call. (optional) + */ + public class ListBatchSearchesRequest { + private String avalaraVersion; + private String xAvalaraClient; + private String $filter; + private Boolean count; + private String $top; + private String $skip; + private String $orderBy; + private String xCorrelationID; + + public ListBatchSearchesRequest () { + } + + public String getAvalaraVersion() { return avalaraVersion; } + public void setAvalaraVersion(String avalaraVersion) { this.avalaraVersion = avalaraVersion; } + public String getXAvalaraClient() { return xAvalaraClient; } + public void setXAvalaraClient(String xAvalaraClient) { this.xAvalaraClient = xAvalaraClient; } + public String get$filter() { return $filter; } + public void set$filter(String $filter) { this.$filter = $filter; } + public Boolean getCount() { return count; } + public void setCount(Boolean count) { this.count = count; } + public String get$top() { return $top; } + public void set$top(String $top) { this.$top = $top; } + public String get$skip() { return $skip; } + public void set$skip(String $skip) { this.$skip = $skip; } + public String get$orderBy() { return $orderBy; } + public void set$orderBy(String $orderBy) { this.$orderBy = $orderBy; } + public String getXCorrelationID() { return xCorrelationID; } + public void setXCorrelationID(String xCorrelationID) { this.xCorrelationID = xCorrelationID; } + } + + /** + * Getter function to instantiate Request class + * @returns ListBatchSearchesRequest + */ + public ListBatchSearchesRequest getListBatchSearchesRequest() { + return this.new ListBatchSearchesRequest(); + } + + /** + * Build call for searchParticipants + * @param requestOptions Object which represents the options available for a given API/request + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK * X-Correlation-Id -
400 Bad request * X-Correlation-Id -
401 Unauthorized * X-Correlation-Id -
403 Forbidden * X-Correlation-Id -
500 Internal server error * X-Correlation-Id -
+ */ + public okhttp3.Call searchParticipantsCall(SearchParticipantsRequest requestParameters, final ApiCallback _callback) throws ApiException { + String basePath = null; + + // Operation Servers + String[] localBasePaths = new String[] { }; + + //OAuth2 Scopes + String requiredScopes = ""; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/trading-partners"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + // Set avalara-version header from swagger.json version number + localVarHeaderParams.put("avalara-version", "1.2"); + + if (requestParameters.getCount() != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("count", requestParameters.getCount())); + } + + if (requestParameters.get$search() != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("$search", requestParameters.get$search())); + } + + if (requestParameters.get$filter() != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("$filter", requestParameters.get$filter())); + } + + if (requestParameters.get$top() != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("$top", requestParameters.get$top())); + } + + if (requestParameters.get$skip() != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("$skip", requestParameters.get$skip())); + } + + if (requestParameters.get$orderBy() != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("$orderBy", requestParameters.get$orderBy())); + } + + if (requestParameters.getAvalaraVersion() != null) { + localVarHeaderParams.put("avalara-version", localVarApiClient.parameterToString(requestParameters.getAvalaraVersion())); + } + + if (requestParameters.getXAvalaraClient() != null) { + localVarHeaderParams.put("X-Avalara-Client", localVarApiClient.parameterToString(requestParameters.getXAvalaraClient())); + } + + if (requestParameters.getXCorrelationID() != null) { + localVarHeaderParams.put("X-Correlation-ID", localVarApiClient.parameterToString(requestParameters.getXCorrelationID())); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + String[] localVarAuthNames = new String[] { "OAuth", "Bearer" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback, requiredScopes); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call searchParticipantsValidateBeforeCall(SearchParticipantsRequest requestParameters, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'requestParameters.avalaraVersion' is set + if (requestParameters.getAvalaraVersion() == null) { + throw new ApiException("Missing the required parameter 'requestParameters.avalaraVersion' when calling searchParticipants(Async)"); + } + + // verify the required parameter 'requestParameters.$search' is set + if (requestParameters.get$search() == null) { + throw new ApiException("Missing the required parameter 'requestParameters.$search' when calling searchParticipants(Async)"); + } + + + okhttp3.Call localVarCall = searchParticipantsCall(requestParameters, _callback); + return localVarCall; + + } + + /** + * Returns a list of participants matching the input query. + * Returns a list of participants matching the input query. + * @param requestOptions Object which represents the options available for a given API/request + * @return DirectorySearchResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK * X-Correlation-Id -
400 Bad request * X-Correlation-Id -
401 Unauthorized * X-Correlation-Id -
403 Forbidden * X-Correlation-Id -
500 Internal server error * X-Correlation-Id -
+ */ + public DirectorySearchResponse searchParticipants(SearchParticipantsRequest requestParameters) throws ApiException { + ApiResponse localVarResp = searchParticipantsWithHttpInfo(requestParameters); + return localVarResp.getData(); + } + + /** + * Returns a list of participants matching the input query. + * Returns a list of participants matching the input query. + * @param requestOptions Object which represents the options available for a given API/request + * @return ApiResponse<DirectorySearchResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK * X-Correlation-Id -
400 Bad request * X-Correlation-Id -
401 Unauthorized * X-Correlation-Id -
403 Forbidden * X-Correlation-Id -
500 Internal server error * X-Correlation-Id -
+ */ + public ApiResponse searchParticipantsWithHttpInfo(SearchParticipantsRequest requestParameters) throws ApiException { + okhttp3.Call localVarCall = searchParticipantsValidateBeforeCall(requestParameters, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Returns a list of participants matching the input query. (asynchronously) + * Returns a list of participants matching the input query. + * @param requestOptions Object which represents the options available for a given API/request + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK * X-Correlation-Id -
400 Bad request * X-Correlation-Id -
401 Unauthorized * X-Correlation-Id -
403 Forbidden * X-Correlation-Id -
500 Internal server error * X-Correlation-Id -
+ */ + public okhttp3.Call searchParticipantsAsync(SearchParticipantsRequest requestParameters, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = searchParticipantsValidateBeforeCall(requestParameters, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Represents the Request object for the SearchParticipants API + * + * @param avalaraVersion The HTTP Header meant to specify the version of the API intended to be used + * @param $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 name and identifier parameters only. + * @param xAvalaraClient 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 count When set to true, the count of the collection is included as @recordSetCount in the response body. (optional) + * @param $filter 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. (optional) + * @param $top 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. (optional) + * @param $skip If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. (optional) + * @param $orderBy 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 xCorrelationID The caller can use this as an identifier to use as a correlation id to trace the call. (optional) + */ + public class SearchParticipantsRequest { + private String avalaraVersion; + private String $search; + private String xAvalaraClient; + private Boolean count; + private String $filter; + private String $top; + private String $skip; + private String $orderBy; + private String xCorrelationID; + + public SearchParticipantsRequest () { + } + + public String getAvalaraVersion() { return avalaraVersion; } + public void setAvalaraVersion(String avalaraVersion) { this.avalaraVersion = avalaraVersion; } + public String get$search() { return $search; } + public void set$search(String $search) { this.$search = $search; } + public String getXAvalaraClient() { return xAvalaraClient; } + public void setXAvalaraClient(String xAvalaraClient) { this.xAvalaraClient = xAvalaraClient; } + public Boolean getCount() { return count; } + public void setCount(Boolean count) { this.count = count; } + public String get$filter() { return $filter; } + public void set$filter(String $filter) { this.$filter = $filter; } + public String get$top() { return $top; } + public void set$top(String $top) { this.$top = $top; } + public String get$skip() { return $skip; } + public void set$skip(String $skip) { this.$skip = $skip; } + public String get$orderBy() { return $orderBy; } + public void set$orderBy(String $orderBy) { this.$orderBy = $orderBy; } + public String getXCorrelationID() { return xCorrelationID; } + public void setXCorrelationID(String xCorrelationID) { this.xCorrelationID = xCorrelationID; } + } + + /** + * Getter function to instantiate Request class + * @returns SearchParticipantsRequest + */ + public SearchParticipantsRequest getSearchParticipantsRequest() { + return this.new SearchParticipantsRequest(); + } + + private void SetConfiguration(ApiClient client) { + if (client == null) throw new MissingFormatArgumentException("client"); + this.localVarApiClient.setSdkVersion(""); + } +} + diff --git a/src/main/java/Avalara/SDK/model/EInvoicing/V1/AbstractOpenApiSchema.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/AbstractOpenApiSchema.java index 41e2522..40f5f79 100644 --- a/src/main/java/Avalara/SDK/model/EInvoicing/V1/AbstractOpenApiSchema.java +++ b/src/main/java/Avalara/SDK/model/EInvoicing/V1/AbstractOpenApiSchema.java @@ -28,7 +28,7 @@ /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object diff --git a/src/main/java/Avalara/SDK/model/EInvoicing/V1/BadDownloadRequest.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/BadDownloadRequest.java index f78d49b..f83e263 100644 --- a/src/main/java/Avalara/SDK/model/EInvoicing/V1/BadDownloadRequest.java +++ b/src/main/java/Avalara/SDK/model/EInvoicing/V1/BadDownloadRequest.java @@ -56,7 +56,7 @@ /** * Returns an HTTP status code and message for a 'bad request' */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class BadDownloadRequest { public static final String SERIALIZED_NAME_ERROR = "error"; @SerializedName(SERIALIZED_NAME_ERROR) @@ -78,10 +78,10 @@ public BadDownloadRequest error(String error) { return this; } - /** + /** * The three-digit HTTP error code for the bad request * @return error - **/ + */ @javax.annotation.Nullable public String getError() { return error; @@ -97,10 +97,10 @@ public BadDownloadRequest message(String message) { return this; } - /** + /** * A message explaining the bad request * @return message - **/ + */ @javax.annotation.Nullable public String getMessage() { return message; @@ -116,10 +116,10 @@ public BadDownloadRequest supportedAcceptHeaders(Object supportedAcceptHeaders) return this; } - /** + /** * A message explaining the bad request * @return supportedAcceptHeaders - **/ + */ @javax.annotation.Nullable public Object getSupportedAcceptHeaders() { return supportedAcceptHeaders; @@ -187,12 +187,12 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to BadDownloadRequest - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to BadDownloadRequest + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!BadDownloadRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -245,22 +245,22 @@ public BadDownloadRequest read(JsonReader in) throws IOException { } } - /** - * Create an instance of BadDownloadRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of BadDownloadRequest - * @throws IOException if the JSON string is invalid with respect to BadDownloadRequest - */ + /** + * Create an instance of BadDownloadRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of BadDownloadRequest + * @throws IOException if the JSON string is invalid with respect to BadDownloadRequest + */ public static BadDownloadRequest fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, BadDownloadRequest.class); } - /** - * Convert an instance of BadDownloadRequest to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of BadDownloadRequest to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/src/main/java/Avalara/SDK/model/EInvoicing/V1/BadRequest.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/BadRequest.java index 5bd57fc..33b6b78 100644 --- a/src/main/java/Avalara/SDK/model/EInvoicing/V1/BadRequest.java +++ b/src/main/java/Avalara/SDK/model/EInvoicing/V1/BadRequest.java @@ -56,7 +56,7 @@ /** * Returns an HTTP status code and message for a 'bad request' */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class BadRequest { public static final String SERIALIZED_NAME_ERROR = "error"; @SerializedName(SERIALIZED_NAME_ERROR) @@ -74,10 +74,10 @@ public BadRequest error(String error) { return this; } - /** + /** * The three-digit HTTP error code for the bad request * @return error - **/ + */ @javax.annotation.Nullable public String getError() { return error; @@ -93,10 +93,10 @@ public BadRequest message(String message) { return this; } - /** + /** * A message explaining the bad request * @return message - **/ + */ @javax.annotation.Nullable public String getMessage() { return message; @@ -161,12 +161,12 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to BadRequest - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to BadRequest + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!BadRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -219,22 +219,22 @@ public BadRequest read(JsonReader in) throws IOException { } } - /** - * Create an instance of BadRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of BadRequest - * @throws IOException if the JSON string is invalid with respect to BadRequest - */ + /** + * Create an instance of BadRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of BadRequest + * @throws IOException if the JSON string is invalid with respect to BadRequest + */ public static BadRequest fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, BadRequest.class); } - /** - * Convert an instance of BadRequest to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of BadRequest to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/src/main/java/Avalara/SDK/model/EInvoicing/V1/BatchSearch.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/BatchSearch.java new file mode 100644 index 0000000..bec651a --- /dev/null +++ b/src/main/java/Avalara/SDK/model/EInvoicing/V1/BatchSearch.java @@ -0,0 +1,444 @@ +/* + * AvaTax Software Development Kit for Java (JRE) + * + * (c) 2004-2022 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * Avalara E-Invoicing API + * + * An API that supports sending data for an E-Invoicing compliance use-case. + * + * @author Sachin Baijal + * @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-JRE-SDK + */ + +package Avalara.SDK.model.EInvoicing.V1; + +import java.util.Objects; +import Avalara.SDK.model.EInvoicing.V1.ErrorResponse; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import Avalara.SDK.JSON; + +/** + * BatchSearch + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") +public class BatchSearch { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_CREATED_BY = "createdBy"; + @SerializedName(SERIALIZED_NAME_CREATED_BY) + private String createdBy; + + public static final String SERIALIZED_NAME_CREATED = "created"; + @SerializedName(SERIALIZED_NAME_CREATED) + private OffsetDateTime created; + + public static final String SERIALIZED_NAME_LAST_MODIFIED = "lastModified"; + @SerializedName(SERIALIZED_NAME_LAST_MODIFIED) + private OffsetDateTime lastModified; + + /** + * Status of the batch search + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + ACCEPTED("Accepted"), + + RUNNING("Running"), + + COMPLETED("Completed"), + + FAILED("Failed"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StatusEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public static final String SERIALIZED_NAME_ERROR = "error"; + @SerializedName(SERIALIZED_NAME_ERROR) + private ErrorResponse error; + + public BatchSearch() { + } + + public BatchSearch id(String id) { + this.id = id; + return this; + } + + /** + * ID of the batch search + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + + public BatchSearch name(String name) { + this.name = name; + return this; + } + + /** + * Name of the batch report + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public BatchSearch createdBy(String createdBy) { + this.createdBy = createdBy; + return this; + } + + /** + * Email of the user who created the batch search + * @return createdBy + */ + @javax.annotation.Nullable + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + + public BatchSearch created(OffsetDateTime created) { + this.created = created; + return this; + } + + /** + * Timestamp when the batch search was created + * @return created + */ + @javax.annotation.Nullable + public OffsetDateTime getCreated() { + return created; + } + + public void setCreated(OffsetDateTime created) { + this.created = created; + } + + + public BatchSearch lastModified(OffsetDateTime lastModified) { + this.lastModified = lastModified; + return this; + } + + /** + * Timestamp when the batch search was created + * @return lastModified + */ + @javax.annotation.Nullable + public OffsetDateTime getLastModified() { + return lastModified; + } + + public void setLastModified(OffsetDateTime lastModified) { + this.lastModified = lastModified; + } + + + public BatchSearch status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Status of the batch search + * @return status + */ + @javax.annotation.Nullable + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + public BatchSearch error(ErrorResponse error) { + this.error = error; + return this; + } + + /** + * Get error + * @return error + */ + @javax.annotation.Nullable + public ErrorResponse getError() { + return error; + } + + public void setError(ErrorResponse error) { + this.error = error; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BatchSearch batchSearch = (BatchSearch) o; + return Objects.equals(this.id, batchSearch.id) && + Objects.equals(this.name, batchSearch.name) && + Objects.equals(this.createdBy, batchSearch.createdBy) && + Objects.equals(this.created, batchSearch.created) && + Objects.equals(this.lastModified, batchSearch.lastModified) && + Objects.equals(this.status, batchSearch.status) && + Objects.equals(this.error, batchSearch.error); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, createdBy, created, lastModified, status, error); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BatchSearch {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" lastModified: ").append(toIndentedString(lastModified)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + openapiFields.add("createdBy"); + openapiFields.add("created"); + openapiFields.add("lastModified"); + openapiFields.add("status"); + openapiFields.add("error"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to BatchSearch + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BatchSearch.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in BatchSearch is not found in the empty JSON string", BatchSearch.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!BatchSearch.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BatchSearch` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("createdBy") != null && !jsonObj.get("createdBy").isJsonNull()) && !jsonObj.get("createdBy").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `createdBy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("createdBy").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + // validate the optional field `status` + if (jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) { + StatusEnum.validateJsonElement(jsonObj.get("status")); + } + // validate the optional field `error` + if (jsonObj.get("error") != null && !jsonObj.get("error").isJsonNull()) { + ErrorResponse.validateJsonElement(jsonObj.get("error")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BatchSearch.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BatchSearch' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BatchSearch.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BatchSearch value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BatchSearch read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BatchSearch given an JSON string + * + * @param jsonString JSON string + * @return An instance of BatchSearch + * @throws IOException if the JSON string is invalid with respect to BatchSearch + */ + public static BatchSearch fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BatchSearch.class); + } + + /** + * Convert an instance of BatchSearch to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/Avalara/SDK/model/EInvoicing/V1/BatchSearchListResponse.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/BatchSearchListResponse.java new file mode 100644 index 0000000..2c19d4e --- /dev/null +++ b/src/main/java/Avalara/SDK/model/EInvoicing/V1/BatchSearchListResponse.java @@ -0,0 +1,290 @@ +/* + * AvaTax Software Development Kit for Java (JRE) + * + * (c) 2004-2022 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * Avalara E-Invoicing API + * + * An API that supports sending data for an E-Invoicing compliance use-case. + * + * @author Sachin Baijal + * @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-JRE-SDK + */ + +package Avalara.SDK.model.EInvoicing.V1; + +import java.util.Objects; +import Avalara.SDK.model.EInvoicing.V1.BatchSearch; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import Avalara.SDK.JSON; + +/** + * Schema for batch search list + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") +public class BatchSearchListResponse { + public static final String SERIALIZED_NAME_AT_RECORD_SET_COUNT = "@recordSetCount"; + @SerializedName(SERIALIZED_NAME_AT_RECORD_SET_COUNT) + private Integer atRecordSetCount; + + public static final String SERIALIZED_NAME_AT_NEXT_LINK = "@nextLink"; + @SerializedName(SERIALIZED_NAME_AT_NEXT_LINK) + private String atNextLink; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private List value = new ArrayList<>(); + + public BatchSearchListResponse() { + } + + public BatchSearchListResponse atRecordSetCount(Integer atRecordSetCount) { + this.atRecordSetCount = atRecordSetCount; + return this; + } + + /** + * The count of records in the result set + * @return atRecordSetCount + */ + @javax.annotation.Nullable + public Integer getAtRecordSetCount() { + return atRecordSetCount; + } + + public void setAtRecordSetCount(Integer atRecordSetCount) { + this.atRecordSetCount = atRecordSetCount; + } + + + public BatchSearchListResponse atNextLink(String atNextLink) { + this.atNextLink = atNextLink; + return this; + } + + /** + * Next Link + * @return atNextLink + */ + @javax.annotation.Nullable + public String getAtNextLink() { + return atNextLink; + } + + public void setAtNextLink(String atNextLink) { + this.atNextLink = atNextLink; + } + + + public BatchSearchListResponse value(List value) { + this.value = value; + return this; + } + + public BatchSearchListResponse addValueItem(BatchSearch valueItem) { + if (this.value == null) { + this.value = new ArrayList<>(); + } + this.value.add(valueItem); + return this; + } + + /** + * Get value + * @return value + */ + @javax.annotation.Nullable + public List getValue() { + return value; + } + + public void setValue(List value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BatchSearchListResponse batchSearchListResponse = (BatchSearchListResponse) o; + return Objects.equals(this.atRecordSetCount, batchSearchListResponse.atRecordSetCount) && + Objects.equals(this.atNextLink, batchSearchListResponse.atNextLink) && + Objects.equals(this.value, batchSearchListResponse.value); + } + + @Override + public int hashCode() { + return Objects.hash(atRecordSetCount, atNextLink, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BatchSearchListResponse {\n"); + sb.append(" atRecordSetCount: ").append(toIndentedString(atRecordSetCount)).append("\n"); + sb.append(" atNextLink: ").append(toIndentedString(atNextLink)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("@recordSetCount"); + openapiFields.add("@nextLink"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to BatchSearchListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BatchSearchListResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in BatchSearchListResponse is not found in the empty JSON string", BatchSearchListResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!BatchSearchListResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BatchSearchListResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("@nextLink") != null && !jsonObj.get("@nextLink").isJsonNull()) && !jsonObj.get("@nextLink").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `@nextLink` to be a primitive type in the JSON string but got `%s`", jsonObj.get("@nextLink").toString())); + } + if (jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) { + JsonArray jsonArrayvalue = jsonObj.getAsJsonArray("value"); + if (jsonArrayvalue != null) { + // ensure the json data is an array + if (!jsonObj.get("value").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be an array in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + + // validate the optional field `value` (array) + for (int i = 0; i < jsonArrayvalue.size(); i++) { + BatchSearch.validateJsonElement(jsonArrayvalue.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BatchSearchListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BatchSearchListResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BatchSearchListResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BatchSearchListResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BatchSearchListResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BatchSearchListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of BatchSearchListResponse + * @throws IOException if the JSON string is invalid with respect to BatchSearchListResponse + */ + public static BatchSearchListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BatchSearchListResponse.class); + } + + /** + * Convert an instance of BatchSearchListResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/Avalara/SDK/model/EInvoicing/V1/ConditionalForField.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/ConditionalForField.java index 81255d0..aa054ae 100644 --- a/src/main/java/Avalara/SDK/model/EInvoicing/V1/ConditionalForField.java +++ b/src/main/java/Avalara/SDK/model/EInvoicing/V1/ConditionalForField.java @@ -59,7 +59,7 @@ /** * Mandates for which this field is conditional */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class ConditionalForField { public static final String SERIALIZED_NAME_COUNTRY_MANDATE = "countryMandate"; @SerializedName(SERIALIZED_NAME_COUNTRY_MANDATE) @@ -67,7 +67,7 @@ public class ConditionalForField { public static final String SERIALIZED_NAME_REQUIRED_WHEN = "requiredWhen"; @SerializedName(SERIALIZED_NAME_REQUIRED_WHEN) - private List requiredWhen; + private List requiredWhen = new ArrayList<>(); public ConditionalForField() { } @@ -77,10 +77,10 @@ public ConditionalForField countryMandate(String countryMandate) { return this; } - /** + /** * Get countryMandate * @return countryMandate - **/ + */ @javax.annotation.Nullable public String getCountryMandate() { return countryMandate; @@ -104,10 +104,10 @@ public ConditionalForField addRequiredWhenItem(RequiredWhenField requiredWhenIte return this; } - /** + /** * Array of scenarios which describe when a particular field is conditional for a country mandate * @return requiredWhen - **/ + */ @javax.annotation.Nullable public List getRequiredWhen() { return requiredWhen; @@ -172,12 +172,12 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ConditionalForField - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ConditionalForField + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ConditionalForField.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -196,19 +196,9 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("countryMandate") != null && !jsonObj.get("countryMandate").isJsonNull()) && !jsonObj.get("countryMandate").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `countryMandate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("countryMandate").toString())); } - if (jsonObj.get("requiredWhen") != null && !jsonObj.get("requiredWhen").isJsonNull()) { - JsonArray jsonArrayrequiredWhen = jsonObj.getAsJsonArray("requiredWhen"); - if (jsonArrayrequiredWhen != null) { - // ensure the json data is an array - if (!jsonObj.get("requiredWhen").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `requiredWhen` to be an array in the JSON string but got `%s`", jsonObj.get("requiredWhen").toString())); - } - - // validate the optional field `requiredWhen` (array) - for (int i = 0; i < jsonArrayrequiredWhen.size(); i++) { - RequiredWhenField.validateJsonElement(jsonArrayrequiredWhen.get(i)); - }; - } + // ensure the optional json data is an array if present + if (jsonObj.get("requiredWhen") != null && !jsonObj.get("requiredWhen").isJsonNull() && !jsonObj.get("requiredWhen").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `requiredWhen` to be an array in the JSON string but got `%s`", jsonObj.get("requiredWhen").toString())); } } @@ -241,22 +231,22 @@ public ConditionalForField read(JsonReader in) throws IOException { } } - /** - * Create an instance of ConditionalForField given an JSON string - * - * @param jsonString JSON string - * @return An instance of ConditionalForField - * @throws IOException if the JSON string is invalid with respect to ConditionalForField - */ + /** + * Create an instance of ConditionalForField given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConditionalForField + * @throws IOException if the JSON string is invalid with respect to ConditionalForField + */ public static ConditionalForField fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ConditionalForField.class); } - /** - * Convert an instance of ConditionalForField to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ConditionalForField to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/src/main/java/Avalara/SDK/model/EInvoicing/V1/DataInputField.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/DataInputField.java index db15f1c..7ab0948 100644 --- a/src/main/java/Avalara/SDK/model/EInvoicing/V1/DataInputField.java +++ b/src/main/java/Avalara/SDK/model/EInvoicing/V1/DataInputField.java @@ -62,7 +62,7 @@ /** * The Data Input Field */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class DataInputField { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -74,15 +74,15 @@ public class DataInputField { public static final String SERIALIZED_NAME_APPLICABLE_DOCUMENT_ROOTS = "applicableDocumentRoots"; @SerializedName(SERIALIZED_NAME_APPLICABLE_DOCUMENT_ROOTS) - private List applicableDocumentRoots; + private List applicableDocumentRoots = new ArrayList<>(); public static final String SERIALIZED_NAME_PATH = "path"; @SerializedName(SERIALIZED_NAME_PATH) private String path; - public static final String SERIALIZED_NAME_NAME_SPACE = "nameSpace"; - @SerializedName(SERIALIZED_NAME_NAME_SPACE) - private String nameSpace; + public static final String SERIALIZED_NAME_NAMESPACE = "namespace"; + @SerializedName(SERIALIZED_NAME_NAMESPACE) + private String namespace; public static final String SERIALIZED_NAME_FIELD_NAME = "fieldName"; @SerializedName(SERIALIZED_NAME_FIELD_NAME) @@ -114,7 +114,7 @@ public class DataInputField { public static final String SERIALIZED_NAME_CONDITIONAL_FOR = "conditionalFor"; @SerializedName(SERIALIZED_NAME_CONDITIONAL_FOR) - private List conditionalFor; + private List conditionalFor = new ArrayList<>(); public static final String SERIALIZED_NAME_NOT_USED_FOR = "notUsedFor"; @SerializedName(SERIALIZED_NAME_NOT_USED_FOR) @@ -132,10 +132,10 @@ public DataInputField id(String id) { return this; } - /** + /** * Field UUID * @return id - **/ + */ @javax.annotation.Nullable public String getId() { return id; @@ -151,10 +151,10 @@ public DataInputField fieldId(String fieldId) { return this; } - /** + /** * Field ID * @return fieldId - **/ + */ @javax.annotation.Nullable public String getFieldId() { return fieldId; @@ -178,10 +178,10 @@ public DataInputField addApplicableDocumentRootsItem(Object applicableDocumentRo return this; } - /** + /** * Get applicableDocumentRoots * @return applicableDocumentRoots - **/ + */ @javax.annotation.Nullable public List getApplicableDocumentRoots() { return applicableDocumentRoots; @@ -197,10 +197,10 @@ public DataInputField path(String path) { return this; } - /** + /** * Path to this field * @return path - **/ + */ @javax.annotation.Nullable public String getPath() { return path; @@ -211,22 +211,22 @@ public void setPath(String path) { } - public DataInputField nameSpace(String nameSpace) { - this.nameSpace = nameSpace; + public DataInputField namespace(String namespace) { + this.namespace = namespace; return this; } - /** + /** * Namespace of this field - * @return nameSpace - **/ + * @return namespace + */ @javax.annotation.Nullable - public String getNameSpace() { - return nameSpace; + public String getNamespace() { + return namespace; } - public void setNameSpace(String nameSpace) { - this.nameSpace = nameSpace; + public void setNamespace(String namespace) { + this.namespace = namespace; } @@ -235,10 +235,10 @@ public DataInputField fieldName(String fieldName) { return this; } - /** + /** * Field name * @return fieldName - **/ + */ @javax.annotation.Nullable public String getFieldName() { return fieldName; @@ -254,10 +254,10 @@ public DataInputField exampleOrFixedValue(String exampleOrFixedValue) { return this; } - /** + /** * An example of the content for this field * @return exampleOrFixedValue - **/ + */ @javax.annotation.Nullable public String getExampleOrFixedValue() { return exampleOrFixedValue; @@ -273,10 +273,10 @@ public DataInputField acceptedValues(Object acceptedValues) { return this; } - /** + /** * An object representing the acceptable values for this field * @return acceptedValues - **/ + */ @javax.annotation.Nullable public Object getAcceptedValues() { return acceptedValues; @@ -292,10 +292,10 @@ public DataInputField documentationLink(String documentationLink) { return this; } - /** + /** * An example of the content for this field * @return documentationLink - **/ + */ @javax.annotation.Nullable public String getDocumentationLink() { return documentationLink; @@ -311,10 +311,10 @@ public DataInputField description(String description) { return this; } - /** + /** * A description of this field * @return description - **/ + */ @javax.annotation.Nullable public String getDescription() { return description; @@ -330,10 +330,10 @@ public DataInputField isSegment(Boolean isSegment) { return this; } - /** + /** * Is this a segment of the schema * @return isSegment - **/ + */ @javax.annotation.Nullable public Boolean getIsSegment() { return isSegment; @@ -349,10 +349,10 @@ public DataInputField requiredFor(DataInputFieldRequiredFor requiredFor) { return this; } - /** + /** * Get requiredFor * @return requiredFor - **/ + */ @javax.annotation.Nullable public DataInputFieldRequiredFor getRequiredFor() { return requiredFor; @@ -376,10 +376,10 @@ public DataInputField addConditionalForItem(ConditionalForField conditionalForIt return this; } - /** + /** * Get conditionalFor * @return conditionalFor - **/ + */ @javax.annotation.Nullable public List getConditionalFor() { return conditionalFor; @@ -395,10 +395,10 @@ public DataInputField notUsedFor(DataInputFieldNotUsedFor notUsedFor) { return this; } - /** + /** * Get notUsedFor * @return notUsedFor - **/ + */ @javax.annotation.Nullable public DataInputFieldNotUsedFor getNotUsedFor() { return notUsedFor; @@ -414,10 +414,10 @@ public DataInputField optionalFor(DataInputFieldOptionalFor optionalFor) { return this; } - /** + /** * Get optionalFor * @return optionalFor - **/ + */ @javax.annotation.Nullable public DataInputFieldOptionalFor getOptionalFor() { return optionalFor; @@ -442,7 +442,7 @@ public boolean equals(Object o) { Objects.equals(this.fieldId, dataInputField.fieldId) && Objects.equals(this.applicableDocumentRoots, dataInputField.applicableDocumentRoots) && Objects.equals(this.path, dataInputField.path) && - Objects.equals(this.nameSpace, dataInputField.nameSpace) && + Objects.equals(this.namespace, dataInputField.namespace) && Objects.equals(this.fieldName, dataInputField.fieldName) && Objects.equals(this.exampleOrFixedValue, dataInputField.exampleOrFixedValue) && Objects.equals(this.acceptedValues, dataInputField.acceptedValues) && @@ -457,7 +457,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(id, fieldId, applicableDocumentRoots, path, nameSpace, fieldName, exampleOrFixedValue, acceptedValues, documentationLink, description, isSegment, requiredFor, conditionalFor, notUsedFor, optionalFor); + return Objects.hash(id, fieldId, applicableDocumentRoots, path, namespace, fieldName, exampleOrFixedValue, acceptedValues, documentationLink, description, isSegment, requiredFor, conditionalFor, notUsedFor, optionalFor); } @Override @@ -468,7 +468,7 @@ public String toString() { sb.append(" fieldId: ").append(toIndentedString(fieldId)).append("\n"); sb.append(" applicableDocumentRoots: ").append(toIndentedString(applicableDocumentRoots)).append("\n"); sb.append(" path: ").append(toIndentedString(path)).append("\n"); - sb.append(" nameSpace: ").append(toIndentedString(nameSpace)).append("\n"); + sb.append(" namespace: ").append(toIndentedString(namespace)).append("\n"); sb.append(" fieldName: ").append(toIndentedString(fieldName)).append("\n"); sb.append(" exampleOrFixedValue: ").append(toIndentedString(exampleOrFixedValue)).append("\n"); sb.append(" acceptedValues: ").append(toIndentedString(acceptedValues)).append("\n"); @@ -505,7 +505,7 @@ private String toIndentedString(Object o) { openapiFields.add("fieldId"); openapiFields.add("applicableDocumentRoots"); openapiFields.add("path"); - openapiFields.add("nameSpace"); + openapiFields.add("namespace"); openapiFields.add("fieldName"); openapiFields.add("exampleOrFixedValue"); openapiFields.add("acceptedValues"); @@ -521,12 +521,12 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to DataInputField - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DataInputField + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!DataInputField.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -555,8 +555,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("path") != null && !jsonObj.get("path").isJsonNull()) && !jsonObj.get("path").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `path` to be a primitive type in the JSON string but got `%s`", jsonObj.get("path").toString())); } - if ((jsonObj.get("nameSpace") != null && !jsonObj.get("nameSpace").isJsonNull()) && !jsonObj.get("nameSpace").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `nameSpace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nameSpace").toString())); + if ((jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonNull()) && !jsonObj.get("namespace").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `namespace` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespace").toString())); } if ((jsonObj.get("fieldName") != null && !jsonObj.get("fieldName").isJsonNull()) && !jsonObj.get("fieldName").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `fieldName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fieldName").toString())); @@ -627,22 +627,22 @@ public DataInputField read(JsonReader in) throws IOException { } } - /** - * Create an instance of DataInputField given an JSON string - * - * @param jsonString JSON string - * @return An instance of DataInputField - * @throws IOException if the JSON string is invalid with respect to DataInputField - */ + /** + * Create an instance of DataInputField given an JSON string + * + * @param jsonString JSON string + * @return An instance of DataInputField + * @throws IOException if the JSON string is invalid with respect to DataInputField + */ public static DataInputField fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, DataInputField.class); } - /** - * Convert an instance of DataInputField to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of DataInputField to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/src/main/java/Avalara/SDK/model/EInvoicing/V1/DataInputFieldNotUsedFor.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/DataInputFieldNotUsedFor.java index 094a48a..b52d23a 100644 --- a/src/main/java/Avalara/SDK/model/EInvoicing/V1/DataInputFieldNotUsedFor.java +++ b/src/main/java/Avalara/SDK/model/EInvoicing/V1/DataInputFieldNotUsedFor.java @@ -56,7 +56,7 @@ /** * Array of CountryMandate names for which this field is not used. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class DataInputFieldNotUsedFor { public static final String SERIALIZED_NAME_COUNTRY_MANDATE = "countryMandate"; @SerializedName(SERIALIZED_NAME_COUNTRY_MANDATE) @@ -70,10 +70,10 @@ public DataInputFieldNotUsedFor countryMandate(String countryMandate) { return this; } - /** + /** * Get countryMandate * @return countryMandate - **/ + */ @javax.annotation.Nullable public String getCountryMandate() { return countryMandate; @@ -135,12 +135,12 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to DataInputFieldNotUsedFor - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DataInputFieldNotUsedFor + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!DataInputFieldNotUsedFor.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -190,22 +190,22 @@ public DataInputFieldNotUsedFor read(JsonReader in) throws IOException { } } - /** - * Create an instance of DataInputFieldNotUsedFor given an JSON string - * - * @param jsonString JSON string - * @return An instance of DataInputFieldNotUsedFor - * @throws IOException if the JSON string is invalid with respect to DataInputFieldNotUsedFor - */ + /** + * Create an instance of DataInputFieldNotUsedFor given an JSON string + * + * @param jsonString JSON string + * @return An instance of DataInputFieldNotUsedFor + * @throws IOException if the JSON string is invalid with respect to DataInputFieldNotUsedFor + */ public static DataInputFieldNotUsedFor fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, DataInputFieldNotUsedFor.class); } - /** - * Convert an instance of DataInputFieldNotUsedFor to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of DataInputFieldNotUsedFor to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/src/main/java/Avalara/SDK/model/EInvoicing/V1/DataInputFieldOptionalFor.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/DataInputFieldOptionalFor.java index 38d7b57..eb4c40e 100644 --- a/src/main/java/Avalara/SDK/model/EInvoicing/V1/DataInputFieldOptionalFor.java +++ b/src/main/java/Avalara/SDK/model/EInvoicing/V1/DataInputFieldOptionalFor.java @@ -56,7 +56,7 @@ /** * Array of CountryMandate names for which this field is optional. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class DataInputFieldOptionalFor { public static final String SERIALIZED_NAME_COUNTRY_MANDATE = "countryMandate"; @SerializedName(SERIALIZED_NAME_COUNTRY_MANDATE) @@ -70,10 +70,10 @@ public DataInputFieldOptionalFor countryMandate(String countryMandate) { return this; } - /** + /** * Get countryMandate * @return countryMandate - **/ + */ @javax.annotation.Nullable public String getCountryMandate() { return countryMandate; @@ -135,12 +135,12 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to DataInputFieldOptionalFor - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DataInputFieldOptionalFor + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!DataInputFieldOptionalFor.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -190,22 +190,22 @@ public DataInputFieldOptionalFor read(JsonReader in) throws IOException { } } - /** - * Create an instance of DataInputFieldOptionalFor given an JSON string - * - * @param jsonString JSON string - * @return An instance of DataInputFieldOptionalFor - * @throws IOException if the JSON string is invalid with respect to DataInputFieldOptionalFor - */ + /** + * Create an instance of DataInputFieldOptionalFor given an JSON string + * + * @param jsonString JSON string + * @return An instance of DataInputFieldOptionalFor + * @throws IOException if the JSON string is invalid with respect to DataInputFieldOptionalFor + */ public static DataInputFieldOptionalFor fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, DataInputFieldOptionalFor.class); } - /** - * Convert an instance of DataInputFieldOptionalFor to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of DataInputFieldOptionalFor to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/src/main/java/Avalara/SDK/model/EInvoicing/V1/DataInputFieldRequiredFor.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/DataInputFieldRequiredFor.java index d458b12..c672f67 100644 --- a/src/main/java/Avalara/SDK/model/EInvoicing/V1/DataInputFieldRequiredFor.java +++ b/src/main/java/Avalara/SDK/model/EInvoicing/V1/DataInputFieldRequiredFor.java @@ -56,7 +56,7 @@ /** * Array of CountryMandate names for which this field is required. */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class DataInputFieldRequiredFor { public static final String SERIALIZED_NAME_COUNTRY_MANDATE = "countryMandate"; @SerializedName(SERIALIZED_NAME_COUNTRY_MANDATE) @@ -70,10 +70,10 @@ public DataInputFieldRequiredFor countryMandate(String countryMandate) { return this; } - /** + /** * Get countryMandate * @return countryMandate - **/ + */ @javax.annotation.Nullable public String getCountryMandate() { return countryMandate; @@ -135,12 +135,12 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to DataInputFieldRequiredFor - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DataInputFieldRequiredFor + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!DataInputFieldRequiredFor.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -190,22 +190,22 @@ public DataInputFieldRequiredFor read(JsonReader in) throws IOException { } } - /** - * Create an instance of DataInputFieldRequiredFor given an JSON string - * - * @param jsonString JSON string - * @return An instance of DataInputFieldRequiredFor - * @throws IOException if the JSON string is invalid with respect to DataInputFieldRequiredFor - */ + /** + * Create an instance of DataInputFieldRequiredFor given an JSON string + * + * @param jsonString JSON string + * @return An instance of DataInputFieldRequiredFor + * @throws IOException if the JSON string is invalid with respect to DataInputFieldRequiredFor + */ public static DataInputFieldRequiredFor fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, DataInputFieldRequiredFor.class); } - /** - * Convert an instance of DataInputFieldRequiredFor to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of DataInputFieldRequiredFor to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/src/main/java/Avalara/SDK/model/EInvoicing/V1/DataInputFieldsResponse.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/DataInputFieldsResponse.java index 45ec99e..f426b79 100644 --- a/src/main/java/Avalara/SDK/model/EInvoicing/V1/DataInputFieldsResponse.java +++ b/src/main/java/Avalara/SDK/model/EInvoicing/V1/DataInputFieldsResponse.java @@ -61,11 +61,11 @@ /** * DataInputFieldsResponse */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class DataInputFieldsResponse { - public static final String SERIALIZED_NAME_AT_RECORD_SET_COUNT = "@recordSetCount"; - @SerializedName(SERIALIZED_NAME_AT_RECORD_SET_COUNT) - private BigDecimal atRecordSetCount; + public static final String SERIALIZED_NAME_AT_RECORDSET_COUNT = "@recordsetCount"; + @SerializedName(SERIALIZED_NAME_AT_RECORDSET_COUNT) + private BigDecimal atRecordsetCount; public static final String SERIALIZED_NAME_AT_NEXT_LINK = "@nextLink"; @SerializedName(SERIALIZED_NAME_AT_NEXT_LINK) @@ -73,27 +73,27 @@ public class DataInputFieldsResponse { public static final String SERIALIZED_NAME_VALUE = "value"; @SerializedName(SERIALIZED_NAME_VALUE) - private List value; + private List value = new ArrayList<>(); public DataInputFieldsResponse() { } - public DataInputFieldsResponse atRecordSetCount(BigDecimal atRecordSetCount) { - this.atRecordSetCount = atRecordSetCount; + public DataInputFieldsResponse atRecordsetCount(BigDecimal atRecordsetCount) { + this.atRecordsetCount = atRecordsetCount; return this; } - /** + /** * Total count of results - * @return atRecordSetCount - **/ + * @return atRecordsetCount + */ @javax.annotation.Nullable - public BigDecimal getAtRecordSetCount() { - return atRecordSetCount; + public BigDecimal getAtRecordsetCount() { + return atRecordsetCount; } - public void setAtRecordSetCount(BigDecimal atRecordSetCount) { - this.atRecordSetCount = atRecordSetCount; + public void setAtRecordsetCount(BigDecimal atRecordsetCount) { + this.atRecordsetCount = atRecordsetCount; } @@ -102,10 +102,10 @@ public DataInputFieldsResponse atNextLink(String atNextLink) { return this; } - /** + /** * Get atNextLink * @return atNextLink - **/ + */ @javax.annotation.Nullable public String getAtNextLink() { return atNextLink; @@ -129,10 +129,10 @@ public DataInputFieldsResponse addValueItem(DataInputField valueItem) { return this; } - /** + /** * Array of Data Input Fields * @return value - **/ + */ @javax.annotation.Nullable public List getValue() { return value; @@ -153,7 +153,7 @@ public boolean equals(Object o) { return false; } DataInputFieldsResponse dataInputFieldsResponse = (DataInputFieldsResponse) o; - return Objects.equals(this.atRecordSetCount, dataInputFieldsResponse.atRecordSetCount) && + return Objects.equals(this.atRecordsetCount, dataInputFieldsResponse.atRecordsetCount) && Objects.equals(this.atNextLink, dataInputFieldsResponse.atNextLink) && Objects.equals(this.value, dataInputFieldsResponse.value); } @@ -164,7 +164,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(atRecordSetCount, atNextLink, value); + return Objects.hash(atRecordsetCount, atNextLink, value); } private static int hashCodeNullable(JsonNullable a) { @@ -178,7 +178,7 @@ private static int hashCodeNullable(JsonNullable a) { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class DataInputFieldsResponse {\n"); - sb.append(" atRecordSetCount: ").append(toIndentedString(atRecordSetCount)).append("\n"); + sb.append(" atRecordsetCount: ").append(toIndentedString(atRecordsetCount)).append("\n"); sb.append(" atNextLink: ").append(toIndentedString(atNextLink)).append("\n"); sb.append(" value: ").append(toIndentedString(value)).append("\n"); sb.append("}"); @@ -203,7 +203,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("@recordSetCount"); + openapiFields.add("@recordsetCount"); openapiFields.add("@nextLink"); openapiFields.add("value"); @@ -211,12 +211,12 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to DataInputFieldsResponse - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DataInputFieldsResponse + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!DataInputFieldsResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -235,19 +235,9 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("@nextLink") != null && !jsonObj.get("@nextLink").isJsonNull()) && !jsonObj.get("@nextLink").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `@nextLink` to be a primitive type in the JSON string but got `%s`", jsonObj.get("@nextLink").toString())); } - if (jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) { - JsonArray jsonArrayvalue = jsonObj.getAsJsonArray("value"); - if (jsonArrayvalue != null) { - // ensure the json data is an array - if (!jsonObj.get("value").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `value` to be an array in the JSON string but got `%s`", jsonObj.get("value").toString())); - } - - // validate the optional field `value` (array) - for (int i = 0; i < jsonArrayvalue.size(); i++) { - DataInputField.validateJsonElement(jsonArrayvalue.get(i)); - }; - } + // ensure the optional json data is an array if present + if (jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull() && !jsonObj.get("value").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be an array in the JSON string but got `%s`", jsonObj.get("value").toString())); } } @@ -280,22 +270,22 @@ public DataInputFieldsResponse read(JsonReader in) throws IOException { } } - /** - * Create an instance of DataInputFieldsResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of DataInputFieldsResponse - * @throws IOException if the JSON string is invalid with respect to DataInputFieldsResponse - */ + /** + * Create an instance of DataInputFieldsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of DataInputFieldsResponse + * @throws IOException if the JSON string is invalid with respect to DataInputFieldsResponse + */ public static DataInputFieldsResponse fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, DataInputFieldsResponse.class); } - /** - * Convert an instance of DataInputFieldsResponse to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of DataInputFieldsResponse to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/src/main/java/Avalara/SDK/model/EInvoicing/V1/DirectorySearchResponse.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/DirectorySearchResponse.java new file mode 100644 index 0000000..199f22b --- /dev/null +++ b/src/main/java/Avalara/SDK/model/EInvoicing/V1/DirectorySearchResponse.java @@ -0,0 +1,290 @@ +/* + * AvaTax Software Development Kit for Java (JRE) + * + * (c) 2004-2022 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * Avalara E-Invoicing API + * + * An API that supports sending data for an E-Invoicing compliance use-case. + * + * @author Sachin Baijal + * @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-JRE-SDK + */ + +package Avalara.SDK.model.EInvoicing.V1; + +import java.util.Objects; +import Avalara.SDK.model.EInvoicing.V1.DirectorySearchResponseValueInner; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import Avalara.SDK.JSON; + +/** + * Response schema for directory search results + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") +public class DirectorySearchResponse { + public static final String SERIALIZED_NAME_AT_RECORD_SET_COUNT = "@recordSetCount"; + @SerializedName(SERIALIZED_NAME_AT_RECORD_SET_COUNT) + private Integer atRecordSetCount; + + public static final String SERIALIZED_NAME_AT_NEXT_LINK = "@nextLink"; + @SerializedName(SERIALIZED_NAME_AT_NEXT_LINK) + private String atNextLink; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private List value = new ArrayList<>(); + + public DirectorySearchResponse() { + } + + public DirectorySearchResponse atRecordSetCount(Integer atRecordSetCount) { + this.atRecordSetCount = atRecordSetCount; + return this; + } + + /** + * The count of records in the result set + * @return atRecordSetCount + */ + @javax.annotation.Nullable + public Integer getAtRecordSetCount() { + return atRecordSetCount; + } + + public void setAtRecordSetCount(Integer atRecordSetCount) { + this.atRecordSetCount = atRecordSetCount; + } + + + public DirectorySearchResponse atNextLink(String atNextLink) { + this.atNextLink = atNextLink; + return this; + } + + /** + * The next page link to get the next set of results. + * @return atNextLink + */ + @javax.annotation.Nullable + public String getAtNextLink() { + return atNextLink; + } + + public void setAtNextLink(String atNextLink) { + this.atNextLink = atNextLink; + } + + + public DirectorySearchResponse value(List value) { + this.value = value; + return this; + } + + public DirectorySearchResponse addValueItem(DirectorySearchResponseValueInner valueItem) { + if (this.value == null) { + this.value = new ArrayList<>(); + } + this.value.add(valueItem); + return this; + } + + /** + * Get value + * @return value + */ + @javax.annotation.Nullable + public List getValue() { + return value; + } + + public void setValue(List value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DirectorySearchResponse directorySearchResponse = (DirectorySearchResponse) o; + return Objects.equals(this.atRecordSetCount, directorySearchResponse.atRecordSetCount) && + Objects.equals(this.atNextLink, directorySearchResponse.atNextLink) && + Objects.equals(this.value, directorySearchResponse.value); + } + + @Override + public int hashCode() { + return Objects.hash(atRecordSetCount, atNextLink, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DirectorySearchResponse {\n"); + sb.append(" atRecordSetCount: ").append(toIndentedString(atRecordSetCount)).append("\n"); + sb.append(" atNextLink: ").append(toIndentedString(atNextLink)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("@recordSetCount"); + openapiFields.add("@nextLink"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DirectorySearchResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DirectorySearchResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DirectorySearchResponse is not found in the empty JSON string", DirectorySearchResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!DirectorySearchResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DirectorySearchResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("@nextLink") != null && !jsonObj.get("@nextLink").isJsonNull()) && !jsonObj.get("@nextLink").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `@nextLink` to be a primitive type in the JSON string but got `%s`", jsonObj.get("@nextLink").toString())); + } + if (jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) { + JsonArray jsonArrayvalue = jsonObj.getAsJsonArray("value"); + if (jsonArrayvalue != null) { + // ensure the json data is an array + if (!jsonObj.get("value").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be an array in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + + // validate the optional field `value` (array) + for (int i = 0; i < jsonArrayvalue.size(); i++) { + DirectorySearchResponseValueInner.validateJsonElement(jsonArrayvalue.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DirectorySearchResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DirectorySearchResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DirectorySearchResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DirectorySearchResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DirectorySearchResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DirectorySearchResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of DirectorySearchResponse + * @throws IOException if the JSON string is invalid with respect to DirectorySearchResponse + */ + public static DirectorySearchResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DirectorySearchResponse.class); + } + + /** + * Convert an instance of DirectorySearchResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/Avalara/SDK/model/EInvoicing/V1/DirectorySearchResponseValueInner.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/DirectorySearchResponseValueInner.java new file mode 100644 index 0000000..9c846d5 --- /dev/null +++ b/src/main/java/Avalara/SDK/model/EInvoicing/V1/DirectorySearchResponseValueInner.java @@ -0,0 +1,447 @@ +/* + * AvaTax Software Development Kit for Java (JRE) + * + * (c) 2004-2022 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * Avalara E-Invoicing API + * + * An API that supports sending data for an E-Invoicing compliance use-case. + * + * @author Sachin Baijal + * @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-JRE-SDK + */ + +package Avalara.SDK.model.EInvoicing.V1; + +import java.util.Objects; +import Avalara.SDK.model.EInvoicing.V1.DirectorySearchResponseValueInnerAddressesInner; +import Avalara.SDK.model.EInvoicing.V1.DirectorySearchResponseValueInnerIdentifiersInner; +import Avalara.SDK.model.EInvoicing.V1.DirectorySearchResponseValueInnerSupportedDocumentTypesInner; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.LocalDate; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import Avalara.SDK.JSON; + +/** + * DirectorySearchResponseValueInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") +public class DirectorySearchResponseValueInner { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_NETWORK = "network"; + @SerializedName(SERIALIZED_NAME_NETWORK) + private String network; + + public static final String SERIALIZED_NAME_REGISTRATION_DATE = "registrationDate"; + @SerializedName(SERIALIZED_NAME_REGISTRATION_DATE) + private LocalDate registrationDate; + + public static final String SERIALIZED_NAME_IDENTIFIERS = "identifiers"; + @SerializedName(SERIALIZED_NAME_IDENTIFIERS) + private List identifiers = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ADDRESSES = "addresses"; + @SerializedName(SERIALIZED_NAME_ADDRESSES) + private List addresses = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SUPPORTED_DOCUMENT_TYPES = "supportedDocumentTypes"; + @SerializedName(SERIALIZED_NAME_SUPPORTED_DOCUMENT_TYPES) + private List supportedDocumentTypes = new ArrayList<>(); + + public DirectorySearchResponseValueInner() { + } + + public DirectorySearchResponseValueInner id(String id) { + this.id = id; + return this; + } + + /** + * Avalara unique ID of the participant in the directory. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + + public DirectorySearchResponseValueInner name(String name) { + this.name = name; + return this; + } + + /** + * Name of the participant (typically, the name of the business entity). + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public DirectorySearchResponseValueInner network(String network) { + this.network = network; + return this; + } + + /** + * The network where the participant is present. + * @return network + */ + @javax.annotation.Nullable + public String getNetwork() { + return network; + } + + public void setNetwork(String network) { + this.network = network; + } + + + public DirectorySearchResponseValueInner registrationDate(LocalDate registrationDate) { + this.registrationDate = registrationDate; + return this; + } + + /** + * Registration date of the participant if available + * @return registrationDate + */ + @javax.annotation.Nullable + public LocalDate getRegistrationDate() { + return registrationDate; + } + + public void setRegistrationDate(LocalDate registrationDate) { + this.registrationDate = registrationDate; + } + + + public DirectorySearchResponseValueInner identifiers(List identifiers) { + this.identifiers = identifiers; + return this; + } + + public DirectorySearchResponseValueInner addIdentifiersItem(DirectorySearchResponseValueInnerIdentifiersInner identifiersItem) { + if (this.identifiers == null) { + this.identifiers = new ArrayList<>(); + } + this.identifiers.add(identifiersItem); + return this; + } + + /** + * Get identifiers + * @return identifiers + */ + @javax.annotation.Nullable + public List getIdentifiers() { + return identifiers; + } + + public void setIdentifiers(List identifiers) { + this.identifiers = identifiers; + } + + + public DirectorySearchResponseValueInner addresses(List addresses) { + this.addresses = addresses; + return this; + } + + public DirectorySearchResponseValueInner addAddressesItem(DirectorySearchResponseValueInnerAddressesInner addressesItem) { + if (this.addresses == null) { + this.addresses = new ArrayList<>(); + } + this.addresses.add(addressesItem); + return this; + } + + /** + * Get addresses + * @return addresses + */ + @javax.annotation.Nullable + public List getAddresses() { + return addresses; + } + + public void setAddresses(List addresses) { + this.addresses = addresses; + } + + + public DirectorySearchResponseValueInner supportedDocumentTypes(List supportedDocumentTypes) { + this.supportedDocumentTypes = supportedDocumentTypes; + return this; + } + + public DirectorySearchResponseValueInner addSupportedDocumentTypesItem(DirectorySearchResponseValueInnerSupportedDocumentTypesInner supportedDocumentTypesItem) { + if (this.supportedDocumentTypes == null) { + this.supportedDocumentTypes = new ArrayList<>(); + } + this.supportedDocumentTypes.add(supportedDocumentTypesItem); + return this; + } + + /** + * Get supportedDocumentTypes + * @return supportedDocumentTypes + */ + @javax.annotation.Nullable + public List getSupportedDocumentTypes() { + return supportedDocumentTypes; + } + + public void setSupportedDocumentTypes(List supportedDocumentTypes) { + this.supportedDocumentTypes = supportedDocumentTypes; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DirectorySearchResponseValueInner directorySearchResponseValueInner = (DirectorySearchResponseValueInner) o; + return Objects.equals(this.id, directorySearchResponseValueInner.id) && + Objects.equals(this.name, directorySearchResponseValueInner.name) && + Objects.equals(this.network, directorySearchResponseValueInner.network) && + Objects.equals(this.registrationDate, directorySearchResponseValueInner.registrationDate) && + Objects.equals(this.identifiers, directorySearchResponseValueInner.identifiers) && + Objects.equals(this.addresses, directorySearchResponseValueInner.addresses) && + Objects.equals(this.supportedDocumentTypes, directorySearchResponseValueInner.supportedDocumentTypes); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, network, registrationDate, identifiers, addresses, supportedDocumentTypes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DirectorySearchResponseValueInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" network: ").append(toIndentedString(network)).append("\n"); + sb.append(" registrationDate: ").append(toIndentedString(registrationDate)).append("\n"); + sb.append(" identifiers: ").append(toIndentedString(identifiers)).append("\n"); + sb.append(" addresses: ").append(toIndentedString(addresses)).append("\n"); + sb.append(" supportedDocumentTypes: ").append(toIndentedString(supportedDocumentTypes)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + openapiFields.add("network"); + openapiFields.add("registrationDate"); + openapiFields.add("identifiers"); + openapiFields.add("addresses"); + openapiFields.add("supportedDocumentTypes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DirectorySearchResponseValueInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DirectorySearchResponseValueInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DirectorySearchResponseValueInner is not found in the empty JSON string", DirectorySearchResponseValueInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!DirectorySearchResponseValueInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DirectorySearchResponseValueInner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("network") != null && !jsonObj.get("network").isJsonNull()) && !jsonObj.get("network").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `network` to be a primitive type in the JSON string but got `%s`", jsonObj.get("network").toString())); + } + if (jsonObj.get("identifiers") != null && !jsonObj.get("identifiers").isJsonNull()) { + JsonArray jsonArrayidentifiers = jsonObj.getAsJsonArray("identifiers"); + if (jsonArrayidentifiers != null) { + // ensure the json data is an array + if (!jsonObj.get("identifiers").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `identifiers` to be an array in the JSON string but got `%s`", jsonObj.get("identifiers").toString())); + } + + // validate the optional field `identifiers` (array) + for (int i = 0; i < jsonArrayidentifiers.size(); i++) { + DirectorySearchResponseValueInnerIdentifiersInner.validateJsonElement(jsonArrayidentifiers.get(i)); + }; + } + } + if (jsonObj.get("addresses") != null && !jsonObj.get("addresses").isJsonNull()) { + JsonArray jsonArrayaddresses = jsonObj.getAsJsonArray("addresses"); + if (jsonArrayaddresses != null) { + // ensure the json data is an array + if (!jsonObj.get("addresses").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `addresses` to be an array in the JSON string but got `%s`", jsonObj.get("addresses").toString())); + } + + // validate the optional field `addresses` (array) + for (int i = 0; i < jsonArrayaddresses.size(); i++) { + DirectorySearchResponseValueInnerAddressesInner.validateJsonElement(jsonArrayaddresses.get(i)); + }; + } + } + if (jsonObj.get("supportedDocumentTypes") != null && !jsonObj.get("supportedDocumentTypes").isJsonNull()) { + JsonArray jsonArraysupportedDocumentTypes = jsonObj.getAsJsonArray("supportedDocumentTypes"); + if (jsonArraysupportedDocumentTypes != null) { + // ensure the json data is an array + if (!jsonObj.get("supportedDocumentTypes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `supportedDocumentTypes` to be an array in the JSON string but got `%s`", jsonObj.get("supportedDocumentTypes").toString())); + } + + // validate the optional field `supportedDocumentTypes` (array) + for (int i = 0; i < jsonArraysupportedDocumentTypes.size(); i++) { + DirectorySearchResponseValueInnerSupportedDocumentTypesInner.validateJsonElement(jsonArraysupportedDocumentTypes.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DirectorySearchResponseValueInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DirectorySearchResponseValueInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DirectorySearchResponseValueInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DirectorySearchResponseValueInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DirectorySearchResponseValueInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DirectorySearchResponseValueInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of DirectorySearchResponseValueInner + * @throws IOException if the JSON string is invalid with respect to DirectorySearchResponseValueInner + */ + public static DirectorySearchResponseValueInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DirectorySearchResponseValueInner.class); + } + + /** + * Convert an instance of DirectorySearchResponseValueInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/Avalara/SDK/model/EInvoicing/V1/DirectorySearchResponseValueInnerAddressesInner.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/DirectorySearchResponseValueInnerAddressesInner.java new file mode 100644 index 0000000..381f382 --- /dev/null +++ b/src/main/java/Avalara/SDK/model/EInvoicing/V1/DirectorySearchResponseValueInnerAddressesInner.java @@ -0,0 +1,329 @@ +/* + * AvaTax Software Development Kit for Java (JRE) + * + * (c) 2004-2022 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * Avalara E-Invoicing API + * + * An API that supports sending data for an E-Invoicing compliance use-case. + * + * @author Sachin Baijal + * @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-JRE-SDK + */ + +package Avalara.SDK.model.EInvoicing.V1; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import Avalara.SDK.JSON; + +/** + * DirectorySearchResponseValueInnerAddressesInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") +public class DirectorySearchResponseValueInnerAddressesInner { + public static final String SERIALIZED_NAME_LINE1 = "line1"; + @SerializedName(SERIALIZED_NAME_LINE1) + private String line1; + + public static final String SERIALIZED_NAME_LINE2 = "line2"; + @SerializedName(SERIALIZED_NAME_LINE2) + private String line2; + + public static final String SERIALIZED_NAME_CITY = "city"; + @SerializedName(SERIALIZED_NAME_CITY) + private String city; + + public static final String SERIALIZED_NAME_STATE = "state"; + @SerializedName(SERIALIZED_NAME_STATE) + private String state; + + public static final String SERIALIZED_NAME_COUNTRY = "country"; + @SerializedName(SERIALIZED_NAME_COUNTRY) + private String country; + + public DirectorySearchResponseValueInnerAddressesInner() { + } + + public DirectorySearchResponseValueInnerAddressesInner line1(String line1) { + this.line1 = line1; + return this; + } + + /** + * Address line 1 + * @return line1 + */ + @javax.annotation.Nullable + public String getLine1() { + return line1; + } + + public void setLine1(String line1) { + this.line1 = line1; + } + + + public DirectorySearchResponseValueInnerAddressesInner line2(String line2) { + this.line2 = line2; + return this; + } + + /** + * Address line 2 + * @return line2 + */ + @javax.annotation.Nullable + public String getLine2() { + return line2; + } + + public void setLine2(String line2) { + this.line2 = line2; + } + + + public DirectorySearchResponseValueInnerAddressesInner city(String city) { + this.city = city; + return this; + } + + /** + * City + * @return city + */ + @javax.annotation.Nullable + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } + + + public DirectorySearchResponseValueInnerAddressesInner state(String state) { + this.state = state; + return this; + } + + /** + * State + * @return state + */ + @javax.annotation.Nullable + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + + public DirectorySearchResponseValueInnerAddressesInner country(String country) { + this.country = country; + return this; + } + + /** + * Country + * @return country + */ + @javax.annotation.Nullable + public String getCountry() { + return country; + } + + public void setCountry(String country) { + this.country = country; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DirectorySearchResponseValueInnerAddressesInner directorySearchResponseValueInnerAddressesInner = (DirectorySearchResponseValueInnerAddressesInner) o; + return Objects.equals(this.line1, directorySearchResponseValueInnerAddressesInner.line1) && + Objects.equals(this.line2, directorySearchResponseValueInnerAddressesInner.line2) && + Objects.equals(this.city, directorySearchResponseValueInnerAddressesInner.city) && + Objects.equals(this.state, directorySearchResponseValueInnerAddressesInner.state) && + Objects.equals(this.country, directorySearchResponseValueInnerAddressesInner.country); + } + + @Override + public int hashCode() { + return Objects.hash(line1, line2, city, state, country); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DirectorySearchResponseValueInnerAddressesInner {\n"); + sb.append(" line1: ").append(toIndentedString(line1)).append("\n"); + sb.append(" line2: ").append(toIndentedString(line2)).append("\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("line1"); + openapiFields.add("line2"); + openapiFields.add("city"); + openapiFields.add("state"); + openapiFields.add("country"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DirectorySearchResponseValueInnerAddressesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DirectorySearchResponseValueInnerAddressesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DirectorySearchResponseValueInnerAddressesInner is not found in the empty JSON string", DirectorySearchResponseValueInnerAddressesInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!DirectorySearchResponseValueInnerAddressesInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DirectorySearchResponseValueInnerAddressesInner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("line1") != null && !jsonObj.get("line1").isJsonNull()) && !jsonObj.get("line1").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `line1` to be a primitive type in the JSON string but got `%s`", jsonObj.get("line1").toString())); + } + if ((jsonObj.get("line2") != null && !jsonObj.get("line2").isJsonNull()) && !jsonObj.get("line2").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `line2` to be a primitive type in the JSON string but got `%s`", jsonObj.get("line2").toString())); + } + if ((jsonObj.get("city") != null && !jsonObj.get("city").isJsonNull()) && !jsonObj.get("city").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `city` to be a primitive type in the JSON string but got `%s`", jsonObj.get("city").toString())); + } + if ((jsonObj.get("state") != null && !jsonObj.get("state").isJsonNull()) && !jsonObj.get("state").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `state` to be a primitive type in the JSON string but got `%s`", jsonObj.get("state").toString())); + } + if ((jsonObj.get("country") != null && !jsonObj.get("country").isJsonNull()) && !jsonObj.get("country").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `country` to be a primitive type in the JSON string but got `%s`", jsonObj.get("country").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DirectorySearchResponseValueInnerAddressesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DirectorySearchResponseValueInnerAddressesInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DirectorySearchResponseValueInnerAddressesInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DirectorySearchResponseValueInnerAddressesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DirectorySearchResponseValueInnerAddressesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DirectorySearchResponseValueInnerAddressesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of DirectorySearchResponseValueInnerAddressesInner + * @throws IOException if the JSON string is invalid with respect to DirectorySearchResponseValueInnerAddressesInner + */ + public static DirectorySearchResponseValueInnerAddressesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DirectorySearchResponseValueInnerAddressesInner.class); + } + + /** + * Convert an instance of DirectorySearchResponseValueInnerAddressesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/Avalara/SDK/model/EInvoicing/V1/DirectorySearchResponseValueInnerIdentifiersInner.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/DirectorySearchResponseValueInnerIdentifiersInner.java new file mode 100644 index 0000000..cac4b3f --- /dev/null +++ b/src/main/java/Avalara/SDK/model/EInvoicing/V1/DirectorySearchResponseValueInnerIdentifiersInner.java @@ -0,0 +1,242 @@ +/* + * AvaTax Software Development Kit for Java (JRE) + * + * (c) 2004-2022 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * Avalara E-Invoicing API + * + * An API that supports sending data for an E-Invoicing compliance use-case. + * + * @author Sachin Baijal + * @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-JRE-SDK + */ + +package Avalara.SDK.model.EInvoicing.V1; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import Avalara.SDK.JSON; + +/** + * DirectorySearchResponseValueInnerIdentifiersInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") +public class DirectorySearchResponseValueInnerIdentifiersInner { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public DirectorySearchResponseValueInnerIdentifiersInner() { + } + + public DirectorySearchResponseValueInnerIdentifiersInner name(String name) { + this.name = name; + return this; + } + + /** + * Peppol Participant ID if the participant is in Peppol network + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public DirectorySearchResponseValueInnerIdentifiersInner value(String value) { + this.value = value; + return this; + } + + /** + * Value of the identifier + * @return value + */ + @javax.annotation.Nullable + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DirectorySearchResponseValueInnerIdentifiersInner directorySearchResponseValueInnerIdentifiersInner = (DirectorySearchResponseValueInnerIdentifiersInner) o; + return Objects.equals(this.name, directorySearchResponseValueInnerIdentifiersInner.name) && + Objects.equals(this.value, directorySearchResponseValueInnerIdentifiersInner.value); + } + + @Override + public int hashCode() { + return Objects.hash(name, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DirectorySearchResponseValueInnerIdentifiersInner {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DirectorySearchResponseValueInnerIdentifiersInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DirectorySearchResponseValueInnerIdentifiersInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DirectorySearchResponseValueInnerIdentifiersInner is not found in the empty JSON string", DirectorySearchResponseValueInnerIdentifiersInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!DirectorySearchResponseValueInnerIdentifiersInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DirectorySearchResponseValueInnerIdentifiersInner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) && !jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DirectorySearchResponseValueInnerIdentifiersInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DirectorySearchResponseValueInnerIdentifiersInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DirectorySearchResponseValueInnerIdentifiersInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DirectorySearchResponseValueInnerIdentifiersInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DirectorySearchResponseValueInnerIdentifiersInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DirectorySearchResponseValueInnerIdentifiersInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of DirectorySearchResponseValueInnerIdentifiersInner + * @throws IOException if the JSON string is invalid with respect to DirectorySearchResponseValueInnerIdentifiersInner + */ + public static DirectorySearchResponseValueInnerIdentifiersInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DirectorySearchResponseValueInnerIdentifiersInner.class); + } + + /** + * Convert an instance of DirectorySearchResponseValueInnerIdentifiersInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/Avalara/SDK/model/EInvoicing/V1/DirectorySearchResponseValueInnerSupportedDocumentTypesInner.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/DirectorySearchResponseValueInnerSupportedDocumentTypesInner.java new file mode 100644 index 0000000..7222c23 --- /dev/null +++ b/src/main/java/Avalara/SDK/model/EInvoicing/V1/DirectorySearchResponseValueInnerSupportedDocumentTypesInner.java @@ -0,0 +1,294 @@ +/* + * AvaTax Software Development Kit for Java (JRE) + * + * (c) 2004-2022 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * Avalara E-Invoicing API + * + * An API that supports sending data for an E-Invoicing compliance use-case. + * + * @author Sachin Baijal + * @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-JRE-SDK + */ + +package Avalara.SDK.model.EInvoicing.V1; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import Avalara.SDK.JSON; + +/** + * DirectorySearchResponseValueInnerSupportedDocumentTypesInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") +public class DirectorySearchResponseValueInnerSupportedDocumentTypesInner { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public static final String SERIALIZED_NAME_SUPPORTED_BY_TRADING_PARTNER = "supportedByTradingPartner"; + @SerializedName(SERIALIZED_NAME_SUPPORTED_BY_TRADING_PARTNER) + private Boolean supportedByTradingPartner; + + public static final String SERIALIZED_NAME_SUPPORTED_BY_AVALARA = "supportedByAvalara"; + @SerializedName(SERIALIZED_NAME_SUPPORTED_BY_AVALARA) + private Boolean supportedByAvalara; + + public DirectorySearchResponseValueInnerSupportedDocumentTypesInner() { + } + + public DirectorySearchResponseValueInnerSupportedDocumentTypesInner name(String name) { + this.name = name; + return this; + } + + /** + * Document type name. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public DirectorySearchResponseValueInnerSupportedDocumentTypesInner value(String value) { + this.value = value; + return this; + } + + /** + * Document type identifier. + * @return value + */ + @javax.annotation.Nullable + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + + public DirectorySearchResponseValueInnerSupportedDocumentTypesInner supportedByTradingPartner(Boolean supportedByTradingPartner) { + this.supportedByTradingPartner = supportedByTradingPartner; + return this; + } + + /** + * Does trading partner support receiving this document type + * @return supportedByTradingPartner + */ + @javax.annotation.Nullable + public Boolean getSupportedByTradingPartner() { + return supportedByTradingPartner; + } + + public void setSupportedByTradingPartner(Boolean supportedByTradingPartner) { + this.supportedByTradingPartner = supportedByTradingPartner; + } + + + public DirectorySearchResponseValueInnerSupportedDocumentTypesInner supportedByAvalara(Boolean supportedByAvalara) { + this.supportedByAvalara = supportedByAvalara; + return this; + } + + /** + * Does avalara support exchanging this document type + * @return supportedByAvalara + */ + @javax.annotation.Nullable + public Boolean getSupportedByAvalara() { + return supportedByAvalara; + } + + public void setSupportedByAvalara(Boolean supportedByAvalara) { + this.supportedByAvalara = supportedByAvalara; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DirectorySearchResponseValueInnerSupportedDocumentTypesInner directorySearchResponseValueInnerSupportedDocumentTypesInner = (DirectorySearchResponseValueInnerSupportedDocumentTypesInner) o; + return Objects.equals(this.name, directorySearchResponseValueInnerSupportedDocumentTypesInner.name) && + Objects.equals(this.value, directorySearchResponseValueInnerSupportedDocumentTypesInner.value) && + Objects.equals(this.supportedByTradingPartner, directorySearchResponseValueInnerSupportedDocumentTypesInner.supportedByTradingPartner) && + Objects.equals(this.supportedByAvalara, directorySearchResponseValueInnerSupportedDocumentTypesInner.supportedByAvalara); + } + + @Override + public int hashCode() { + return Objects.hash(name, value, supportedByTradingPartner, supportedByAvalara); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DirectorySearchResponseValueInnerSupportedDocumentTypesInner {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" supportedByTradingPartner: ").append(toIndentedString(supportedByTradingPartner)).append("\n"); + sb.append(" supportedByAvalara: ").append(toIndentedString(supportedByAvalara)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("value"); + openapiFields.add("supportedByTradingPartner"); + openapiFields.add("supportedByAvalara"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DirectorySearchResponseValueInnerSupportedDocumentTypesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DirectorySearchResponseValueInnerSupportedDocumentTypesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DirectorySearchResponseValueInnerSupportedDocumentTypesInner is not found in the empty JSON string", DirectorySearchResponseValueInnerSupportedDocumentTypesInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!DirectorySearchResponseValueInnerSupportedDocumentTypesInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DirectorySearchResponseValueInnerSupportedDocumentTypesInner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) && !jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DirectorySearchResponseValueInnerSupportedDocumentTypesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DirectorySearchResponseValueInnerSupportedDocumentTypesInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DirectorySearchResponseValueInnerSupportedDocumentTypesInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DirectorySearchResponseValueInnerSupportedDocumentTypesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DirectorySearchResponseValueInnerSupportedDocumentTypesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DirectorySearchResponseValueInnerSupportedDocumentTypesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of DirectorySearchResponseValueInnerSupportedDocumentTypesInner + * @throws IOException if the JSON string is invalid with respect to DirectorySearchResponseValueInnerSupportedDocumentTypesInner + */ + public static DirectorySearchResponseValueInnerSupportedDocumentTypesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DirectorySearchResponseValueInnerSupportedDocumentTypesInner.class); + } + + /** + * Convert an instance of DirectorySearchResponseValueInnerSupportedDocumentTypesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/Avalara/SDK/model/EInvoicing/V1/DocumentFetch.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/DocumentFetch.java new file mode 100644 index 0000000..8411bed --- /dev/null +++ b/src/main/java/Avalara/SDK/model/EInvoicing/V1/DocumentFetch.java @@ -0,0 +1,271 @@ +/* + * AvaTax Software Development Kit for Java (JRE) + * + * (c) 2004-2022 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * Avalara E-Invoicing API + * + * An API that supports sending data for an E-Invoicing compliance use-case. + * + * @author Sachin Baijal + * @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-JRE-SDK + */ + +package Avalara.SDK.model.EInvoicing.V1; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import Avalara.SDK.JSON; + +/** + * DocumentFetch + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") +public class DocumentFetch { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_EVENT_DATE_TIME = "eventDateTime"; + @SerializedName(SERIALIZED_NAME_EVENT_DATE_TIME) + private String eventDateTime; + + public DocumentFetch() { + } + + public DocumentFetch id(String id) { + this.id = id; + return this; + } + + /** + * 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 id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + + public DocumentFetch status(String status) { + this.status = status; + return this; + } + + /** + * Status of the document + * @return status + */ + @javax.annotation.Nullable + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + + public DocumentFetch eventDateTime(String eventDateTime) { + this.eventDateTime = eventDateTime; + return this; + } + + /** + * The date and time when the inbound document was accepted by the Avalara E-Invoicing Platform + * @return eventDateTime + */ + @javax.annotation.Nullable + public String getEventDateTime() { + return eventDateTime; + } + + public void setEventDateTime(String eventDateTime) { + this.eventDateTime = eventDateTime; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DocumentFetch documentFetch = (DocumentFetch) o; + return Objects.equals(this.id, documentFetch.id) && + Objects.equals(this.status, documentFetch.status) && + Objects.equals(this.eventDateTime, documentFetch.eventDateTime); + } + + @Override + public int hashCode() { + return Objects.hash(id, status, eventDateTime); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DocumentFetch {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" eventDateTime: ").append(toIndentedString(eventDateTime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("status"); + openapiFields.add("eventDateTime"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DocumentFetch + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DocumentFetch.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DocumentFetch is not found in the empty JSON string", DocumentFetch.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!DocumentFetch.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DocumentFetch` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("eventDateTime") != null && !jsonObj.get("eventDateTime").isJsonNull()) && !jsonObj.get("eventDateTime").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `eventDateTime` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eventDateTime").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DocumentFetch.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DocumentFetch' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DocumentFetch.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DocumentFetch value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DocumentFetch read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DocumentFetch given an JSON string + * + * @param jsonString JSON string + * @return An instance of DocumentFetch + * @throws IOException if the JSON string is invalid with respect to DocumentFetch + */ + public static DocumentFetch fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DocumentFetch.class); + } + + /** + * Convert an instance of DocumentFetch to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/Avalara/SDK/model/EInvoicing/V1/DocumentListResponse.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/DocumentListResponse.java index 3a3fd1d..29755bb 100644 --- a/src/main/java/Avalara/SDK/model/EInvoicing/V1/DocumentListResponse.java +++ b/src/main/java/Avalara/SDK/model/EInvoicing/V1/DocumentListResponse.java @@ -60,11 +60,11 @@ /** * Returns the requested list of documents */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class DocumentListResponse { - public static final String SERIALIZED_NAME_AT_RECORD_SET_COUNT = "@recordSetCount"; - @SerializedName(SERIALIZED_NAME_AT_RECORD_SET_COUNT) - private String atRecordSetCount; + public static final String SERIALIZED_NAME_AT_RECORDSET_COUNT = "@recordsetCount"; + @SerializedName(SERIALIZED_NAME_AT_RECORDSET_COUNT) + private String atRecordsetCount; public static final String SERIALIZED_NAME_AT_NEXT_LINK = "@nextLink"; @SerializedName(SERIALIZED_NAME_AT_NEXT_LINK) @@ -77,22 +77,22 @@ public class DocumentListResponse { public DocumentListResponse() { } - public DocumentListResponse atRecordSetCount(String atRecordSetCount) { - this.atRecordSetCount = atRecordSetCount; + public DocumentListResponse atRecordsetCount(String atRecordsetCount) { + this.atRecordsetCount = atRecordsetCount; return this; } - /** + /** * Count of collections for the given date range - * @return atRecordSetCount - **/ + * @return atRecordsetCount + */ @javax.annotation.Nullable - public String getAtRecordSetCount() { - return atRecordSetCount; + public String getAtRecordsetCount() { + return atRecordsetCount; } - public void setAtRecordSetCount(String atRecordSetCount) { - this.atRecordSetCount = atRecordSetCount; + public void setAtRecordsetCount(String atRecordsetCount) { + this.atRecordsetCount = atRecordsetCount; } @@ -101,10 +101,10 @@ public DocumentListResponse atNextLink(String atNextLink) { return this; } - /** + /** * Get atNextLink * @return atNextLink - **/ + */ @javax.annotation.Nullable public String getAtNextLink() { return atNextLink; @@ -128,10 +128,10 @@ public DocumentListResponse addValueItem(DocumentSummary valueItem) { return this; } - /** - * Array of invoices matching query parameters + /** + * Array of documents matching query parameters * @return value - **/ + */ @javax.annotation.Nonnull public List getValue() { return value; @@ -152,7 +152,7 @@ public boolean equals(Object o) { return false; } DocumentListResponse documentListResponse = (DocumentListResponse) o; - return Objects.equals(this.atRecordSetCount, documentListResponse.atRecordSetCount) && + return Objects.equals(this.atRecordsetCount, documentListResponse.atRecordsetCount) && Objects.equals(this.atNextLink, documentListResponse.atNextLink) && Objects.equals(this.value, documentListResponse.value); } @@ -163,7 +163,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(atRecordSetCount, atNextLink, value); + return Objects.hash(atRecordsetCount, atNextLink, value); } private static int hashCodeNullable(JsonNullable a) { @@ -177,7 +177,7 @@ private static int hashCodeNullable(JsonNullable a) { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class DocumentListResponse {\n"); - sb.append(" atRecordSetCount: ").append(toIndentedString(atRecordSetCount)).append("\n"); + sb.append(" atRecordsetCount: ").append(toIndentedString(atRecordsetCount)).append("\n"); sb.append(" atNextLink: ").append(toIndentedString(atNextLink)).append("\n"); sb.append(" value: ").append(toIndentedString(value)).append("\n"); sb.append("}"); @@ -202,7 +202,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("@recordSetCount"); + openapiFields.add("@recordsetCount"); openapiFields.add("@nextLink"); openapiFields.add("value"); @@ -211,12 +211,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("value"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to DocumentListResponse - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DocumentListResponse + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!DocumentListResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -239,8 +239,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("@recordSetCount") != null && !jsonObj.get("@recordSetCount").isJsonNull()) && !jsonObj.get("@recordSetCount").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `@recordSetCount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("@recordSetCount").toString())); + if ((jsonObj.get("@recordsetCount") != null && !jsonObj.get("@recordsetCount").isJsonNull()) && !jsonObj.get("@recordsetCount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `@recordsetCount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("@recordsetCount").toString())); } if ((jsonObj.get("@nextLink") != null && !jsonObj.get("@nextLink").isJsonNull()) && !jsonObj.get("@nextLink").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `@nextLink` to be a primitive type in the JSON string but got `%s`", jsonObj.get("@nextLink").toString())); @@ -286,22 +286,22 @@ public DocumentListResponse read(JsonReader in) throws IOException { } } - /** - * Create an instance of DocumentListResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of DocumentListResponse - * @throws IOException if the JSON string is invalid with respect to DocumentListResponse - */ + /** + * Create an instance of DocumentListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of DocumentListResponse + * @throws IOException if the JSON string is invalid with respect to DocumentListResponse + */ public static DocumentListResponse fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, DocumentListResponse.class); } - /** - * Convert an instance of DocumentListResponse to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of DocumentListResponse to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/src/main/java/Avalara/SDK/model/EInvoicing/V1/DocumentStatusResponse.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/DocumentStatusResponse.java index de06610..4695bb6 100644 --- a/src/main/java/Avalara/SDK/model/EInvoicing/V1/DocumentStatusResponse.java +++ b/src/main/java/Avalara/SDK/model/EInvoicing/V1/DocumentStatusResponse.java @@ -59,7 +59,7 @@ /** * Returns the current document ID and status */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class DocumentStatusResponse { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -71,7 +71,7 @@ public class DocumentStatusResponse { public static final String SERIALIZED_NAME_EVENTS = "events"; @SerializedName(SERIALIZED_NAME_EVENTS) - private List events; + private List events = new ArrayList<>(); public DocumentStatusResponse() { } @@ -81,10 +81,10 @@ public DocumentStatusResponse id(String id) { return this; } - /** + /** * The unique ID for this document * @return id - **/ + */ @javax.annotation.Nullable public String getId() { return id; @@ -100,10 +100,10 @@ public DocumentStatusResponse status(String status) { return this; } - /** - * Status of the transaction: <br> 'Pending' <br> 'Failed' <br> 'Complete' + /** + * Status of the document * @return status - **/ + */ @javax.annotation.Nullable public String getStatus() { return status; @@ -127,10 +127,10 @@ public DocumentStatusResponse addEventsItem(StatusEvent eventsItem) { return this; } - /** + /** * Get events * @return events - **/ + */ @javax.annotation.Nullable public List getEvents() { return events; @@ -198,12 +198,12 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to DocumentStatusResponse - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DocumentStatusResponse + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!DocumentStatusResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -270,22 +270,22 @@ public DocumentStatusResponse read(JsonReader in) throws IOException { } } - /** - * Create an instance of DocumentStatusResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of DocumentStatusResponse - * @throws IOException if the JSON string is invalid with respect to DocumentStatusResponse - */ + /** + * Create an instance of DocumentStatusResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of DocumentStatusResponse + * @throws IOException if the JSON string is invalid with respect to DocumentStatusResponse + */ public static DocumentStatusResponse fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, DocumentStatusResponse.class); } - /** - * Convert an instance of DocumentStatusResponse to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of DocumentStatusResponse to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/src/main/java/Avalara/SDK/model/EInvoicing/V1/DocumentSubmissionError.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/DocumentSubmissionError.java index 6bd1ccb..f492b95 100644 --- a/src/main/java/Avalara/SDK/model/EInvoicing/V1/DocumentSubmissionError.java +++ b/src/main/java/Avalara/SDK/model/EInvoicing/V1/DocumentSubmissionError.java @@ -56,7 +56,7 @@ /** * Returns an HTTP status code and message for an 'exception' */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class DocumentSubmissionError { public static final String SERIALIZED_NAME_STATUS_CODE = "StatusCode"; @SerializedName(SERIALIZED_NAME_STATUS_CODE) @@ -74,10 +74,10 @@ public DocumentSubmissionError statusCode(String statusCode) { return this; } - /** + /** * The three-digit HTTP status code for the exception * @return statusCode - **/ + */ @javax.annotation.Nullable public String getStatusCode() { return statusCode; @@ -93,10 +93,10 @@ public DocumentSubmissionError message(String message) { return this; } - /** + /** * A message explaining the exception * @return message - **/ + */ @javax.annotation.Nullable public String getMessage() { return message; @@ -161,12 +161,12 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to DocumentSubmissionError - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DocumentSubmissionError + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!DocumentSubmissionError.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -219,22 +219,22 @@ public DocumentSubmissionError read(JsonReader in) throws IOException { } } - /** - * Create an instance of DocumentSubmissionError given an JSON string - * - * @param jsonString JSON string - * @return An instance of DocumentSubmissionError - * @throws IOException if the JSON string is invalid with respect to DocumentSubmissionError - */ + /** + * Create an instance of DocumentSubmissionError given an JSON string + * + * @param jsonString JSON string + * @return An instance of DocumentSubmissionError + * @throws IOException if the JSON string is invalid with respect to DocumentSubmissionError + */ public static DocumentSubmissionError fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, DocumentSubmissionError.class); } - /** - * Convert an instance of DocumentSubmissionError to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of DocumentSubmissionError to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/src/main/java/Avalara/SDK/model/EInvoicing/V1/DocumentSubmitResponse.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/DocumentSubmitResponse.java index 2c5b3f3..ce199e6 100644 --- a/src/main/java/Avalara/SDK/model/EInvoicing/V1/DocumentSubmitResponse.java +++ b/src/main/java/Avalara/SDK/model/EInvoicing/V1/DocumentSubmitResponse.java @@ -56,7 +56,7 @@ /** * Returns the unique ID of a successful document submission */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class DocumentSubmitResponse { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -70,10 +70,10 @@ public DocumentSubmitResponse id(String id) { return this; } - /** + /** * 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 id - **/ + */ @javax.annotation.Nullable public String getId() { return id; @@ -135,12 +135,12 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to DocumentSubmitResponse - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DocumentSubmitResponse + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!DocumentSubmitResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -190,22 +190,22 @@ public DocumentSubmitResponse read(JsonReader in) throws IOException { } } - /** - * Create an instance of DocumentSubmitResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of DocumentSubmitResponse - * @throws IOException if the JSON string is invalid with respect to DocumentSubmitResponse - */ + /** + * Create an instance of DocumentSubmitResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of DocumentSubmitResponse + * @throws IOException if the JSON string is invalid with respect to DocumentSubmitResponse + */ public static DocumentSubmitResponse fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, DocumentSubmitResponse.class); } - /** - * Convert an instance of DocumentSubmitResponse to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of DocumentSubmitResponse to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/src/main/java/Avalara/SDK/model/EInvoicing/V1/DocumentSummary.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/DocumentSummary.java index 8cdcff2..2e71b43 100644 --- a/src/main/java/Avalara/SDK/model/EInvoicing/V1/DocumentSummary.java +++ b/src/main/java/Avalara/SDK/model/EInvoicing/V1/DocumentSummary.java @@ -56,7 +56,7 @@ /** * Displays a summary of information about the document */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class DocumentSummary { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -78,6 +78,14 @@ public class DocumentSummary { @SerializedName(SERIALIZED_NAME_CUSTOMER_NAME) private String customerName; + public static final String SERIALIZED_NAME_DOCUMENT_TYPE = "documentType"; + @SerializedName(SERIALIZED_NAME_DOCUMENT_TYPE) + private String documentType; + + public static final String SERIALIZED_NAME_DOCUMENT_VERSION = "documentVersion"; + @SerializedName(SERIALIZED_NAME_DOCUMENT_VERSION) + private String documentVersion; + public static final String SERIALIZED_NAME_DOCUMENT_NUMBER = "documentNumber"; @SerializedName(SERIALIZED_NAME_DOCUMENT_NUMBER) private String documentNumber; @@ -114,10 +122,10 @@ public DocumentSummary id(String id) { return this; } - /** + /** * The unique ID for this document * @return id - **/ + */ @javax.annotation.Nullable public String getId() { return id; @@ -133,10 +141,10 @@ public DocumentSummary processDateTime(String processDateTime) { return this; } - /** + /** * The date and time when the document was processed, displayed in the format YYYY-MM-DDThh:mm:ss * @return processDateTime - **/ + */ @javax.annotation.Nullable public String getProcessDateTime() { return processDateTime; @@ -152,10 +160,10 @@ public DocumentSummary status(String status) { return this; } - /** - * The transaction status: <br> 'Pending' <br> 'Failed' <br> 'Complete' + /** + * The Document status * @return status - **/ + */ @javax.annotation.Nullable public String getStatus() { return status; @@ -171,10 +179,10 @@ public DocumentSummary supplierName(String supplierName) { return this; } - /** + /** * The name of the supplier in the transaction * @return supplierName - **/ + */ @javax.annotation.Nullable public String getSupplierName() { return supplierName; @@ -190,10 +198,10 @@ public DocumentSummary customerName(String customerName) { return this; } - /** + /** * The name of the customer in the transaction * @return customerName - **/ + */ @javax.annotation.Nullable public String getCustomerName() { return customerName; @@ -204,15 +212,53 @@ public void setCustomerName(String customerName) { } + public DocumentSummary documentType(String documentType) { + this.documentType = documentType; + return this; + } + + /** + * The document type + * @return documentType + */ + @javax.annotation.Nullable + public String getDocumentType() { + return documentType; + } + + public void setDocumentType(String documentType) { + this.documentType = documentType; + } + + + public DocumentSummary documentVersion(String documentVersion) { + this.documentVersion = documentVersion; + return this; + } + + /** + * The document version + * @return documentVersion + */ + @javax.annotation.Nullable + public String getDocumentVersion() { + return documentVersion; + } + + public void setDocumentVersion(String documentVersion) { + this.documentVersion = documentVersion; + } + + public DocumentSummary documentNumber(String documentNumber) { this.documentNumber = documentNumber; return this; } - /** - * The invoice document number + /** + * The document number * @return documentNumber - **/ + */ @javax.annotation.Nullable public String getDocumentNumber() { return documentNumber; @@ -228,10 +274,10 @@ public DocumentSummary documentDate(String documentDate) { return this; } - /** - * The invoice issue date + /** + * The document issue date * @return documentDate - **/ + */ @javax.annotation.Nullable public String getDocumentDate() { return documentDate; @@ -247,10 +293,10 @@ public DocumentSummary flow(String flow) { return this; } - /** - * The invoice direction, where issued = `out` and received = `in` + /** + * The document direction, where issued = `out` and received = `in` * @return flow - **/ + */ @javax.annotation.Nullable public String getFlow() { return flow; @@ -266,10 +312,10 @@ public DocumentSummary countryCode(String countryCode) { return this; } - /** - * The two-letter ISO-3166 country code for the country where the e-invoice is being submitted + /** + * The two-letter ISO-3166 country code for the country where the document is being submitted * @return countryCode - **/ + */ @javax.annotation.Nullable public String getCountryCode() { return countryCode; @@ -285,10 +331,10 @@ public DocumentSummary countryMandate(String countryMandate) { return this; } - /** + /** * The e-invoicing mandate for the specified country * @return countryMandate - **/ + */ @javax.annotation.Nullable public String getCountryMandate() { return countryMandate; @@ -304,10 +350,10 @@ public DocumentSummary _interface(String _interface) { return this; } - /** - * The interface where the invoice data is sent + /** + * The interface where the document is sent * @return _interface - **/ + */ @javax.annotation.Nullable public String getInterface() { return _interface; @@ -323,10 +369,10 @@ public DocumentSummary receiver(String receiver) { return this; } - /** - * The invoice recipient based on the interface + /** + * The document recipient based on the interface * @return receiver - **/ + */ @javax.annotation.Nullable public String getReceiver() { return receiver; @@ -352,6 +398,8 @@ public boolean equals(Object o) { Objects.equals(this.status, documentSummary.status) && Objects.equals(this.supplierName, documentSummary.supplierName) && Objects.equals(this.customerName, documentSummary.customerName) && + Objects.equals(this.documentType, documentSummary.documentType) && + Objects.equals(this.documentVersion, documentSummary.documentVersion) && Objects.equals(this.documentNumber, documentSummary.documentNumber) && Objects.equals(this.documentDate, documentSummary.documentDate) && Objects.equals(this.flow, documentSummary.flow) && @@ -363,7 +411,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(id, processDateTime, status, supplierName, customerName, documentNumber, documentDate, flow, countryCode, countryMandate, _interface, receiver); + return Objects.hash(id, processDateTime, status, supplierName, customerName, documentType, documentVersion, documentNumber, documentDate, flow, countryCode, countryMandate, _interface, receiver); } @Override @@ -375,6 +423,8 @@ public String toString() { sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" supplierName: ").append(toIndentedString(supplierName)).append("\n"); sb.append(" customerName: ").append(toIndentedString(customerName)).append("\n"); + sb.append(" documentType: ").append(toIndentedString(documentType)).append("\n"); + sb.append(" documentVersion: ").append(toIndentedString(documentVersion)).append("\n"); sb.append(" documentNumber: ").append(toIndentedString(documentNumber)).append("\n"); sb.append(" documentDate: ").append(toIndentedString(documentDate)).append("\n"); sb.append(" flow: ").append(toIndentedString(flow)).append("\n"); @@ -409,6 +459,8 @@ private String toIndentedString(Object o) { openapiFields.add("status"); openapiFields.add("supplierName"); openapiFields.add("customerName"); + openapiFields.add("documentType"); + openapiFields.add("documentVersion"); openapiFields.add("documentNumber"); openapiFields.add("documentDate"); openapiFields.add("flow"); @@ -421,12 +473,12 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to DocumentSummary - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to DocumentSummary + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!DocumentSummary.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -457,6 +509,12 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("customerName") != null && !jsonObj.get("customerName").isJsonNull()) && !jsonObj.get("customerName").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `customerName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customerName").toString())); } + if ((jsonObj.get("documentType") != null && !jsonObj.get("documentType").isJsonNull()) && !jsonObj.get("documentType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `documentType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("documentType").toString())); + } + if ((jsonObj.get("documentVersion") != null && !jsonObj.get("documentVersion").isJsonNull()) && !jsonObj.get("documentVersion").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `documentVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("documentVersion").toString())); + } if ((jsonObj.get("documentNumber") != null && !jsonObj.get("documentNumber").isJsonNull()) && !jsonObj.get("documentNumber").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `documentNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("documentNumber").toString())); } @@ -509,22 +567,22 @@ public DocumentSummary read(JsonReader in) throws IOException { } } - /** - * Create an instance of DocumentSummary given an JSON string - * - * @param jsonString JSON string - * @return An instance of DocumentSummary - * @throws IOException if the JSON string is invalid with respect to DocumentSummary - */ + /** + * Create an instance of DocumentSummary given an JSON string + * + * @param jsonString JSON string + * @return An instance of DocumentSummary + * @throws IOException if the JSON string is invalid with respect to DocumentSummary + */ public static DocumentSummary fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, DocumentSummary.class); } - /** - * Convert an instance of DocumentSummary to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of DocumentSummary to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/src/main/java/Avalara/SDK/model/EInvoicing/V1/ErrorResponse.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/ErrorResponse.java new file mode 100644 index 0000000..19b8b4d --- /dev/null +++ b/src/main/java/Avalara/SDK/model/EInvoicing/V1/ErrorResponse.java @@ -0,0 +1,300 @@ +/* + * AvaTax Software Development Kit for Java (JRE) + * + * (c) 2004-2022 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * Avalara E-Invoicing API + * + * An API that supports sending data for an E-Invoicing compliance use-case. + * + * @author Sachin Baijal + * @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-JRE-SDK + */ + +package Avalara.SDK.model.EInvoicing.V1; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import Avalara.SDK.JSON; + +/** + * ErrorResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") +public class ErrorResponse { + public static final String SERIALIZED_NAME_TITLE = "title"; + @SerializedName(SERIALIZED_NAME_TITLE) + private String title; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_DETAIL = "detail"; + @SerializedName(SERIALIZED_NAME_DETAIL) + private String detail; + + public static final String SERIALIZED_NAME_INSTANCE = "instance"; + @SerializedName(SERIALIZED_NAME_INSTANCE) + private String instance; + + public ErrorResponse() { + } + + public ErrorResponse title(String title) { + this.title = title; + return this; + } + + /** + * Get title + * @return title + */ + @javax.annotation.Nullable + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + + public ErrorResponse status(String status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @javax.annotation.Nullable + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + + public ErrorResponse detail(String detail) { + this.detail = detail; + return this; + } + + /** + * Get detail + * @return detail + */ + @javax.annotation.Nullable + public String getDetail() { + return detail; + } + + public void setDetail(String detail) { + this.detail = detail; + } + + + public ErrorResponse instance(String instance) { + this.instance = instance; + return this; + } + + /** + * Get instance + * @return instance + */ + @javax.annotation.Nullable + public String getInstance() { + return instance; + } + + public void setInstance(String instance) { + this.instance = instance; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ErrorResponse errorResponse = (ErrorResponse) o; + return Objects.equals(this.title, errorResponse.title) && + Objects.equals(this.status, errorResponse.status) && + Objects.equals(this.detail, errorResponse.detail) && + Objects.equals(this.instance, errorResponse.instance); + } + + @Override + public int hashCode() { + return Objects.hash(title, status, detail, instance); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ErrorResponse {\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" detail: ").append(toIndentedString(detail)).append("\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("title"); + openapiFields.add("status"); + openapiFields.add("detail"); + openapiFields.add("instance"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ErrorResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ErrorResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ErrorResponse is not found in the empty JSON string", ErrorResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ErrorResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ErrorResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("title") != null && !jsonObj.get("title").isJsonNull()) && !jsonObj.get("title").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `title` to be a primitive type in the JSON string but got `%s`", jsonObj.get("title").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + if ((jsonObj.get("detail") != null && !jsonObj.get("detail").isJsonNull()) && !jsonObj.get("detail").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `detail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("detail").toString())); + } + if ((jsonObj.get("instance") != null && !jsonObj.get("instance").isJsonNull()) && !jsonObj.get("instance").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `instance` to be a primitive type in the JSON string but got `%s`", jsonObj.get("instance").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ErrorResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ErrorResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ErrorResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ErrorResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ErrorResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ErrorResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ErrorResponse + * @throws IOException if the JSON string is invalid with respect to ErrorResponse + */ + public static ErrorResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ErrorResponse.class); + } + + /** + * Convert an instance of ErrorResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/Avalara/SDK/model/EInvoicing/V1/FetchDocumentsRequest.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/FetchDocumentsRequest.java new file mode 100644 index 0000000..fc24926 --- /dev/null +++ b/src/main/java/Avalara/SDK/model/EInvoicing/V1/FetchDocumentsRequest.java @@ -0,0 +1,266 @@ +/* + * AvaTax Software Development Kit for Java (JRE) + * + * (c) 2004-2022 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * Avalara E-Invoicing API + * + * An API that supports sending data for an E-Invoicing compliance use-case. + * + * @author Sachin Baijal + * @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-JRE-SDK + */ + +package Avalara.SDK.model.EInvoicing.V1; + +import java.util.Objects; +import Avalara.SDK.model.EInvoicing.V1.FetchDocumentsRequestDataInner; +import Avalara.SDK.model.EInvoicing.V1.FetchDocumentsRequestMetadata; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import Avalara.SDK.JSON; + +/** + * FetchDocumentsRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") +public class FetchDocumentsRequest { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private List data = new ArrayList<>(); + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private FetchDocumentsRequestMetadata metadata; + + public FetchDocumentsRequest() { + } + + public FetchDocumentsRequest data(List data) { + this.data = data; + return this; + } + + public FetchDocumentsRequest addDataItem(FetchDocumentsRequestDataInner dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Array of key-value pairs used to retrieve inbound documents from the Tax Authority + * @return data + */ + @javax.annotation.Nullable + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + + public FetchDocumentsRequest metadata(FetchDocumentsRequestMetadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + */ + @javax.annotation.Nullable + public FetchDocumentsRequestMetadata getMetadata() { + return metadata; + } + + public void setMetadata(FetchDocumentsRequestMetadata metadata) { + this.metadata = metadata; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FetchDocumentsRequest fetchDocumentsRequest = (FetchDocumentsRequest) o; + return Objects.equals(this.data, fetchDocumentsRequest.data) && + Objects.equals(this.metadata, fetchDocumentsRequest.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(data, metadata); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FetchDocumentsRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + openapiFields.add("metadata"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to FetchDocumentsRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FetchDocumentsRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in FetchDocumentsRequest is not found in the empty JSON string", FetchDocumentsRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!FetchDocumentsRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FetchDocumentsRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + + // validate the optional field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + FetchDocumentsRequestDataInner.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + // validate the optional field `metadata` + if (jsonObj.get("metadata") != null && !jsonObj.get("metadata").isJsonNull()) { + FetchDocumentsRequestMetadata.validateJsonElement(jsonObj.get("metadata")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FetchDocumentsRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FetchDocumentsRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FetchDocumentsRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FetchDocumentsRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FetchDocumentsRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FetchDocumentsRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of FetchDocumentsRequest + * @throws IOException if the JSON string is invalid with respect to FetchDocumentsRequest + */ + public static FetchDocumentsRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FetchDocumentsRequest.class); + } + + /** + * Convert an instance of FetchDocumentsRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/Avalara/SDK/model/EInvoicing/V1/FetchDocumentsRequestDataInner.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/FetchDocumentsRequestDataInner.java new file mode 100644 index 0000000..05e7fe5 --- /dev/null +++ b/src/main/java/Avalara/SDK/model/EInvoicing/V1/FetchDocumentsRequestDataInner.java @@ -0,0 +1,251 @@ +/* + * AvaTax Software Development Kit for Java (JRE) + * + * (c) 2004-2022 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * Avalara E-Invoicing API + * + * An API that supports sending data for an E-Invoicing compliance use-case. + * + * @author Sachin Baijal + * @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-JRE-SDK + */ + +package Avalara.SDK.model.EInvoicing.V1; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import Avalara.SDK.JSON; + +/** + * FetchDocumentsRequestDataInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") +public class FetchDocumentsRequestDataInner { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public FetchDocumentsRequestDataInner() { + } + + public FetchDocumentsRequestDataInner key(String key) { + this.key = key; + return this; + } + + /** + * Descriptor of the identifier + * @return key + */ + @javax.annotation.Nonnull + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + + public FetchDocumentsRequestDataInner value(String value) { + this.value = value; + return this; + } + + /** + * Value of the identifier + * @return value + */ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FetchDocumentsRequestDataInner fetchDocumentsRequestDataInner = (FetchDocumentsRequestDataInner) o; + return Objects.equals(this.key, fetchDocumentsRequestDataInner.key) && + Objects.equals(this.value, fetchDocumentsRequestDataInner.value); + } + + @Override + public int hashCode() { + return Objects.hash(key, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FetchDocumentsRequestDataInner {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("key"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("key"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to FetchDocumentsRequestDataInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FetchDocumentsRequestDataInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in FetchDocumentsRequestDataInner is not found in the empty JSON string", FetchDocumentsRequestDataInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!FetchDocumentsRequestDataInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FetchDocumentsRequestDataInner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FetchDocumentsRequestDataInner.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FetchDocumentsRequestDataInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FetchDocumentsRequestDataInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FetchDocumentsRequestDataInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FetchDocumentsRequestDataInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FetchDocumentsRequestDataInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FetchDocumentsRequestDataInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of FetchDocumentsRequestDataInner + * @throws IOException if the JSON string is invalid with respect to FetchDocumentsRequestDataInner + */ + public static FetchDocumentsRequestDataInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FetchDocumentsRequestDataInner.class); + } + + /** + * Convert an instance of FetchDocumentsRequestDataInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/Avalara/SDK/model/EInvoicing/V1/FetchDocumentsRequestMetadata.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/FetchDocumentsRequestMetadata.java new file mode 100644 index 0000000..b3fb60d --- /dev/null +++ b/src/main/java/Avalara/SDK/model/EInvoicing/V1/FetchDocumentsRequestMetadata.java @@ -0,0 +1,339 @@ +/* + * AvaTax Software Development Kit for Java (JRE) + * + * (c) 2004-2022 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * Avalara E-Invoicing API + * + * An API that supports sending data for an E-Invoicing compliance use-case. + * + * @author Sachin Baijal + * @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-JRE-SDK + */ + +package Avalara.SDK.model.EInvoicing.V1; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import Avalara.SDK.JSON; + +/** + * FetchDocumentsRequestMetadata + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") +public class FetchDocumentsRequestMetadata { + public static final String SERIALIZED_NAME_WORKFLOW_ID = "workflowId"; + @SerializedName(SERIALIZED_NAME_WORKFLOW_ID) + private String workflowId; + + public static final String SERIALIZED_NAME_DATA_FORMAT = "dataFormat"; + @SerializedName(SERIALIZED_NAME_DATA_FORMAT) + private String dataFormat; + + public static final String SERIALIZED_NAME_DATA_FORMAT_VERSION = "dataFormatVersion"; + @SerializedName(SERIALIZED_NAME_DATA_FORMAT_VERSION) + private BigDecimal dataFormatVersion; + + public static final String SERIALIZED_NAME_COUNTRY_CODE = "countryCode"; + @SerializedName(SERIALIZED_NAME_COUNTRY_CODE) + private String countryCode; + + public static final String SERIALIZED_NAME_COUNTRY_MANDATE = "countryMandate"; + @SerializedName(SERIALIZED_NAME_COUNTRY_MANDATE) + private String countryMandate; + + public FetchDocumentsRequestMetadata() { + } + + public FetchDocumentsRequestMetadata workflowId(String workflowId) { + this.workflowId = workflowId; + return this; + } + + /** + * Specifies a unique ID for this workflow. + * @return workflowId + */ + @javax.annotation.Nonnull + public String getWorkflowId() { + return workflowId; + } + + public void setWorkflowId(String workflowId) { + this.workflowId = workflowId; + } + + + public FetchDocumentsRequestMetadata dataFormat(String dataFormat) { + this.dataFormat = dataFormat; + return this; + } + + /** + * Specifies the data format for this workflow + * @return dataFormat + */ + @javax.annotation.Nonnull + public String getDataFormat() { + return dataFormat; + } + + public void setDataFormat(String dataFormat) { + this.dataFormat = dataFormat; + } + + + public FetchDocumentsRequestMetadata dataFormatVersion(BigDecimal dataFormatVersion) { + this.dataFormatVersion = dataFormatVersion; + return this; + } + + /** + * Specifies the data format version number + * @return dataFormatVersion + */ + @javax.annotation.Nonnull + public BigDecimal getDataFormatVersion() { + return dataFormatVersion; + } + + public void setDataFormatVersion(BigDecimal dataFormatVersion) { + this.dataFormatVersion = dataFormatVersion; + } + + + public FetchDocumentsRequestMetadata countryCode(String countryCode) { + this.countryCode = countryCode; + return this; + } + + /** + * The two-letter ISO-3166 country code for the country for which document is being retrieved + * @return countryCode + */ + @javax.annotation.Nonnull + public String getCountryCode() { + return countryCode; + } + + public void setCountryCode(String countryCode) { + this.countryCode = countryCode; + } + + + public FetchDocumentsRequestMetadata countryMandate(String countryMandate) { + this.countryMandate = countryMandate; + return this; + } + + /** + * The e-invoicing mandate for the specified country + * @return countryMandate + */ + @javax.annotation.Nonnull + public String getCountryMandate() { + return countryMandate; + } + + public void setCountryMandate(String countryMandate) { + this.countryMandate = countryMandate; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FetchDocumentsRequestMetadata fetchDocumentsRequestMetadata = (FetchDocumentsRequestMetadata) o; + return Objects.equals(this.workflowId, fetchDocumentsRequestMetadata.workflowId) && + Objects.equals(this.dataFormat, fetchDocumentsRequestMetadata.dataFormat) && + Objects.equals(this.dataFormatVersion, fetchDocumentsRequestMetadata.dataFormatVersion) && + Objects.equals(this.countryCode, fetchDocumentsRequestMetadata.countryCode) && + Objects.equals(this.countryMandate, fetchDocumentsRequestMetadata.countryMandate); + } + + @Override + public int hashCode() { + return Objects.hash(workflowId, dataFormat, dataFormatVersion, countryCode, countryMandate); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FetchDocumentsRequestMetadata {\n"); + sb.append(" workflowId: ").append(toIndentedString(workflowId)).append("\n"); + sb.append(" dataFormat: ").append(toIndentedString(dataFormat)).append("\n"); + sb.append(" dataFormatVersion: ").append(toIndentedString(dataFormatVersion)).append("\n"); + sb.append(" countryCode: ").append(toIndentedString(countryCode)).append("\n"); + sb.append(" countryMandate: ").append(toIndentedString(countryMandate)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("workflowId"); + openapiFields.add("dataFormat"); + openapiFields.add("dataFormatVersion"); + openapiFields.add("countryCode"); + openapiFields.add("countryMandate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("workflowId"); + openapiRequiredFields.add("dataFormat"); + openapiRequiredFields.add("dataFormatVersion"); + openapiRequiredFields.add("countryCode"); + openapiRequiredFields.add("countryMandate"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to FetchDocumentsRequestMetadata + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FetchDocumentsRequestMetadata.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in FetchDocumentsRequestMetadata is not found in the empty JSON string", FetchDocumentsRequestMetadata.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!FetchDocumentsRequestMetadata.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FetchDocumentsRequestMetadata` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FetchDocumentsRequestMetadata.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("workflowId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `workflowId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("workflowId").toString())); + } + if (!jsonObj.get("dataFormat").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `dataFormat` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dataFormat").toString())); + } + if (!jsonObj.get("countryCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `countryCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("countryCode").toString())); + } + if (!jsonObj.get("countryMandate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `countryMandate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("countryMandate").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FetchDocumentsRequestMetadata.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FetchDocumentsRequestMetadata' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FetchDocumentsRequestMetadata.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FetchDocumentsRequestMetadata value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FetchDocumentsRequestMetadata read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FetchDocumentsRequestMetadata given an JSON string + * + * @param jsonString JSON string + * @return An instance of FetchDocumentsRequestMetadata + * @throws IOException if the JSON string is invalid with respect to FetchDocumentsRequestMetadata + */ + public static FetchDocumentsRequestMetadata fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FetchDocumentsRequestMetadata.class); + } + + /** + * Convert an instance of FetchDocumentsRequestMetadata to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/Avalara/SDK/model/EInvoicing/V1/ForbiddenError.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/ForbiddenError.java index b05617a..79962fc 100644 --- a/src/main/java/Avalara/SDK/model/EInvoicing/V1/ForbiddenError.java +++ b/src/main/java/Avalara/SDK/model/EInvoicing/V1/ForbiddenError.java @@ -56,7 +56,7 @@ /** * Returns an optional message with a 'forbidden' response */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class ForbiddenError { public static final String SERIALIZED_NAME_MESSAGE = "Message"; @SerializedName(SERIALIZED_NAME_MESSAGE) @@ -70,10 +70,10 @@ public ForbiddenError message(String message) { return this; } - /** + /** * A message that informs the user that they may not access a resource * @return message - **/ + */ @javax.annotation.Nullable public String getMessage() { return message; @@ -135,12 +135,12 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to ForbiddenError - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ForbiddenError + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!ForbiddenError.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -190,22 +190,22 @@ public ForbiddenError read(JsonReader in) throws IOException { } } - /** - * Create an instance of ForbiddenError given an JSON string - * - * @param jsonString JSON string - * @return An instance of ForbiddenError - * @throws IOException if the JSON string is invalid with respect to ForbiddenError - */ + /** + * Create an instance of ForbiddenError given an JSON string + * + * @param jsonString JSON string + * @return An instance of ForbiddenError + * @throws IOException if the JSON string is invalid with respect to ForbiddenError + */ public static ForbiddenError fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, ForbiddenError.class); } - /** - * Convert an instance of ForbiddenError to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of ForbiddenError to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/src/main/java/Avalara/SDK/model/EInvoicing/V1/InputDataFormats.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/InputDataFormats.java index 6f081c2..3653b0c 100644 --- a/src/main/java/Avalara/SDK/model/EInvoicing/V1/InputDataFormats.java +++ b/src/main/java/Avalara/SDK/model/EInvoicing/V1/InputDataFormats.java @@ -58,7 +58,7 @@ /** * Format and version used when inputting the data */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class InputDataFormats { public static final String SERIALIZED_NAME_FORMAT = "format"; @SerializedName(SERIALIZED_NAME_FORMAT) @@ -66,7 +66,7 @@ public class InputDataFormats { public static final String SERIALIZED_NAME_VERSIONS = "versions"; @SerializedName(SERIALIZED_NAME_VERSIONS) - private List versions; + private List versions = new ArrayList<>(); public InputDataFormats() { } @@ -76,10 +76,10 @@ public InputDataFormats format(String format) { return this; } - /** - * Invoice format + /** + * Document format * @return format - **/ + */ @javax.annotation.Nullable public String getFormat() { return format; @@ -103,10 +103,10 @@ public InputDataFormats addVersionsItem(String versionsItem) { return this; } - /** + /** * Get versions * @return versions - **/ + */ @javax.annotation.Nullable public List getVersions() { return versions; @@ -171,12 +171,12 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to InputDataFormats - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to InputDataFormats + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!InputDataFormats.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -230,22 +230,22 @@ public InputDataFormats read(JsonReader in) throws IOException { } } - /** - * Create an instance of InputDataFormats given an JSON string - * - * @param jsonString JSON string - * @return An instance of InputDataFormats - * @throws IOException if the JSON string is invalid with respect to InputDataFormats - */ + /** + * Create an instance of InputDataFormats given an JSON string + * + * @param jsonString JSON string + * @return An instance of InputDataFormats + * @throws IOException if the JSON string is invalid with respect to InputDataFormats + */ public static InputDataFormats fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, InputDataFormats.class); } - /** - * Convert an instance of InputDataFormats to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of InputDataFormats to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/src/main/java/Avalara/SDK/model/EInvoicing/V1/InternalServerError.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/InternalServerError.java index fd1ff78..3e10868 100644 --- a/src/main/java/Avalara/SDK/model/EInvoicing/V1/InternalServerError.java +++ b/src/main/java/Avalara/SDK/model/EInvoicing/V1/InternalServerError.java @@ -56,7 +56,7 @@ /** * Returns an optional message with a 'InternalServerError' response */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class InternalServerError { public static final String SERIALIZED_NAME_ERROR = "error"; @SerializedName(SERIALIZED_NAME_ERROR) @@ -74,10 +74,10 @@ public InternalServerError error(String error) { return this; } - /** + /** * A bad request error code * @return error - **/ + */ @javax.annotation.Nullable public String getError() { return error; @@ -93,10 +93,10 @@ public InternalServerError message(String message) { return this; } - /** + /** * A message explaining the bad request error * @return message - **/ + */ @javax.annotation.Nullable public String getMessage() { return message; @@ -161,12 +161,12 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to InternalServerError - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to InternalServerError + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!InternalServerError.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -219,22 +219,22 @@ public InternalServerError read(JsonReader in) throws IOException { } } - /** - * Create an instance of InternalServerError given an JSON string - * - * @param jsonString JSON string - * @return An instance of InternalServerError - * @throws IOException if the JSON string is invalid with respect to InternalServerError - */ + /** + * Create an instance of InternalServerError given an JSON string + * + * @param jsonString JSON string + * @return An instance of InternalServerError + * @throws IOException if the JSON string is invalid with respect to InternalServerError + */ public static InternalServerError fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, InternalServerError.class); } - /** - * Convert an instance of InternalServerError to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of InternalServerError to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/src/main/java/Avalara/SDK/model/EInvoicing/V1/Mandate.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/Mandate.java index 22a2797..2624764 100644 --- a/src/main/java/Avalara/SDK/model/EInvoicing/V1/Mandate.java +++ b/src/main/java/Avalara/SDK/model/EInvoicing/V1/Mandate.java @@ -60,7 +60,7 @@ /** * Mandate */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class Mandate { public static final String SERIALIZED_NAME_MANDATE_ID = "mandateId"; @SerializedName(SERIALIZED_NAME_MANDATE_ID) @@ -88,11 +88,11 @@ public class Mandate { public static final String SERIALIZED_NAME_INPUT_DATA_FORMATS = "inputDataFormats"; @SerializedName(SERIALIZED_NAME_INPUT_DATA_FORMATS) - private List inputDataFormats; + private List inputDataFormats = new ArrayList<>(); public static final String SERIALIZED_NAME_WORKFLOW_IDS = "workflowIds"; @SerializedName(SERIALIZED_NAME_WORKFLOW_IDS) - private List workflowIds; + private List workflowIds = new ArrayList<>(); public Mandate() { } @@ -102,10 +102,10 @@ public Mandate mandateId(String mandateId) { return this; } - /** - * Mandate UUID + /** + * 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 mandateId - **/ + */ @javax.annotation.Nullable public String getMandateId() { return mandateId; @@ -121,10 +121,10 @@ public Mandate countryMandate(String countryMandate) { return this; } - /** - * Country mandate name + /** + * **[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 countryMandate - **/ + */ @javax.annotation.Nullable public String getCountryMandate() { return countryMandate; @@ -140,10 +140,10 @@ public Mandate countryCode(String countryCode) { return this; } - /** + /** * Country code * @return countryCode - **/ + */ @javax.annotation.Nullable public String getCountryCode() { return countryCode; @@ -159,10 +159,10 @@ public Mandate description(String description) { return this; } - /** + /** * Mandate description * @return description - **/ + */ @javax.annotation.Nullable public String getDescription() { return description; @@ -178,10 +178,10 @@ public Mandate supportedByPartnerAPI(Boolean supportedByPartnerAPI) { return this; } - /** + /** * Indicates whether this mandate supported by the partner API * @return supportedByPartnerAPI - **/ + */ @javax.annotation.Nullable public Boolean getSupportedByPartnerAPI() { return supportedByPartnerAPI; @@ -197,10 +197,10 @@ public Mandate mandateFormat(String mandateFormat) { return this; } - /** + /** * Mandate format * @return mandateFormat - **/ + */ @javax.annotation.Nullable public String getMandateFormat() { return mandateFormat; @@ -224,10 +224,10 @@ public Mandate addInputDataFormatsItem(InputDataFormats inputDataFormatsItem) { return this; } - /** + /** * Format and version used when inputting the data * @return inputDataFormats - **/ + */ @javax.annotation.Nullable public List getInputDataFormats() { return inputDataFormats; @@ -251,10 +251,10 @@ public Mandate addWorkflowIdsItem(WorkflowIds workflowIdsItem) { return this; } - /** + /** * Workflow ID list * @return workflowIds - **/ + */ @javax.annotation.Nullable public List getWorkflowIds() { return workflowIds; @@ -337,12 +337,12 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to Mandate - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Mandate + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!Mandate.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -432,22 +432,22 @@ public Mandate read(JsonReader in) throws IOException { } } - /** - * Create an instance of Mandate given an JSON string - * - * @param jsonString JSON string - * @return An instance of Mandate - * @throws IOException if the JSON string is invalid with respect to Mandate - */ + /** + * Create an instance of Mandate given an JSON string + * + * @param jsonString JSON string + * @return An instance of Mandate + * @throws IOException if the JSON string is invalid with respect to Mandate + */ public static Mandate fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, Mandate.class); } - /** - * Convert an instance of Mandate to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of Mandate to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/src/main/java/Avalara/SDK/model/EInvoicing/V1/MandateDataInputField.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/MandateDataInputField.java new file mode 100644 index 0000000..6ab89bf --- /dev/null +++ b/src/main/java/Avalara/SDK/model/EInvoicing/V1/MandateDataInputField.java @@ -0,0 +1,603 @@ +/* + * AvaTax Software Development Kit for Java (JRE) + * + * (c) 2004-2022 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * Avalara E-Invoicing API + * + * An API that supports sending data for an E-Invoicing compliance use-case. + * + * @author Sachin Baijal + * @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-JRE-SDK + */ + +package Avalara.SDK.model.EInvoicing.V1; + +import java.util.Objects; +import Avalara.SDK.model.EInvoicing.V1.MandateDataInputFieldNamespace; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import Avalara.SDK.JSON; + +/** + * The Data Input Field + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") +public class MandateDataInputField { + public static final String SERIALIZED_NAME_FIELD_ID = "fieldId"; + @SerializedName(SERIALIZED_NAME_FIELD_ID) + private String fieldId; + + public static final String SERIALIZED_NAME_DOCUMENT_TYPE = "documentType"; + @SerializedName(SERIALIZED_NAME_DOCUMENT_TYPE) + private String documentType; + + public static final String SERIALIZED_NAME_DOCUMENT_VERSION = "documentVersion"; + @SerializedName(SERIALIZED_NAME_DOCUMENT_VERSION) + private String documentVersion; + + public static final String SERIALIZED_NAME_PATH = "path"; + @SerializedName(SERIALIZED_NAME_PATH) + private String path; + + public static final String SERIALIZED_NAME_PATH_TYPE = "pathType"; + @SerializedName(SERIALIZED_NAME_PATH_TYPE) + private String pathType; + + public static final String SERIALIZED_NAME_FIELD_NAME = "fieldName"; + @SerializedName(SERIALIZED_NAME_FIELD_NAME) + private String fieldName; + + public static final String SERIALIZED_NAME_NAMESPACE = "namespace"; + @SerializedName(SERIALIZED_NAME_NAMESPACE) + private MandateDataInputFieldNamespace namespace; + + public static final String SERIALIZED_NAME_EXAMPLE_OR_FIXED_VALUE = "exampleOrFixedValue"; + @SerializedName(SERIALIZED_NAME_EXAMPLE_OR_FIXED_VALUE) + private String exampleOrFixedValue; + + public static final String SERIALIZED_NAME_ACCEPTED_VALUES = "acceptedValues"; + @SerializedName(SERIALIZED_NAME_ACCEPTED_VALUES) + private List acceptedValues = new ArrayList<>(); + + public static final String SERIALIZED_NAME_DOCUMENTATION_LINK = "documentationLink"; + @SerializedName(SERIALIZED_NAME_DOCUMENTATION_LINK) + private String documentationLink; + + public static final String SERIALIZED_NAME_DATA_TYPE = "dataType"; + @SerializedName(SERIALIZED_NAME_DATA_TYPE) + private String dataType; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_OPTIONALITY = "optionality"; + @SerializedName(SERIALIZED_NAME_OPTIONALITY) + private String optionality; + + public static final String SERIALIZED_NAME_CARDINALITY = "cardinality"; + @SerializedName(SERIALIZED_NAME_CARDINALITY) + private String cardinality; + + public MandateDataInputField() { + } + + public MandateDataInputField fieldId(String fieldId) { + this.fieldId = fieldId; + return this; + } + + /** + * Field ID + * @return fieldId + */ + @javax.annotation.Nullable + public String getFieldId() { + return fieldId; + } + + public void setFieldId(String fieldId) { + this.fieldId = fieldId; + } + + + public MandateDataInputField documentType(String documentType) { + this.documentType = documentType; + return this; + } + + /** + * The document type + * @return documentType + */ + @javax.annotation.Nullable + public String getDocumentType() { + return documentType; + } + + public void setDocumentType(String documentType) { + this.documentType = documentType; + } + + + public MandateDataInputField documentVersion(String documentVersion) { + this.documentVersion = documentVersion; + return this; + } + + /** + * The document version + * @return documentVersion + */ + @javax.annotation.Nullable + public String getDocumentVersion() { + return documentVersion; + } + + public void setDocumentVersion(String documentVersion) { + this.documentVersion = documentVersion; + } + + + public MandateDataInputField path(String path) { + this.path = path; + return this; + } + + /** + * Path to this field + * @return path + */ + @javax.annotation.Nullable + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + + public MandateDataInputField pathType(String pathType) { + this.pathType = pathType; + return this; + } + + /** + * The type of path + * @return pathType + */ + @javax.annotation.Nullable + public String getPathType() { + return pathType; + } + + public void setPathType(String pathType) { + this.pathType = pathType; + } + + + public MandateDataInputField fieldName(String fieldName) { + this.fieldName = fieldName; + return this; + } + + /** + * Field name + * @return fieldName + */ + @javax.annotation.Nullable + public String getFieldName() { + return fieldName; + } + + public void setFieldName(String fieldName) { + this.fieldName = fieldName; + } + + + public MandateDataInputField namespace(MandateDataInputFieldNamespace namespace) { + this.namespace = namespace; + return this; + } + + /** + * Get namespace + * @return namespace + */ + @javax.annotation.Nullable + public MandateDataInputFieldNamespace getNamespace() { + return namespace; + } + + public void setNamespace(MandateDataInputFieldNamespace namespace) { + this.namespace = namespace; + } + + + public MandateDataInputField exampleOrFixedValue(String exampleOrFixedValue) { + this.exampleOrFixedValue = exampleOrFixedValue; + return this; + } + + /** + * An example of the content for this field + * @return exampleOrFixedValue + */ + @javax.annotation.Nullable + public String getExampleOrFixedValue() { + return exampleOrFixedValue; + } + + public void setExampleOrFixedValue(String exampleOrFixedValue) { + this.exampleOrFixedValue = exampleOrFixedValue; + } + + + public MandateDataInputField acceptedValues(List acceptedValues) { + this.acceptedValues = acceptedValues; + return this; + } + + public MandateDataInputField addAcceptedValuesItem(String acceptedValuesItem) { + if (this.acceptedValues == null) { + this.acceptedValues = new ArrayList<>(); + } + this.acceptedValues.add(acceptedValuesItem); + return this; + } + + /** + * An Array representing the acceptable values for this field + * @return acceptedValues + */ + @javax.annotation.Nullable + public List getAcceptedValues() { + return acceptedValues; + } + + public void setAcceptedValues(List acceptedValues) { + this.acceptedValues = acceptedValues; + } + + + public MandateDataInputField documentationLink(String documentationLink) { + this.documentationLink = documentationLink; + return this; + } + + /** + * An example of the content for this field + * @return documentationLink + */ + @javax.annotation.Nullable + public String getDocumentationLink() { + return documentationLink; + } + + public void setDocumentationLink(String documentationLink) { + this.documentationLink = documentationLink; + } + + + public MandateDataInputField dataType(String dataType) { + this.dataType = dataType; + return this; + } + + /** + * The data type of this field. + * @return dataType + */ + @javax.annotation.Nullable + public String getDataType() { + return dataType; + } + + public void setDataType(String dataType) { + this.dataType = dataType; + } + + + public MandateDataInputField description(String description) { + this.description = description; + return this; + } + + /** + * A description of this field + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + + public MandateDataInputField optionality(String optionality) { + this.optionality = optionality; + return this; + } + + /** + * Determines if the field if Required/Conditional/Optional or not required. + * @return optionality + */ + @javax.annotation.Nullable + public String getOptionality() { + return optionality; + } + + public void setOptionality(String optionality) { + this.optionality = optionality; + } + + + public MandateDataInputField cardinality(String cardinality) { + this.cardinality = cardinality; + return this; + } + + /** + * Represents the number of times an element can appear within the document + * @return cardinality + */ + @javax.annotation.Nullable + public String getCardinality() { + return cardinality; + } + + public void setCardinality(String cardinality) { + this.cardinality = cardinality; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MandateDataInputField mandateDataInputField = (MandateDataInputField) o; + return Objects.equals(this.fieldId, mandateDataInputField.fieldId) && + Objects.equals(this.documentType, mandateDataInputField.documentType) && + Objects.equals(this.documentVersion, mandateDataInputField.documentVersion) && + Objects.equals(this.path, mandateDataInputField.path) && + Objects.equals(this.pathType, mandateDataInputField.pathType) && + Objects.equals(this.fieldName, mandateDataInputField.fieldName) && + Objects.equals(this.namespace, mandateDataInputField.namespace) && + Objects.equals(this.exampleOrFixedValue, mandateDataInputField.exampleOrFixedValue) && + Objects.equals(this.acceptedValues, mandateDataInputField.acceptedValues) && + Objects.equals(this.documentationLink, mandateDataInputField.documentationLink) && + Objects.equals(this.dataType, mandateDataInputField.dataType) && + Objects.equals(this.description, mandateDataInputField.description) && + Objects.equals(this.optionality, mandateDataInputField.optionality) && + Objects.equals(this.cardinality, mandateDataInputField.cardinality); + } + + @Override + public int hashCode() { + return Objects.hash(fieldId, documentType, documentVersion, path, pathType, fieldName, namespace, exampleOrFixedValue, acceptedValues, documentationLink, dataType, description, optionality, cardinality); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MandateDataInputField {\n"); + sb.append(" fieldId: ").append(toIndentedString(fieldId)).append("\n"); + sb.append(" documentType: ").append(toIndentedString(documentType)).append("\n"); + sb.append(" documentVersion: ").append(toIndentedString(documentVersion)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" pathType: ").append(toIndentedString(pathType)).append("\n"); + sb.append(" fieldName: ").append(toIndentedString(fieldName)).append("\n"); + sb.append(" namespace: ").append(toIndentedString(namespace)).append("\n"); + sb.append(" exampleOrFixedValue: ").append(toIndentedString(exampleOrFixedValue)).append("\n"); + sb.append(" acceptedValues: ").append(toIndentedString(acceptedValues)).append("\n"); + sb.append(" documentationLink: ").append(toIndentedString(documentationLink)).append("\n"); + sb.append(" dataType: ").append(toIndentedString(dataType)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" optionality: ").append(toIndentedString(optionality)).append("\n"); + sb.append(" cardinality: ").append(toIndentedString(cardinality)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("fieldId"); + openapiFields.add("documentType"); + openapiFields.add("documentVersion"); + openapiFields.add("path"); + openapiFields.add("pathType"); + openapiFields.add("fieldName"); + openapiFields.add("namespace"); + openapiFields.add("exampleOrFixedValue"); + openapiFields.add("acceptedValues"); + openapiFields.add("documentationLink"); + openapiFields.add("dataType"); + openapiFields.add("description"); + openapiFields.add("optionality"); + openapiFields.add("cardinality"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to MandateDataInputField + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MandateDataInputField.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in MandateDataInputField is not found in the empty JSON string", MandateDataInputField.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!MandateDataInputField.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MandateDataInputField` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("fieldId") != null && !jsonObj.get("fieldId").isJsonNull()) && !jsonObj.get("fieldId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `fieldId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fieldId").toString())); + } + if ((jsonObj.get("documentType") != null && !jsonObj.get("documentType").isJsonNull()) && !jsonObj.get("documentType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `documentType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("documentType").toString())); + } + if ((jsonObj.get("documentVersion") != null && !jsonObj.get("documentVersion").isJsonNull()) && !jsonObj.get("documentVersion").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `documentVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("documentVersion").toString())); + } + if ((jsonObj.get("path") != null && !jsonObj.get("path").isJsonNull()) && !jsonObj.get("path").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `path` to be a primitive type in the JSON string but got `%s`", jsonObj.get("path").toString())); + } + if ((jsonObj.get("pathType") != null && !jsonObj.get("pathType").isJsonNull()) && !jsonObj.get("pathType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pathType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pathType").toString())); + } + if ((jsonObj.get("fieldName") != null && !jsonObj.get("fieldName").isJsonNull()) && !jsonObj.get("fieldName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `fieldName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fieldName").toString())); + } + // validate the optional field `namespace` + if (jsonObj.get("namespace") != null && !jsonObj.get("namespace").isJsonNull()) { + MandateDataInputFieldNamespace.validateJsonElement(jsonObj.get("namespace")); + } + if ((jsonObj.get("exampleOrFixedValue") != null && !jsonObj.get("exampleOrFixedValue").isJsonNull()) && !jsonObj.get("exampleOrFixedValue").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `exampleOrFixedValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("exampleOrFixedValue").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("acceptedValues") != null && !jsonObj.get("acceptedValues").isJsonNull() && !jsonObj.get("acceptedValues").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `acceptedValues` to be an array in the JSON string but got `%s`", jsonObj.get("acceptedValues").toString())); + } + if ((jsonObj.get("documentationLink") != null && !jsonObj.get("documentationLink").isJsonNull()) && !jsonObj.get("documentationLink").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `documentationLink` to be a primitive type in the JSON string but got `%s`", jsonObj.get("documentationLink").toString())); + } + if ((jsonObj.get("dataType") != null && !jsonObj.get("dataType").isJsonNull()) && !jsonObj.get("dataType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `dataType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dataType").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + if ((jsonObj.get("optionality") != null && !jsonObj.get("optionality").isJsonNull()) && !jsonObj.get("optionality").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `optionality` to be a primitive type in the JSON string but got `%s`", jsonObj.get("optionality").toString())); + } + if ((jsonObj.get("cardinality") != null && !jsonObj.get("cardinality").isJsonNull()) && !jsonObj.get("cardinality").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cardinality` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardinality").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MandateDataInputField.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MandateDataInputField' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(MandateDataInputField.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, MandateDataInputField value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MandateDataInputField read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of MandateDataInputField given an JSON string + * + * @param jsonString JSON string + * @return An instance of MandateDataInputField + * @throws IOException if the JSON string is invalid with respect to MandateDataInputField + */ + public static MandateDataInputField fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MandateDataInputField.class); + } + + /** + * Convert an instance of MandateDataInputField to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/Avalara/SDK/model/EInvoicing/V1/MandateDataInputFieldNamespace.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/MandateDataInputFieldNamespace.java new file mode 100644 index 0000000..51aac25 --- /dev/null +++ b/src/main/java/Avalara/SDK/model/EInvoicing/V1/MandateDataInputFieldNamespace.java @@ -0,0 +1,242 @@ +/* + * AvaTax Software Development Kit for Java (JRE) + * + * (c) 2004-2022 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * Avalara E-Invoicing API + * + * An API that supports sending data for an E-Invoicing compliance use-case. + * + * @author Sachin Baijal + * @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-JRE-SDK + */ + +package Avalara.SDK.model.EInvoicing.V1; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import Avalara.SDK.JSON; + +/** + * The namespace of the UBL element + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") +public class MandateDataInputFieldNamespace { + public static final String SERIALIZED_NAME_PREFIX = "prefix"; + @SerializedName(SERIALIZED_NAME_PREFIX) + private String prefix; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public MandateDataInputFieldNamespace() { + } + + public MandateDataInputFieldNamespace prefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** + * The namespace prefix for the UBL Element + * @return prefix + */ + @javax.annotation.Nullable + public String getPrefix() { + return prefix; + } + + public void setPrefix(String prefix) { + this.prefix = prefix; + } + + + public MandateDataInputFieldNamespace value(String value) { + this.value = value; + return this; + } + + /** + * Get value + * @return value + */ + @javax.annotation.Nullable + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MandateDataInputFieldNamespace mandateDataInputFieldNamespace = (MandateDataInputFieldNamespace) o; + return Objects.equals(this.prefix, mandateDataInputFieldNamespace.prefix) && + Objects.equals(this.value, mandateDataInputFieldNamespace.value); + } + + @Override + public int hashCode() { + return Objects.hash(prefix, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MandateDataInputFieldNamespace {\n"); + sb.append(" prefix: ").append(toIndentedString(prefix)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("prefix"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to MandateDataInputFieldNamespace + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MandateDataInputFieldNamespace.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in MandateDataInputFieldNamespace is not found in the empty JSON string", MandateDataInputFieldNamespace.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!MandateDataInputFieldNamespace.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MandateDataInputFieldNamespace` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("prefix") != null && !jsonObj.get("prefix").isJsonNull()) && !jsonObj.get("prefix").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `prefix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("prefix").toString())); + } + if ((jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) && !jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MandateDataInputFieldNamespace.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MandateDataInputFieldNamespace' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(MandateDataInputFieldNamespace.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, MandateDataInputFieldNamespace value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MandateDataInputFieldNamespace read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of MandateDataInputFieldNamespace given an JSON string + * + * @param jsonString JSON string + * @return An instance of MandateDataInputFieldNamespace + * @throws IOException if the JSON string is invalid with respect to MandateDataInputFieldNamespace + */ + public static MandateDataInputFieldNamespace fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MandateDataInputFieldNamespace.class); + } + + /** + * Convert an instance of MandateDataInputFieldNamespace to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/Avalara/SDK/model/EInvoicing/V1/MandatesResponse.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/MandatesResponse.java index 40dabe5..cda660a 100644 --- a/src/main/java/Avalara/SDK/model/EInvoicing/V1/MandatesResponse.java +++ b/src/main/java/Avalara/SDK/model/EInvoicing/V1/MandatesResponse.java @@ -61,11 +61,11 @@ /** * Mandate list response schema */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class MandatesResponse { - public static final String SERIALIZED_NAME_AT_RECORD_SET_COUNT = "@recordSetCount"; - @SerializedName(SERIALIZED_NAME_AT_RECORD_SET_COUNT) - private BigDecimal atRecordSetCount; + public static final String SERIALIZED_NAME_AT_RECORDSET_COUNT = "@recordsetCount"; + @SerializedName(SERIALIZED_NAME_AT_RECORDSET_COUNT) + private BigDecimal atRecordsetCount; public static final String SERIALIZED_NAME_AT_NEXT_LINK = "@nextLink"; @SerializedName(SERIALIZED_NAME_AT_NEXT_LINK) @@ -73,27 +73,27 @@ public class MandatesResponse { public static final String SERIALIZED_NAME_VALUE = "value"; @SerializedName(SERIALIZED_NAME_VALUE) - private List value; + private List value = new ArrayList<>(); public MandatesResponse() { } - public MandatesResponse atRecordSetCount(BigDecimal atRecordSetCount) { - this.atRecordSetCount = atRecordSetCount; + public MandatesResponse atRecordsetCount(BigDecimal atRecordsetCount) { + this.atRecordsetCount = atRecordsetCount; return this; } - /** + /** * Total count of results - * @return atRecordSetCount - **/ + * @return atRecordsetCount + */ @javax.annotation.Nullable - public BigDecimal getAtRecordSetCount() { - return atRecordSetCount; + public BigDecimal getAtRecordsetCount() { + return atRecordsetCount; } - public void setAtRecordSetCount(BigDecimal atRecordSetCount) { - this.atRecordSetCount = atRecordSetCount; + public void setAtRecordsetCount(BigDecimal atRecordsetCount) { + this.atRecordsetCount = atRecordsetCount; } @@ -102,10 +102,10 @@ public MandatesResponse atNextLink(String atNextLink) { return this; } - /** + /** * Get atNextLink * @return atNextLink - **/ + */ @javax.annotation.Nullable public String getAtNextLink() { return atNextLink; @@ -129,10 +129,10 @@ public MandatesResponse addValueItem(Mandate valueItem) { return this; } - /** + /** * Mandates schema * @return value - **/ + */ @javax.annotation.Nullable public List getValue() { return value; @@ -153,7 +153,7 @@ public boolean equals(Object o) { return false; } MandatesResponse mandatesResponse = (MandatesResponse) o; - return Objects.equals(this.atRecordSetCount, mandatesResponse.atRecordSetCount) && + return Objects.equals(this.atRecordsetCount, mandatesResponse.atRecordsetCount) && Objects.equals(this.atNextLink, mandatesResponse.atNextLink) && Objects.equals(this.value, mandatesResponse.value); } @@ -164,7 +164,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(atRecordSetCount, atNextLink, value); + return Objects.hash(atRecordsetCount, atNextLink, value); } private static int hashCodeNullable(JsonNullable a) { @@ -178,7 +178,7 @@ private static int hashCodeNullable(JsonNullable a) { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class MandatesResponse {\n"); - sb.append(" atRecordSetCount: ").append(toIndentedString(atRecordSetCount)).append("\n"); + sb.append(" atRecordsetCount: ").append(toIndentedString(atRecordsetCount)).append("\n"); sb.append(" atNextLink: ").append(toIndentedString(atNextLink)).append("\n"); sb.append(" value: ").append(toIndentedString(value)).append("\n"); sb.append("}"); @@ -203,7 +203,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("@recordSetCount"); + openapiFields.add("@recordsetCount"); openapiFields.add("@nextLink"); openapiFields.add("value"); @@ -211,12 +211,12 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to MandatesResponse - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to MandatesResponse + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!MandatesResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -235,19 +235,9 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("@nextLink") != null && !jsonObj.get("@nextLink").isJsonNull()) && !jsonObj.get("@nextLink").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `@nextLink` to be a primitive type in the JSON string but got `%s`", jsonObj.get("@nextLink").toString())); } - if (jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) { - JsonArray jsonArrayvalue = jsonObj.getAsJsonArray("value"); - if (jsonArrayvalue != null) { - // ensure the json data is an array - if (!jsonObj.get("value").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `value` to be an array in the JSON string but got `%s`", jsonObj.get("value").toString())); - } - - // validate the optional field `value` (array) - for (int i = 0; i < jsonArrayvalue.size(); i++) { - Mandate.validateJsonElement(jsonArrayvalue.get(i)); - }; - } + // ensure the optional json data is an array if present + if (jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull() && !jsonObj.get("value").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be an array in the JSON string but got `%s`", jsonObj.get("value").toString())); } } @@ -280,22 +270,22 @@ public MandatesResponse read(JsonReader in) throws IOException { } } - /** - * Create an instance of MandatesResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of MandatesResponse - * @throws IOException if the JSON string is invalid with respect to MandatesResponse - */ + /** + * Create an instance of MandatesResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of MandatesResponse + * @throws IOException if the JSON string is invalid with respect to MandatesResponse + */ public static MandatesResponse fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, MandatesResponse.class); } - /** - * Convert an instance of MandatesResponse to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of MandatesResponse to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/src/main/java/Avalara/SDK/model/EInvoicing/V1/NotFoundError.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/NotFoundError.java index ba05899..47fdf06 100644 --- a/src/main/java/Avalara/SDK/model/EInvoicing/V1/NotFoundError.java +++ b/src/main/java/Avalara/SDK/model/EInvoicing/V1/NotFoundError.java @@ -56,7 +56,7 @@ /** * Returns an HTTP error code and message for a 'not found' error */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class NotFoundError { public static final String SERIALIZED_NAME_ERROR = "error"; @SerializedName(SERIALIZED_NAME_ERROR) @@ -74,10 +74,10 @@ public NotFoundError error(String error) { return this; } - /** + /** * The three-digit HTTP error code for a not found error * @return error - **/ + */ @javax.annotation.Nullable public String getError() { return error; @@ -93,10 +93,10 @@ public NotFoundError message(String message) { return this; } - /** + /** * A message about the not found error * @return message - **/ + */ @javax.annotation.Nullable public String getMessage() { return message; @@ -161,12 +161,12 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to NotFoundError - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to NotFoundError + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!NotFoundError.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -219,22 +219,22 @@ public NotFoundError read(JsonReader in) throws IOException { } } - /** - * Create an instance of NotFoundError given an JSON string - * - * @param jsonString JSON string - * @return An instance of NotFoundError - * @throws IOException if the JSON string is invalid with respect to NotFoundError - */ + /** + * Create an instance of NotFoundError given an JSON string + * + * @param jsonString JSON string + * @return An instance of NotFoundError + * @throws IOException if the JSON string is invalid with respect to NotFoundError + */ public static NotFoundError fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, NotFoundError.class); } - /** - * Convert an instance of NotFoundError to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of NotFoundError to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/src/main/java/Avalara/SDK/model/EInvoicing/V1/NotUsedForField.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/NotUsedForField.java index 09ddcf6..e2d4fc0 100644 --- a/src/main/java/Avalara/SDK/model/EInvoicing/V1/NotUsedForField.java +++ b/src/main/java/Avalara/SDK/model/EInvoicing/V1/NotUsedForField.java @@ -56,7 +56,7 @@ /** * Mandates for which this field is not used */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class NotUsedForField { public static final String SERIALIZED_NAME_COUNTRY_MANDATE = "countryMandate"; @SerializedName(SERIALIZED_NAME_COUNTRY_MANDATE) @@ -70,10 +70,10 @@ public NotUsedForField countryMandate(String countryMandate) { return this; } - /** + /** * Get countryMandate * @return countryMandate - **/ + */ @javax.annotation.Nullable public String getCountryMandate() { return countryMandate; @@ -135,12 +135,12 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to NotUsedForField - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to NotUsedForField + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!NotUsedForField.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -190,22 +190,22 @@ public NotUsedForField read(JsonReader in) throws IOException { } } - /** - * Create an instance of NotUsedForField given an JSON string - * - * @param jsonString JSON string - * @return An instance of NotUsedForField - * @throws IOException if the JSON string is invalid with respect to NotUsedForField - */ + /** + * Create an instance of NotUsedForField given an JSON string + * + * @param jsonString JSON string + * @return An instance of NotUsedForField + * @throws IOException if the JSON string is invalid with respect to NotUsedForField + */ public static NotUsedForField fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, NotUsedForField.class); } - /** - * Convert an instance of NotUsedForField to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of NotUsedForField to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/src/main/java/Avalara/SDK/model/EInvoicing/V1/RequiredWhenField.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/RequiredWhenField.java index 7ee6f07..42da4e0 100644 --- a/src/main/java/Avalara/SDK/model/EInvoicing/V1/RequiredWhenField.java +++ b/src/main/java/Avalara/SDK/model/EInvoicing/V1/RequiredWhenField.java @@ -56,7 +56,7 @@ /** * RequiredWhenField */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class RequiredWhenField { public static final String SERIALIZED_NAME_SCENARIO = "scenario"; @SerializedName(SERIALIZED_NAME_SCENARIO) @@ -70,10 +70,10 @@ public RequiredWhenField scenario(String scenario) { return this; } - /** + /** * Get scenario * @return scenario - **/ + */ @javax.annotation.Nullable public String getScenario() { return scenario; @@ -135,12 +135,12 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to RequiredWhenField - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RequiredWhenField + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!RequiredWhenField.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -190,22 +190,22 @@ public RequiredWhenField read(JsonReader in) throws IOException { } } - /** - * Create an instance of RequiredWhenField given an JSON string - * - * @param jsonString JSON string - * @return An instance of RequiredWhenField - * @throws IOException if the JSON string is invalid with respect to RequiredWhenField - */ + /** + * Create an instance of RequiredWhenField given an JSON string + * + * @param jsonString JSON string + * @return An instance of RequiredWhenField + * @throws IOException if the JSON string is invalid with respect to RequiredWhenField + */ public static RequiredWhenField fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, RequiredWhenField.class); } - /** - * Convert an instance of RequiredWhenField to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of RequiredWhenField to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/src/main/java/Avalara/SDK/model/EInvoicing/V1/StatusEvent.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/StatusEvent.java index 9bd1396..d66cf02 100644 --- a/src/main/java/Avalara/SDK/model/EInvoicing/V1/StatusEvent.java +++ b/src/main/java/Avalara/SDK/model/EInvoicing/V1/StatusEvent.java @@ -28,6 +28,7 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -56,7 +57,7 @@ /** * Displays when a status event occurred */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class StatusEvent { public static final String SERIALIZED_NAME_EVENT_DATE_TIME = "eventDateTime"; @SerializedName(SERIALIZED_NAME_EVENT_DATE_TIME) @@ -66,6 +67,14 @@ public class StatusEvent { @SerializedName(SERIALIZED_NAME_MESSAGE) private String message; + public static final String SERIALIZED_NAME_RESPONSE_KEY = "responseKey"; + @SerializedName(SERIALIZED_NAME_RESPONSE_KEY) + private String responseKey; + + public static final String SERIALIZED_NAME_RESPONSE_VALUE = "responseValue"; + @SerializedName(SERIALIZED_NAME_RESPONSE_VALUE) + private String responseValue; + public StatusEvent() { } @@ -74,10 +83,10 @@ public StatusEvent eventDateTime(String eventDateTime) { return this; } - /** + /** * The date and time when the status event occured, displayed in the format YYYY-MM-DDThh:mm:ss * @return eventDateTime - **/ + */ @javax.annotation.Nullable public String getEventDateTime() { return eventDateTime; @@ -93,10 +102,10 @@ public StatusEvent message(String message) { return this; } - /** + /** * A message describing the status event * @return message - **/ + */ @javax.annotation.Nullable public String getMessage() { return message; @@ -107,6 +116,44 @@ public void setMessage(String message) { } + public StatusEvent responseKey(String responseKey) { + this.responseKey = responseKey; + return this; + } + + /** + * 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 responseKey + */ + @javax.annotation.Nullable + public String getResponseKey() { + return responseKey; + } + + public void setResponseKey(String responseKey) { + this.responseKey = responseKey; + } + + + public StatusEvent responseValue(String responseValue) { + this.responseValue = responseValue; + return this; + } + + /** + * The corresponding value associated with the response key. This value is provided by the tax authority in response to the event. + * @return responseValue + */ + @javax.annotation.Nullable + public String getResponseValue() { + return responseValue; + } + + public void setResponseValue(String responseValue) { + this.responseValue = responseValue; + } + + @Override public boolean equals(Object o) { @@ -118,12 +165,25 @@ public boolean equals(Object o) { } StatusEvent statusEvent = (StatusEvent) o; return Objects.equals(this.eventDateTime, statusEvent.eventDateTime) && - Objects.equals(this.message, statusEvent.message); + Objects.equals(this.message, statusEvent.message) && + Objects.equals(this.responseKey, statusEvent.responseKey) && + Objects.equals(this.responseValue, statusEvent.responseValue); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); } @Override public int hashCode() { - return Objects.hash(eventDateTime, message); + return Objects.hash(eventDateTime, message, responseKey, responseValue); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override @@ -132,6 +192,8 @@ public String toString() { sb.append("class StatusEvent {\n"); sb.append(" eventDateTime: ").append(toIndentedString(eventDateTime)).append("\n"); sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" responseKey: ").append(toIndentedString(responseKey)).append("\n"); + sb.append(" responseValue: ").append(toIndentedString(responseValue)).append("\n"); sb.append("}"); return sb.toString(); } @@ -156,17 +218,19 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("eventDateTime"); openapiFields.add("message"); + openapiFields.add("responseKey"); + openapiFields.add("responseValue"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to StatusEvent - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to StatusEvent + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!StatusEvent.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -188,6 +252,12 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); } + if ((jsonObj.get("responseKey") != null && !jsonObj.get("responseKey").isJsonNull()) && !jsonObj.get("responseKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `responseKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("responseKey").toString())); + } + if ((jsonObj.get("responseValue") != null && !jsonObj.get("responseValue").isJsonNull()) && !jsonObj.get("responseValue").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `responseValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("responseValue").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -219,22 +289,22 @@ public StatusEvent read(JsonReader in) throws IOException { } } - /** - * Create an instance of StatusEvent given an JSON string - * - * @param jsonString JSON string - * @return An instance of StatusEvent - * @throws IOException if the JSON string is invalid with respect to StatusEvent - */ + /** + * Create an instance of StatusEvent given an JSON string + * + * @param jsonString JSON string + * @return An instance of StatusEvent + * @throws IOException if the JSON string is invalid with respect to StatusEvent + */ public static StatusEvent fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, StatusEvent.class); } - /** - * Convert an instance of StatusEvent to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of StatusEvent to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/src/main/java/Avalara/SDK/model/EInvoicing/V1/SubmitDocumentMetadata.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/SubmitDocumentMetadata.java index 10b1ad4..5880065 100644 --- a/src/main/java/Avalara/SDK/model/EInvoicing/V1/SubmitDocumentMetadata.java +++ b/src/main/java/Avalara/SDK/model/EInvoicing/V1/SubmitDocumentMetadata.java @@ -54,9 +54,9 @@ import Avalara.SDK.JSON; /** - * 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> + * 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> */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class SubmitDocumentMetadata { public static final String SERIALIZED_NAME_WORKFLOW_ID = "workflowId"; @SerializedName(SERIALIZED_NAME_WORKFLOW_ID) @@ -86,10 +86,10 @@ public SubmitDocumentMetadata workflowId(String workflowId) { return this; } - /** + /** * Specifies a unique ID for this workflow. * @return workflowId - **/ + */ @javax.annotation.Nonnull public String getWorkflowId() { return workflowId; @@ -105,10 +105,10 @@ public SubmitDocumentMetadata dataFormat(String dataFormat) { return this; } - /** + /** * Specifies the data format for this workflow. * @return dataFormat - **/ + */ @javax.annotation.Nonnull public String getDataFormat() { return dataFormat; @@ -124,10 +124,10 @@ public SubmitDocumentMetadata dataFormatVersion(String dataFormatVersion) { return this; } - /** + /** * Specifies the data format version number. * @return dataFormatVersion - **/ + */ @javax.annotation.Nonnull public String getDataFormatVersion() { return dataFormatVersion; @@ -143,10 +143,10 @@ public SubmitDocumentMetadata countryCode(String countryCode) { return this; } - /** - * The two-letter ISO-3166 country code for the country where the e-invoice is being submitted + /** + * The two-letter ISO-3166 country code for the country where the document is being submitted * @return countryCode - **/ + */ @javax.annotation.Nonnull public String getCountryCode() { return countryCode; @@ -162,10 +162,10 @@ public SubmitDocumentMetadata countryMandate(String countryMandate) { return this; } - /** + /** * The e-invoicing mandate for the specified country. * @return countryMandate - **/ + */ @javax.annotation.Nonnull public String getCountryMandate() { return countryMandate; @@ -244,12 +244,12 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("countryMandate"); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to SubmitDocumentMetadata - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SubmitDocumentMetadata + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!SubmitDocumentMetadata.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -318,22 +318,22 @@ public SubmitDocumentMetadata read(JsonReader in) throws IOException { } } - /** - * Create an instance of SubmitDocumentMetadata given an JSON string - * - * @param jsonString JSON string - * @return An instance of SubmitDocumentMetadata - * @throws IOException if the JSON string is invalid with respect to SubmitDocumentMetadata - */ + /** + * Create an instance of SubmitDocumentMetadata given an JSON string + * + * @param jsonString JSON string + * @return An instance of SubmitDocumentMetadata + * @throws IOException if the JSON string is invalid with respect to SubmitDocumentMetadata + */ public static SubmitDocumentMetadata fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, SubmitDocumentMetadata.class); } - /** - * Convert an instance of SubmitDocumentMetadata to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of SubmitDocumentMetadata to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); } diff --git a/src/main/java/Avalara/SDK/model/EInvoicing/V1/SubmitInteropDocument202Response.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/SubmitInteropDocument202Response.java new file mode 100644 index 0000000..0094c49 --- /dev/null +++ b/src/main/java/Avalara/SDK/model/EInvoicing/V1/SubmitInteropDocument202Response.java @@ -0,0 +1,242 @@ +/* + * AvaTax Software Development Kit for Java (JRE) + * + * (c) 2004-2022 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * Avalara E-Invoicing API + * + * An API that supports sending data for an E-Invoicing compliance use-case. + * + * @author Sachin Baijal + * @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-JRE-SDK + */ + +package Avalara.SDK.model.EInvoicing.V1; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import Avalara.SDK.JSON; + +/** + * SubmitInteropDocument202Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") +public class SubmitInteropDocument202Response { + public static final String SERIALIZED_NAME_INTERCHANGE_ID = "interchangeId"; + @SerializedName(SERIALIZED_NAME_INTERCHANGE_ID) + private String interchangeId; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public SubmitInteropDocument202Response() { + } + + public SubmitInteropDocument202Response interchangeId(String interchangeId) { + this.interchangeId = interchangeId; + return this; + } + + /** + * The unique interchange ID for this submission. + * @return interchangeId + */ + @javax.annotation.Nullable + public String getInterchangeId() { + return interchangeId; + } + + public void setInterchangeId(String interchangeId) { + this.interchangeId = interchangeId; + } + + + public SubmitInteropDocument202Response message(String message) { + this.message = message; + return this; + } + + /** + * A message indicating that the document has been accepted. + * @return message + */ + @javax.annotation.Nullable + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubmitInteropDocument202Response submitInteropDocument202Response = (SubmitInteropDocument202Response) o; + return Objects.equals(this.interchangeId, submitInteropDocument202Response.interchangeId) && + Objects.equals(this.message, submitInteropDocument202Response.message); + } + + @Override + public int hashCode() { + return Objects.hash(interchangeId, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubmitInteropDocument202Response {\n"); + sb.append(" interchangeId: ").append(toIndentedString(interchangeId)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("interchangeId"); + openapiFields.add("message"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SubmitInteropDocument202Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SubmitInteropDocument202Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SubmitInteropDocument202Response is not found in the empty JSON string", SubmitInteropDocument202Response.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SubmitInteropDocument202Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SubmitInteropDocument202Response` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("interchangeId") != null && !jsonObj.get("interchangeId").isJsonNull()) && !jsonObj.get("interchangeId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `interchangeId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("interchangeId").toString())); + } + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SubmitInteropDocument202Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SubmitInteropDocument202Response' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SubmitInteropDocument202Response.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SubmitInteropDocument202Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SubmitInteropDocument202Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SubmitInteropDocument202Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of SubmitInteropDocument202Response + * @throws IOException if the JSON string is invalid with respect to SubmitInteropDocument202Response + */ + public static SubmitInteropDocument202Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SubmitInteropDocument202Response.class); + } + + /** + * Convert an instance of SubmitInteropDocument202Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/Avalara/SDK/model/EInvoicing/V1/WorkflowIds.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/WorkflowIds.java index cd7e9c0..f722a92 100644 --- a/src/main/java/Avalara/SDK/model/EInvoicing/V1/WorkflowIds.java +++ b/src/main/java/Avalara/SDK/model/EInvoicing/V1/WorkflowIds.java @@ -56,7 +56,7 @@ /** * Workflow ID list */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class WorkflowIds { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @@ -74,10 +74,10 @@ public WorkflowIds name(String name) { return this; } - /** + /** * The name of this workflow * @return name - **/ + */ @javax.annotation.Nullable public String getName() { return name; @@ -93,10 +93,10 @@ public WorkflowIds description(String description) { return this; } - /** + /** * Workflow description * @return description - **/ + */ @javax.annotation.Nullable public String getDescription() { return description; @@ -161,12 +161,12 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); } - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to WorkflowIds - */ + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to WorkflowIds + */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { if (!WorkflowIds.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null @@ -219,22 +219,22 @@ public WorkflowIds read(JsonReader in) throws IOException { } } - /** - * Create an instance of WorkflowIds given an JSON string - * - * @param jsonString JSON string - * @return An instance of WorkflowIds - * @throws IOException if the JSON string is invalid with respect to WorkflowIds - */ + /** + * Create an instance of WorkflowIds given an JSON string + * + * @param jsonString JSON string + * @return An instance of WorkflowIds + * @throws IOException if the JSON string is invalid with respect to WorkflowIds + */ public static WorkflowIds fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, WorkflowIds.class); } - /** - * Convert an instance of WorkflowIds to an JSON string - * - * @return JSON string - */ + /** + * Convert an instance of WorkflowIds to an JSON string + * + * @return JSON string + */ public String toJson() { return JSON.getGson().toJson(this); }