diff --git a/README.md b/README.md index 63b757b..ee160ed 100644 --- a/README.md +++ b/README.md @@ -151,6 +151,7 @@ Class | Method | HTTP request | Description *Forms1099Api* | [**get1099FormPdf**](docs/A1099/V2/Forms1099Api.md#get1099formpdf) | **GET** /1099/forms/{id}/pdf | Retrieve the PDF file for a 1099/1095/W2/1042S form *Forms1099Api* | [**list1099Forms**](docs/A1099/V2/Forms1099Api.md#list1099forms) | **GET** /1099/forms | List 1099/1095/W2/1042S forms *Forms1099Api* | [**update1099Form**](docs/A1099/V2/Forms1099Api.md#update1099form) | **PUT** /1099/forms/{id} | Update a 1099/1095/W2/1042S form +*FormsW9Api* | [**createAndSendW9FormEmail**](docs/A1099/V2/FormsW9Api.md#createandsendw9formemail) | **POST** /w9/forms/$create-and-send-email | Create a minimal W9/W4/W8 form and sends the e-mail request *FormsW9Api* | [**createW9Form**](docs/A1099/V2/FormsW9Api.md#createw9form) | **POST** /w9/forms | Create a W9/W4/W8 form *FormsW9Api* | [**deleteW9Form**](docs/A1099/V2/FormsW9Api.md#deletew9form) | **DELETE** /w9/forms/{id} | Delete a W9/W4/W8 form *FormsW9Api* | [**getW9Form**](docs/A1099/V2/FormsW9Api.md#getw9form) | **GET** /w9/forms/{id} | Retrieve a W9/W4/W8 form @@ -163,7 +164,7 @@ Class | Method | HTTP request | Description *Issuers1099Api* | [**getIssuer**](docs/A1099/V2/Issuers1099Api.md#getissuer) | **GET** /1099/issuers/{id} | Retrieve an issuer *Issuers1099Api* | [**getIssuers**](docs/A1099/V2/Issuers1099Api.md#getissuers) | **GET** /1099/issuers | List issuers *Issuers1099Api* | [**updateIssuer**](docs/A1099/V2/Issuers1099Api.md#updateissuer) | **PUT** /1099/issuers/{id} | Update an issuer -*Jobs1099Api* | [**getJob**](docs/A1099/V2/Jobs1099Api.md#getjob) | **GET** /1099/jobs/{id} | Retrieves information about the job +*JobsApi* | [**getJob**](docs/A1099/V2/JobsApi.md#getjob) | **GET** /jobs/{id} | Retrieves information about the job ## Documentation for Models @@ -250,134 +251,72 @@ Class | Method | HTTP request | Description ### A1099 V2 Model Documentation - - [Avalara.SDK.model.A1099.V2.Attribute](docs/A1099/V2/Attribute.md) - [Avalara.SDK.model.A1099.V2.AuthorizedApiRequestModel](docs/A1099/V2/AuthorizedApiRequestModel.md) - [Avalara.SDK.model.A1099.V2.AuthorizedApiRequestV2DataModel](docs/A1099/V2/AuthorizedApiRequestV2DataModel.md) - - [Avalara.SDK.model.A1099.V2.BaseCompanyModel](docs/A1099/V2/BaseCompanyModel.md) - - [Avalara.SDK.model.A1099.V2.BaseFormListRequest](docs/A1099/V2/BaseFormListRequest.md) - - [Avalara.SDK.model.A1099.V2.BulkUpsert1099FormsRequest](docs/A1099/V2/BulkUpsert1099FormsRequest.md) - [Avalara.SDK.model.A1099.V2.CompanyCreateUpdateRequestModel](docs/A1099/V2/CompanyCreateUpdateRequestModel.md) - - [Avalara.SDK.model.A1099.V2.CompanyModel](docs/A1099/V2/CompanyModel.md) - [Avalara.SDK.model.A1099.V2.CompanyResponse](docs/A1099/V2/CompanyResponse.md) - - [Avalara.SDK.model.A1099.V2.CompanyResponseModel](docs/A1099/V2/CompanyResponseModel.md) - - [Avalara.SDK.model.A1099.V2.CoveredIndividualReference](docs/A1099/V2/CoveredIndividualReference.md) - - [Avalara.SDK.model.A1099.V2.CoveredIndividualReferenceResponse](docs/A1099/V2/CoveredIndividualReferenceResponse.md) - - [Avalara.SDK.model.A1099.V2.CoveredIndividualRequest](docs/A1099/V2/CoveredIndividualRequest.md) - - [Avalara.SDK.model.A1099.V2.Create1099Form201Response](docs/A1099/V2/Create1099Form201Response.md) + - [Avalara.SDK.model.A1099.V2.CoveredIndividual](docs/A1099/V2/CoveredIndividual.md) + - [Avalara.SDK.model.A1099.V2.CreateAndSendW9FormEmailRequest](docs/A1099/V2/CreateAndSendW9FormEmailRequest.md) + - [Avalara.SDK.model.A1099.V2.CreateCompanyRequest](docs/A1099/V2/CreateCompanyRequest.md) + - [Avalara.SDK.model.A1099.V2.CreateIssuerRequest](docs/A1099/V2/CreateIssuerRequest.md) - [Avalara.SDK.model.A1099.V2.CreateW9Form201Response](docs/A1099/V2/CreateW9Form201Response.md) - [Avalara.SDK.model.A1099.V2.CreateW9FormRequest](docs/A1099/V2/CreateW9FormRequest.md) - - [Avalara.SDK.model.A1099.V2.Data](docs/A1099/V2/Data.md) + - [Avalara.SDK.model.A1099.V2.EntryStatusResponse](docs/A1099/V2/EntryStatusResponse.md) - [Avalara.SDK.model.A1099.V2.ErrorModel](docs/A1099/V2/ErrorModel.md) - [Avalara.SDK.model.A1099.V2.ErrorResponse](docs/A1099/V2/ErrorResponse.md) - [Avalara.SDK.model.A1099.V2.ErrorResponseItem](docs/A1099/V2/ErrorResponseItem.md) - [Avalara.SDK.model.A1099.V2.Form1042S](docs/A1099/V2/Form1042S.md) - - [Avalara.SDK.model.A1099.V2.Form1042SList](docs/A1099/V2/Form1042SList.md) - - [Avalara.SDK.model.A1099.V2.Form1042SListItem](docs/A1099/V2/Form1042SListItem.md) - - [Avalara.SDK.model.A1099.V2.Form1042SListItemResponse](docs/A1099/V2/Form1042SListItemResponse.md) - - [Avalara.SDK.model.A1099.V2.Form1042SRequest](docs/A1099/V2/Form1042SRequest.md) - - [Avalara.SDK.model.A1099.V2.Form1042SResponse](docs/A1099/V2/Form1042SResponse.md) - [Avalara.SDK.model.A1099.V2.Form1095B](docs/A1099/V2/Form1095B.md) - - [Avalara.SDK.model.A1099.V2.Form1095BList](docs/A1099/V2/Form1095BList.md) - - [Avalara.SDK.model.A1099.V2.Form1095BListItem](docs/A1099/V2/Form1095BListItem.md) - - [Avalara.SDK.model.A1099.V2.Form1095BListItemResponse](docs/A1099/V2/Form1095BListItemResponse.md) - - [Avalara.SDK.model.A1099.V2.Form1095BRequest](docs/A1099/V2/Form1095BRequest.md) - - [Avalara.SDK.model.A1099.V2.Form1095BResponse](docs/A1099/V2/Form1095BResponse.md) - - [Avalara.SDK.model.A1099.V2.Form1095CList](docs/A1099/V2/Form1095CList.md) - - [Avalara.SDK.model.A1099.V2.Form1095CListItem](docs/A1099/V2/Form1095CListItem.md) + - [Avalara.SDK.model.A1099.V2.Form1095C](docs/A1099/V2/Form1095C.md) - [Avalara.SDK.model.A1099.V2.Form1099Base](docs/A1099/V2/Form1099Base.md) - - [Avalara.SDK.model.A1099.V2.Form1099BaseResponse](docs/A1099/V2/Form1099BaseResponse.md) - [Avalara.SDK.model.A1099.V2.Form1099Div](docs/A1099/V2/Form1099Div.md) - - [Avalara.SDK.model.A1099.V2.Form1099DivList](docs/A1099/V2/Form1099DivList.md) - - [Avalara.SDK.model.A1099.V2.Form1099DivListItem](docs/A1099/V2/Form1099DivListItem.md) - - [Avalara.SDK.model.A1099.V2.Form1099DivListItemResponse](docs/A1099/V2/Form1099DivListItemResponse.md) - - [Avalara.SDK.model.A1099.V2.Form1099DivRequest](docs/A1099/V2/Form1099DivRequest.md) - - [Avalara.SDK.model.A1099.V2.Form1099DivResponse](docs/A1099/V2/Form1099DivResponse.md) - [Avalara.SDK.model.A1099.V2.Form1099Int](docs/A1099/V2/Form1099Int.md) - - [Avalara.SDK.model.A1099.V2.Form1099IntList](docs/A1099/V2/Form1099IntList.md) - - [Avalara.SDK.model.A1099.V2.Form1099IntListItem](docs/A1099/V2/Form1099IntListItem.md) - - [Avalara.SDK.model.A1099.V2.Form1099IntListItemResponse](docs/A1099/V2/Form1099IntListItemResponse.md) - - [Avalara.SDK.model.A1099.V2.Form1099IntRequest](docs/A1099/V2/Form1099IntRequest.md) - - [Avalara.SDK.model.A1099.V2.Form1099IntResponse](docs/A1099/V2/Form1099IntResponse.md) - [Avalara.SDK.model.A1099.V2.Form1099K](docs/A1099/V2/Form1099K.md) - - [Avalara.SDK.model.A1099.V2.Form1099KList](docs/A1099/V2/Form1099KList.md) - - [Avalara.SDK.model.A1099.V2.Form1099KListItem](docs/A1099/V2/Form1099KListItem.md) - - [Avalara.SDK.model.A1099.V2.Form1099KListItemResponse](docs/A1099/V2/Form1099KListItemResponse.md) - - [Avalara.SDK.model.A1099.V2.Form1099KRequest](docs/A1099/V2/Form1099KRequest.md) - - [Avalara.SDK.model.A1099.V2.Form1099KResponse](docs/A1099/V2/Form1099KResponse.md) - - [Avalara.SDK.model.A1099.V2.Form1099ListResponse](docs/A1099/V2/Form1099ListResponse.md) - - [Avalara.SDK.model.A1099.V2.Form1099ListResponseValueInner](docs/A1099/V2/Form1099ListResponseValueInner.md) + - [Avalara.SDK.model.A1099.V2.Form1099ListRequest](docs/A1099/V2/Form1099ListRequest.md) - [Avalara.SDK.model.A1099.V2.Form1099Misc](docs/A1099/V2/Form1099Misc.md) - - [Avalara.SDK.model.A1099.V2.Form1099MiscList](docs/A1099/V2/Form1099MiscList.md) - - [Avalara.SDK.model.A1099.V2.Form1099MiscListItem](docs/A1099/V2/Form1099MiscListItem.md) - - [Avalara.SDK.model.A1099.V2.Form1099MiscListItemResponse](docs/A1099/V2/Form1099MiscListItemResponse.md) - - [Avalara.SDK.model.A1099.V2.Form1099MiscRequest](docs/A1099/V2/Form1099MiscRequest.md) - - [Avalara.SDK.model.A1099.V2.Form1099MiscResponse](docs/A1099/V2/Form1099MiscResponse.md) - [Avalara.SDK.model.A1099.V2.Form1099Nec](docs/A1099/V2/Form1099Nec.md) - - [Avalara.SDK.model.A1099.V2.Form1099NecList](docs/A1099/V2/Form1099NecList.md) - - [Avalara.SDK.model.A1099.V2.Form1099NecListItem](docs/A1099/V2/Form1099NecListItem.md) - - [Avalara.SDK.model.A1099.V2.Form1099NecListItemResponse](docs/A1099/V2/Form1099NecListItemResponse.md) - - [Avalara.SDK.model.A1099.V2.Form1099NecRequest](docs/A1099/V2/Form1099NecRequest.md) - - [Avalara.SDK.model.A1099.V2.Form1099NecResponse](docs/A1099/V2/Form1099NecResponse.md) - - [Avalara.SDK.model.A1099.V2.Form1099ProccessResult](docs/A1099/V2/Form1099ProccessResult.md) - - [Avalara.SDK.model.A1099.V2.Form1099ProccessResultProcessedFormsInner](docs/A1099/V2/Form1099ProccessResultProcessedFormsInner.md) - [Avalara.SDK.model.A1099.V2.Form1099R](docs/A1099/V2/Form1099R.md) - - [Avalara.SDK.model.A1099.V2.Form1099RList](docs/A1099/V2/Form1099RList.md) - - [Avalara.SDK.model.A1099.V2.Form1099RListItem](docs/A1099/V2/Form1099RListItem.md) - - [Avalara.SDK.model.A1099.V2.Form1099RListItemResponse](docs/A1099/V2/Form1099RListItemResponse.md) - - [Avalara.SDK.model.A1099.V2.Form1099RRequest](docs/A1099/V2/Form1099RRequest.md) - - [Avalara.SDK.model.A1099.V2.Form1099RResponse](docs/A1099/V2/Form1099RResponse.md) - [Avalara.SDK.model.A1099.V2.Form1099StatusDetail](docs/A1099/V2/Form1099StatusDetail.md) - - [Avalara.SDK.model.A1099.V2.FormRequestBase](docs/A1099/V2/FormRequestBase.md) - - [Avalara.SDK.model.A1099.V2.FormRequestListItemBase](docs/A1099/V2/FormRequestListItemBase.md) - - [Avalara.SDK.model.A1099.V2.FormResponseBase](docs/A1099/V2/FormResponseBase.md) - - [Avalara.SDK.model.A1099.V2.FormSingleRequestBase](docs/A1099/V2/FormSingleRequestBase.md) - [Avalara.SDK.model.A1099.V2.Get1099Form200Response](docs/A1099/V2/Get1099Form200Response.md) - - [Avalara.SDK.model.A1099.V2.ICreateForm1099Request](docs/A1099/V2/ICreateForm1099Request.md) - - [Avalara.SDK.model.A1099.V2.IUpdateForm1099Request](docs/A1099/V2/IUpdateForm1099Request.md) - [Avalara.SDK.model.A1099.V2.IW9FormDataModelsOneOf](docs/A1099/V2/IW9FormDataModelsOneOf.md) - - [Avalara.SDK.model.A1099.V2.IncludedBase](docs/A1099/V2/IncludedBase.md) - [Avalara.SDK.model.A1099.V2.IntermediaryOrFlowThrough](docs/A1099/V2/IntermediaryOrFlowThrough.md) - - [Avalara.SDK.model.A1099.V2.IntermediaryOrFlowThroughRequest](docs/A1099/V2/IntermediaryOrFlowThroughRequest.md) - - [Avalara.SDK.model.A1099.V2.IntermediaryOrFlowThroughResponse](docs/A1099/V2/IntermediaryOrFlowThroughResponse.md) - [Avalara.SDK.model.A1099.V2.IrsResponse](docs/A1099/V2/IrsResponse.md) - [Avalara.SDK.model.A1099.V2.IssuerCommand](docs/A1099/V2/IssuerCommand.md) - [Avalara.SDK.model.A1099.V2.IssuerResponse](docs/A1099/V2/IssuerResponse.md) - - [Avalara.SDK.model.A1099.V2.JobResult](docs/A1099/V2/JobResult.md) - - [Avalara.SDK.model.A1099.V2.Link](docs/A1099/V2/Link.md) - - [Avalara.SDK.model.A1099.V2.OfferAndCoverageRequest](docs/A1099/V2/OfferAndCoverageRequest.md) + - [Avalara.SDK.model.A1099.V2.JobResponse](docs/A1099/V2/JobResponse.md) + - [Avalara.SDK.model.A1099.V2.OfferAndCoverage](docs/A1099/V2/OfferAndCoverage.md) - [Avalara.SDK.model.A1099.V2.PaginatedQueryResultModelCompanyResponse](docs/A1099/V2/PaginatedQueryResultModelCompanyResponse.md) + - [Avalara.SDK.model.A1099.V2.PaginatedQueryResultModelForm1099Base](docs/A1099/V2/PaginatedQueryResultModelForm1099Base.md) - [Avalara.SDK.model.A1099.V2.PaginatedQueryResultModelIssuerResponse](docs/A1099/V2/PaginatedQueryResultModelIssuerResponse.md) - [Avalara.SDK.model.A1099.V2.PaginatedQueryResultModelW9FormBaseResponse](docs/A1099/V2/PaginatedQueryResultModelW9FormBaseResponse.md) - [Avalara.SDK.model.A1099.V2.PrimaryWithholdingAgent](docs/A1099/V2/PrimaryWithholdingAgent.md) - - [Avalara.SDK.model.A1099.V2.PrimaryWithholdingAgentRequest](docs/A1099/V2/PrimaryWithholdingAgentRequest.md) - - [Avalara.SDK.model.A1099.V2.PrimaryWithholdingAgentResponse](docs/A1099/V2/PrimaryWithholdingAgentResponse.md) - [Avalara.SDK.model.A1099.V2.StateAndLocalWithholding](docs/A1099/V2/StateAndLocalWithholding.md) - - [Avalara.SDK.model.A1099.V2.StateAndLocalWithholdingRequest](docs/A1099/V2/StateAndLocalWithholdingRequest.md) - - [Avalara.SDK.model.A1099.V2.StateAndLocalWithholdingResponse](docs/A1099/V2/StateAndLocalWithholdingResponse.md) - [Avalara.SDK.model.A1099.V2.StateEfileStatusDetail](docs/A1099/V2/StateEfileStatusDetail.md) - - [Avalara.SDK.model.A1099.V2.StateEfileStatusDetailResponse](docs/A1099/V2/StateEfileStatusDetailResponse.md) - - [Avalara.SDK.model.A1099.V2.StatusDetail](docs/A1099/V2/StatusDetail.md) - [Avalara.SDK.model.A1099.V2.SubstantialUsOwnerRequest](docs/A1099/V2/SubstantialUsOwnerRequest.md) - [Avalara.SDK.model.A1099.V2.SubstantialUsOwnerResponse](docs/A1099/V2/SubstantialUsOwnerResponse.md) - [Avalara.SDK.model.A1099.V2.TinMatchStatusResponse](docs/A1099/V2/TinMatchStatusResponse.md) - - [Avalara.SDK.model.A1099.V2.Update1099Form200Response](docs/A1099/V2/Update1099Form200Response.md) - [Avalara.SDK.model.A1099.V2.ValidationError](docs/A1099/V2/ValidationError.md) - - [Avalara.SDK.model.A1099.V2.ValidationErrorResponse](docs/A1099/V2/ValidationErrorResponse.md) - [Avalara.SDK.model.A1099.V2.W4FormDataModel](docs/A1099/V2/W4FormDataModel.md) + - [Avalara.SDK.model.A1099.V2.W4FormMinimalRequest](docs/A1099/V2/W4FormMinimalRequest.md) - [Avalara.SDK.model.A1099.V2.W4FormRequest](docs/A1099/V2/W4FormRequest.md) - [Avalara.SDK.model.A1099.V2.W4FormResponse](docs/A1099/V2/W4FormResponse.md) + - [Avalara.SDK.model.A1099.V2.W8BenEFormMinimalRequest](docs/A1099/V2/W8BenEFormMinimalRequest.md) - [Avalara.SDK.model.A1099.V2.W8BenEFormRequest](docs/A1099/V2/W8BenEFormRequest.md) - [Avalara.SDK.model.A1099.V2.W8BenEFormResponse](docs/A1099/V2/W8BenEFormResponse.md) - [Avalara.SDK.model.A1099.V2.W8BenESubstantialUsOwnerDataModel](docs/A1099/V2/W8BenESubstantialUsOwnerDataModel.md) - [Avalara.SDK.model.A1099.V2.W8BenFormDataModel](docs/A1099/V2/W8BenFormDataModel.md) + - [Avalara.SDK.model.A1099.V2.W8BenFormMinimalRequest](docs/A1099/V2/W8BenFormMinimalRequest.md) - [Avalara.SDK.model.A1099.V2.W8BenFormRequest](docs/A1099/V2/W8BenFormRequest.md) - [Avalara.SDK.model.A1099.V2.W8BenFormResponse](docs/A1099/V2/W8BenFormResponse.md) - [Avalara.SDK.model.A1099.V2.W8BeneFormDataModel](docs/A1099/V2/W8BeneFormDataModel.md) - [Avalara.SDK.model.A1099.V2.W8ImyFormDataModel](docs/A1099/V2/W8ImyFormDataModel.md) + - [Avalara.SDK.model.A1099.V2.W8ImyFormMinimalRequest](docs/A1099/V2/W8ImyFormMinimalRequest.md) - [Avalara.SDK.model.A1099.V2.W8ImyFormRequest](docs/A1099/V2/W8ImyFormRequest.md) - [Avalara.SDK.model.A1099.V2.W8ImyFormResponse](docs/A1099/V2/W8ImyFormResponse.md) + - [Avalara.SDK.model.A1099.V2.W9FormBaseMinimalRequest](docs/A1099/V2/W9FormBaseMinimalRequest.md) - [Avalara.SDK.model.A1099.V2.W9FormBaseRequest](docs/A1099/V2/W9FormBaseRequest.md) - [Avalara.SDK.model.A1099.V2.W9FormBaseResponse](docs/A1099/V2/W9FormBaseResponse.md) - [Avalara.SDK.model.A1099.V2.W9FormDataModel](docs/A1099/V2/W9FormDataModel.md) + - [Avalara.SDK.model.A1099.V2.W9FormMinimalRequest](docs/A1099/V2/W9FormMinimalRequest.md) - [Avalara.SDK.model.A1099.V2.W9FormRequest](docs/A1099/V2/W9FormRequest.md) - [Avalara.SDK.model.A1099.V2.W9FormResponse](docs/A1099/V2/W9FormResponse.md) diff --git a/docs/A1099/V2/CompaniesW9Api.md b/docs/A1099/V2/CompaniesW9Api.md index 98eb85b..9c279c0 100644 --- a/docs/A1099/V2/CompaniesW9Api.md +++ b/docs/A1099/V2/CompaniesW9Api.md @@ -1,6 +1,6 @@ # CompaniesW9Api -All URIs are relative to *https://api-ava1099.eta.sbx.us-east-1.aws.avalara.io/avalara1099* +All URIs are relative to *https://api.sbx.avalara.com/avalara1099* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -14,7 +14,7 @@ Method | HTTP request | Description ## createCompany -> CompanyResponseModel createCompany(avalaraVersion, xCorrelationId, xAvalaraClient, companyCreateUpdateRequestModel) +> CompanyResponse createCompany(avalaraVersion, xCorrelationId, xAvalaraClient, createCompanyRequest) Create a company @@ -49,11 +49,11 @@ public class Example { CompaniesW9Api apiInstance = new CompaniesW9Api(apiClient); String avalaraVersion = "2.0.0"; // String | API version - String xCorrelationId = "5ba3a8b6-bf05-4aaa-b8cb-d06c7cfea0f7"; // String | Unique correlation Id in a GUID format + String xCorrelationId = "84a816ef-95df-4fb7-8d8a-95bc8a8d8fe9"; // String | Unique correlation Id in a GUID format String xAvalaraClient = "Swagger UI; 22.1.0"; // String | Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . - CompanyCreateUpdateRequestModel companyCreateUpdateRequestModel = new CompanyCreateUpdateRequestModel(); // CompanyCreateUpdateRequestModel | The company to create + CreateCompanyRequest createCompanyRequest = new CreateCompanyRequest(); // CreateCompanyRequest | The company to create try { - CompanyResponseModel result = apiInstance.createCompany(avalaraVersion, xCorrelationId, xAvalaraClient, companyCreateUpdateRequestModel); + CompanyResponse result = apiInstance.createCompany(avalaraVersion, xCorrelationId, xAvalaraClient, createCompanyRequest); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling CompaniesW9Api#createCompany"); @@ -74,11 +74,11 @@ Name | Type | Description | Notes **avalaraVersion** | **String**| API version | **xCorrelationId** | **String**| Unique correlation Id in a GUID format | [optional] **xAvalaraClient** | **String**| Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . | [optional] - **companyCreateUpdateRequestModel** | [**CompanyCreateUpdateRequestModel**](CompanyCreateUpdateRequestModel.md)| The company to create | [optional] + **createCompanyRequest** | [**CreateCompanyRequest**](CreateCompanyRequest.md)| The company to create | [optional] ### Return type -[**CompanyResponseModel**](CompanyResponseModel.md) +[**CompanyResponse**](CompanyResponse.md) ### Authorization @@ -136,7 +136,7 @@ public class Example { CompaniesW9Api apiInstance = new CompaniesW9Api(apiClient); String id = "id_example"; // String | The company to delete String avalaraVersion = "2.0.0"; // String | API version - String xCorrelationId = "07a8ecdb-0465-469d-8bff-49fce135d5e4"; // String | Unique correlation Id in a GUID format + String xCorrelationId = "22a14d95-22c8-4e2d-a6f9-a60235ff2fb6"; // String | Unique correlation Id in a GUID format String xAvalaraClient = "Swagger UI; 22.1.0"; // String | Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . try { apiInstance.deleteCompany(id, avalaraVersion, xCorrelationId, xAvalaraClient); @@ -228,7 +228,7 @@ public class Example { String $orderBy = "$orderBy_example"; // String | A comma separated list of sort statements in the format (fieldname) [ASC|DESC], for example id ASC. Boolean count = true; // Boolean | If true, return the global count of elements in the collection. Boolean countOnly = true; // Boolean | If true, return ONLY the global count of elements in the collection. It only applies when count=true. - String xCorrelationId = "f047fdc5-a6e4-4290-8c5c-d4da96ad0699"; // String | Unique correlation Id in a GUID format + String xCorrelationId = "b20f7fbd-d0ac-4f59-a75d-ca2afa4b1e91"; // String | Unique correlation Id in a GUID format String xAvalaraClient = "Swagger UI; 22.1.0"; // String | Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . try { PaginatedQueryResultModelCompanyResponse result = apiInstance.getCompanies(avalaraVersion, $filter, $top, $skip, $orderBy, count, countOnly, xCorrelationId, xAvalaraClient); @@ -321,7 +321,7 @@ public class Example { CompaniesW9Api apiInstance = new CompaniesW9Api(apiClient); String id = "id_example"; // String | Id of the company String avalaraVersion = "2.0.0"; // String | API version - String xCorrelationId = "3f7b5971-06e7-4459-84af-61db7fdcb027"; // String | Unique correlation Id in a GUID format + String xCorrelationId = "06bf1c2a-d8be-473a-9d6d-a5100b9d7402"; // String | Unique correlation Id in a GUID format String xAvalaraClient = "Swagger UI; 22.1.0"; // String | Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . try { CompanyResponse result = apiInstance.getCompany(id, avalaraVersion, xCorrelationId, xAvalaraClient); @@ -373,7 +373,7 @@ Name | Type | Description | Notes ## updateCompany -> CompanyResponseModel updateCompany(id, avalaraVersion, xCorrelationId, xAvalaraClient, companyCreateUpdateRequestModel) +> CompanyResponse updateCompany(id, avalaraVersion, xCorrelationId, xAvalaraClient, createCompanyRequest) Update a company @@ -409,11 +409,11 @@ public class Example { CompaniesW9Api apiInstance = new CompaniesW9Api(apiClient); String id = "id_example"; // String | The ID of the company to update String avalaraVersion = "2.0.0"; // String | API version - String xCorrelationId = "1cd32062-b0bc-46a0-8311-a973b8fb3d56"; // String | Unique correlation Id in a GUID format + String xCorrelationId = "b3aa843f-04a8-48cf-9a55-08fd136a6e0c"; // String | Unique correlation Id in a GUID format String xAvalaraClient = "Swagger UI; 22.1.0"; // String | Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . - CompanyCreateUpdateRequestModel companyCreateUpdateRequestModel = new CompanyCreateUpdateRequestModel(); // CompanyCreateUpdateRequestModel | The updated company data + CreateCompanyRequest createCompanyRequest = new CreateCompanyRequest(); // CreateCompanyRequest | The updated company data try { - CompanyResponseModel result = apiInstance.updateCompany(id, avalaraVersion, xCorrelationId, xAvalaraClient, companyCreateUpdateRequestModel); + CompanyResponse result = apiInstance.updateCompany(id, avalaraVersion, xCorrelationId, xAvalaraClient, createCompanyRequest); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling CompaniesW9Api#updateCompany"); @@ -435,11 +435,11 @@ Name | Type | Description | Notes **avalaraVersion** | **String**| API version | **xCorrelationId** | **String**| Unique correlation Id in a GUID format | [optional] **xAvalaraClient** | **String**| Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . | [optional] - **companyCreateUpdateRequestModel** | [**CompanyCreateUpdateRequestModel**](CompanyCreateUpdateRequestModel.md)| The updated company data | [optional] + **createCompanyRequest** | [**CreateCompanyRequest**](CreateCompanyRequest.md)| The updated company data | [optional] ### Return type -[**CompanyResponseModel**](CompanyResponseModel.md) +[**CompanyResponse**](CompanyResponse.md) ### Authorization diff --git a/docs/A1099/V2/CompanyCreateUpdateRequestModel.md b/docs/A1099/V2/CompanyCreateUpdateRequestModel.md index 79f0ee5..350d5e5 100644 --- a/docs/A1099/V2/CompanyCreateUpdateRequestModel.md +++ b/docs/A1099/V2/CompanyCreateUpdateRequestModel.md @@ -7,23 +7,23 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**name** | **String** | | [optional] | -|**email** | **String** | | [optional] | -|**address** | **String** | | [optional] | -|**city** | **String** | | [optional] | -|**state** | **String** | | [optional] | -|**zip** | **String** | | [optional] | -|**telephone** | **String** | | [optional] | -|**tin** | **String** | | [optional] | -|**dbaName** | **String** | | [optional] | -|**referenceId** | **String** | | [optional] | -|**doTinMatch** | **Boolean** | | [optional] | -|**groupName** | **String** | | [optional] | -|**foreignProvince** | **String** | | [optional] | -|**countryCode** | **String** | | [optional] | -|**resendRequests** | **Boolean** | | [optional] | -|**resendIntervalDays** | **Integer** | | [optional] | -|**maxReminderAttempts** | **Integer** | | [optional] | +|**name** | **String** | Legal name. Not the DBA name. | | +|**dbaName** | **String** | Doing Business As (DBA) name or continuation of a long legal name. | [optional] | +|**email** | **String** | Contact email address. For inquiries by vendors/employees. | | +|**address** | **String** | Address. | | +|**city** | **String** | City. | | +|**state** | **String** | Two-letter US state or Canadian province code (required for US/CA addresses). | [optional] | +|**zip** | **String** | ZIP/postal code. | | +|**telephone** | **String** | Contact phone number (must contain at least 10 digits, max 15 characters). | | +|**tin** | **String** | Federal Tax Identification Number (TIN). EIN/Tax ID (required for US companies). | | +|**referenceId** | **String** | Internal reference ID. Never shown to any agency or recipient. | [optional] | +|**doTinMatch** | **Boolean** | Indicates whether the company authorizes IRS TIN matching. | [optional] | +|**groupName** | **String** | Group name for organizing companies (creates or finds group by name). | [optional] | +|**foreignProvince** | **String** | Province or region for non-US/CA addresses. | [optional] | +|**countryCode** | **String** | Two-letter IRS country code (e.g., 'US', 'CA'), as defined at https://www.irs.gov/e-file-providers/country-codes. | | +|**resendRequests** | **Boolean** | Boolean to enable automatic reminder emails (default: false). | [optional] | +|**resendIntervalDays** | **Integer** | Days between reminder emails (7-365, required if resendRequests is true). | [optional] | +|**maxReminderAttempts** | **Integer** | Maximum number of reminder attempts (1-52, required if resendRequests is true). | [optional] | diff --git a/docs/A1099/V2/CompanyResponse.md b/docs/A1099/V2/CompanyResponse.md index 6ddeb6d..ea3cd1c 100644 --- a/docs/A1099/V2/CompanyResponse.md +++ b/docs/A1099/V2/CompanyResponse.md @@ -7,26 +7,26 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**id** | **String** | | [optional] | -|**referenceId** | **String** | | [optional] | -|**groupName** | **String** | | [optional] | -|**name** | **String** | | [optional] | -|**dbaName** | **String** | | [optional] | -|**address** | **String** | | [optional] | -|**city** | **String** | | [optional] | -|**state** | **String** | | [optional] | -|**foreignProvince** | **String** | | [optional] | -|**zip** | **String** | | [optional] | -|**countryCode** | **String** | | [optional] | -|**email** | **String** | | [optional] | -|**telephone** | **String** | | [optional] | -|**tin** | **String** | | [optional] | -|**doTinMatch** | **Boolean** | | [optional] | -|**resendRequests** | **Boolean** | | [optional] | -|**resendIntervalDays** | **Integer** | | [optional] | -|**maxReminderAttempts** | **Integer** | | [optional] | -|**createdAt** | **OffsetDateTime** | | [optional] | -|**updatedAt** | **OffsetDateTime** | | [optional] | +|**id** | **String** | Unique identifier set when the record is created. | [optional] | +|**createdAt** | **OffsetDateTime** | Date time when the record was created. | [optional] | +|**updatedAt** | **OffsetDateTime** | Date time when the record was last updated. | [optional] | +|**name** | **String** | Legal name. Not the DBA name. | | +|**dbaName** | **String** | Doing Business As (DBA) name or continuation of a long legal name. | [optional] | +|**email** | **String** | Contact email address. For inquiries by vendors/employees. | | +|**address** | **String** | Address. | | +|**city** | **String** | City. | | +|**state** | **String** | Two-letter US state or Canadian province code (required for US/CA addresses). | [optional] | +|**zip** | **String** | ZIP/postal code. | | +|**telephone** | **String** | Contact phone number (must contain at least 10 digits, max 15 characters). | | +|**tin** | **String** | Federal Tax Identification Number (TIN). EIN/Tax ID (required for US companies). | | +|**referenceId** | **String** | Internal reference ID. Never shown to any agency or recipient. | [optional] | +|**doTinMatch** | **Boolean** | Indicates whether the company authorizes IRS TIN matching. | [optional] | +|**groupName** | **String** | Group name for organizing companies (creates or finds group by name). | [optional] | +|**foreignProvince** | **String** | Province or region for non-US/CA addresses. | [optional] | +|**countryCode** | **String** | Two-letter IRS country code (e.g., 'US', 'CA'), as defined at https://www.irs.gov/e-file-providers/country-codes. | | +|**resendRequests** | **Boolean** | Boolean to enable automatic reminder emails (default: false). | [optional] | +|**resendIntervalDays** | **Integer** | Days between reminder emails (7-365, required if resendRequests is true). | [optional] | +|**maxReminderAttempts** | **Integer** | Maximum number of reminder attempts (1-52, required if resendRequests is true). | [optional] | diff --git a/docs/A1099/V2/CoveredIndividual.md b/docs/A1099/V2/CoveredIndividual.md new file mode 100644 index 0000000..5f5ba3d --- /dev/null +++ b/docs/A1099/V2/CoveredIndividual.md @@ -0,0 +1,33 @@ + + +# CoveredIndividual + +Covered individual information for health coverage forms + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | Covered individual's ID | [optional] [readonly] | +|**firstName** | **String** | Covered individual's first name | | +|**middleName** | **String** | Covered individual's middle name | [optional] | +|**lastName** | **String** | Covered individual's last name | | +|**nameSuffix** | **String** | Covered individual's name suffix | [optional] | +|**tin** | **String** | Covered individual's Federal Tax Identification Number (TIN).. SSN or ITIN. Required unless unavailable. | [optional] | +|**birthDate** | **LocalDate** | Covered individual's date of birth - Required when SSN is missing. | [optional] | +|**coveredAllMonths** | **Boolean** | Coverage indicator for all 12 months | [optional] | +|**coveredJanuary** | **Boolean** | Coverage indicator for January | [optional] | +|**coveredFebruary** | **Boolean** | Coverage indicator for February | [optional] | +|**coveredMarch** | **Boolean** | Coverage indicator for March | [optional] | +|**coveredApril** | **Boolean** | Coverage indicator for April | [optional] | +|**coveredMay** | **Boolean** | Coverage indicator for May | [optional] | +|**coveredJune** | **Boolean** | Coverage indicator for June | [optional] | +|**coveredJuly** | **Boolean** | Coverage indicator for July | [optional] | +|**coveredAugust** | **Boolean** | Coverage indicator for August | [optional] | +|**coveredSeptember** | **Boolean** | Coverage indicator for September | [optional] | +|**coveredOctober** | **Boolean** | Coverage indicator for October | [optional] | +|**coveredNovember** | **Boolean** | Coverage indicator for November | [optional] | +|**coveredDecember** | **Boolean** | Coverage indicator for December | [optional] | + + + diff --git a/docs/A1099/V2/CreateAndSendW9FormEmailRequest.md b/docs/A1099/V2/CreateAndSendW9FormEmailRequest.md new file mode 100644 index 0000000..2a24073 --- /dev/null +++ b/docs/A1099/V2/CreateAndSendW9FormEmailRequest.md @@ -0,0 +1,34 @@ + + +# CreateAndSendW9FormEmailRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | [**TypeEnum**](#TypeEnum) | The form type. | [optional] [readonly] | +|**email** | **String** | The email address of the individual associated with the form. | | +|**employeeFirstName** | **String** | The first name of the employee. | | +|**employeeLastName** | **String** | The last name of the employee. | | +|**officeCode** | **String** | The office code associated with the form. | [optional] | +|**companyId** | **String** | The ID of the associated company. | | +|**referenceId** | **String** | A reference identifier for the form. | [optional] | +|**name** | **String** | The name of the individual or entity associated with the form. | | +|**referenceNumber** | **String** | A reference number for the form. | [optional] | +|**accountNumber** | **String** | The account number associated with the form. | [optional] | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| W4 | "W4" | +| W8_BEN | "W8Ben" | +| W8_BEN_E | "W8BenE" | +| W8_IMY | "W8Imy" | +| W9 | "W9" | + + + diff --git a/docs/A1099/V2/CreateCompanyRequest.md b/docs/A1099/V2/CreateCompanyRequest.md new file mode 100644 index 0000000..31d2f82 --- /dev/null +++ b/docs/A1099/V2/CreateCompanyRequest.md @@ -0,0 +1,32 @@ + + +# CreateCompanyRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | Legal name. Not the DBA name. | | +|**dbaName** | **String** | Doing Business As (DBA) name or continuation of a long legal name. | [optional] | +|**email** | **String** | Contact email address. For inquiries by vendors/employees. | | +|**address** | **String** | Address. | | +|**city** | **String** | City. | | +|**state** | **String** | Two-letter US state or Canadian province code (required for US/CA addresses). | [optional] | +|**zip** | **String** | ZIP/postal code. | | +|**telephone** | **String** | Contact phone number (must contain at least 10 digits, max 15 characters). | | +|**tin** | **String** | Federal Tax Identification Number (TIN). EIN/Tax ID (required for US companies). | | +|**referenceId** | **String** | Internal reference ID. Never shown to any agency or recipient. | [optional] | +|**doTinMatch** | **Boolean** | Indicates whether the company authorizes IRS TIN matching. | [optional] | +|**groupName** | **String** | Group name for organizing companies (creates or finds group by name). | [optional] | +|**foreignProvince** | **String** | Province or region for non-US/CA addresses. | [optional] | +|**countryCode** | **String** | Two-letter IRS country code (e.g., 'US', 'CA'), as defined at https://www.irs.gov/e-file-providers/country-codes. | | +|**resendRequests** | **Boolean** | Boolean to enable automatic reminder emails (default: false). | [optional] | +|**resendIntervalDays** | **Integer** | Days between reminder emails (7-365, required if resendRequests is true). | [optional] | +|**maxReminderAttempts** | **Integer** | Maximum number of reminder attempts (1-52, required if resendRequests is true). | [optional] | +|**id** | **String** | Unique identifier set when the record is created. | [optional] | +|**createdAt** | **OffsetDateTime** | Date time when the record was created. | [optional] | +|**updatedAt** | **OffsetDateTime** | Date time when the record was last updated. | [optional] | + + + diff --git a/docs/A1099/V2/CreateIssuerRequest.md b/docs/A1099/V2/CreateIssuerRequest.md new file mode 100644 index 0000000..2d817f9 --- /dev/null +++ b/docs/A1099/V2/CreateIssuerRequest.md @@ -0,0 +1,30 @@ + + +# CreateIssuerRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | Legal name. Not the DBA name. | | +|**dbaName** | **String** | Doing Business As (DBA) name or continuation of a long legal name. Use either this or 'transferAgentName'. | [optional] | +|**tin** | **String** | Federal Tax Identification Number (TIN). | [optional] | +|**referenceId** | **String** | Internal reference ID. Never shown to any agency or recipient. If present, it will prefix download filenames. Allowed characters: letters, numbers, dashes, underscores, and spaces. | [optional] | +|**telephone** | **String** | Contact phone number (must contain at least 10 digits, max 15 characters). For recipient inquiries. | | +|**taxYear** | **Integer** | Tax year for which the forms are being filed (e.g., 2024). Must be within current tax year and current tax year - 4. | | +|**countryCode** | **String** | Two-letter IRS country code (e.g., 'US', 'CA'), as defined at https://www.irs.gov/e-file-providers/country-codes. If there is a transfer agent, use the transfer agent's shipping address. | [optional] | +|**email** | **String** | Contact email address. For recipient inquiries. | | +|**address** | **String** | Address. | | +|**city** | **String** | City. | | +|**state** | **String** | Two-letter US state or Canadian province code (required for US/CA addresses). | | +|**zip** | **String** | ZIP/postal code. | | +|**foreignProvince** | **String** | Province or region for non-US/CA addresses. | [optional] | +|**transferAgentName** | **String** | Name of the transfer agent, if applicable — optional; use either this or 'dbaName'. | [optional] | +|**lastFiling** | **Boolean** | Indicates if this is the issuer's final year filing. | | +|**id** | **String** | Unique identifier set when the record is created. | [optional] | +|**createdAt** | **OffsetDateTime** | Date time when the record was created. | [optional] | +|**updatedAt** | **OffsetDateTime** | Date time when the record was last updated. | [optional] | + + + diff --git a/docs/A1099/V2/CreateW9Form201Response.md b/docs/A1099/V2/CreateW9Form201Response.md index 42fad9b..a7c5ff9 100644 --- a/docs/A1099/V2/CreateW9Form201Response.md +++ b/docs/A1099/V2/CreateW9Form201Response.md @@ -104,13 +104,13 @@ |**signerName** | **String** | The name of the signer. | [optional] | |**capacityToSignCertification** | **Boolean** | Certifies signer has the capacity to sign for the beneficial owner. | [optional] | |**id** | **String** | The unique identifier for the form. | [optional] | -|**entryStatus** | **String** | The form status. | [optional] | -|**entryStatusDate** | **OffsetDateTime** | The timestamp for the latest status update. | [optional] | +|**entryStatus** | [**EntryStatusResponse**](EntryStatusResponse.md) | The entry status information for the form. | [optional] | |**referenceId** | **String** | A reference identifier for the form. | [optional] | |**companyId** | **String** | The ID of the associated company. | [optional] | |**displayName** | **String** | The display name associated with the form. | [optional] | |**email** | **String** | The email address of the individual associated with the form. | [optional] | |**archived** | **Boolean** | Indicates whether the form is archived. | [optional] | +|**ancestorId** | **String** | Form ID of previous version. | [optional] | |**signature** | **String** | The signature of the form. | [optional] | |**signedDate** | **OffsetDateTime** | The date the form was signed. | [optional] | |**eDeliveryConsentedAt** | **OffsetDateTime** | The date when e-delivery was consented. | [optional] | diff --git a/docs/A1099/V2/CreateW9FormRequest.md b/docs/A1099/V2/CreateW9FormRequest.md index 740cb7a..c1b7278 100644 --- a/docs/A1099/V2/CreateW9FormRequest.md +++ b/docs/A1099/V2/CreateW9FormRequest.md @@ -26,11 +26,11 @@ |**tin** | **String** | The taxpayer identification number (TIN). | [optional] | |**backupWithholding** | **Boolean** | Indicates whether backup withholding applies. | [optional] | |**is1099able** | **Boolean** | Indicates whether the individual or entity should be issued a 1099 form. | [optional] | -|**companyId** | **String** | The ID of the associated company. | [optional] | -|**referenceId** | **String** | A reference identifier for the form. | [optional] | -|**email** | **String** | The email address of the individual associated with the form. | [optional] | |**eDeliveryConsentedAt** | **OffsetDateTime** | The date when e-delivery was consented. | [optional] | |**signature** | **String** | The signature of the form. | [optional] | +|**companyId** | **String** | The ID of the associated company. | | +|**referenceId** | **String** | A reference identifier for the form. | [optional] | +|**email** | **String** | The email address of the individual associated with the form. | [optional] | |**citizenshipCountry** | **String** | The country of citizenship. | [optional] | |**disregardedEntity** | **String** | The name of the disregarded entity receiving the payment (if applicable). | [optional] | |**entityType** | **String** | The entity type. | [optional] | diff --git a/docs/A1099/V2/EntryStatusResponse.md b/docs/A1099/V2/EntryStatusResponse.md new file mode 100644 index 0000000..cc88518 --- /dev/null +++ b/docs/A1099/V2/EntryStatusResponse.md @@ -0,0 +1,15 @@ + + +# EntryStatusResponse + +Represents the entry status information for a W9 form. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**status** | **String** | The form status. | [optional] | +|**time** | **OffsetDateTime** | The timestamp for the latest status update. | [optional] | + + + diff --git a/docs/A1099/V2/Form1042S.md b/docs/A1099/V2/Form1042S.md index be036df..666b1c8 100644 --- a/docs/A1099/V2/Form1042S.md +++ b/docs/A1099/V2/Form1042S.md @@ -2,73 +2,360 @@ # Form1042S +Form 1042-S: Foreign Person's U.S. Source Income Subject to Withholding ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**uniqueFormId** | **String** | | [optional] | -|**recipientDateOfBirth** | **OffsetDateTime** | | [optional] | -|**recipientGiin** | **String** | | [optional] | -|**recipientForeignTin** | **String** | | [optional] | -|**lobCode** | **String** | | [optional] | -|**incomeCode** | **String** | | [optional] | -|**grossIncome** | **Double** | | [optional] | -|**withholdingIndicator** | **String** | | [optional] | -|**taxCountryCode** | **String** | | [optional] | -|**exemptionCodeChap3** | **String** | | [optional] | -|**exemptionCodeChap4** | **String** | | [optional] | -|**taxRateChap3** | **String** | | [optional] | -|**withholdingAllowance** | **Double** | | [optional] | -|**federalTaxWithheld** | **Double** | | [optional] | -|**taxNotDepositedIndicator** | **Boolean** | | [optional] | -|**academicIndicator** | **Boolean** | | [optional] | -|**taxWithheldOtherAgents** | **Double** | | [optional] | -|**amountRepaid** | **Double** | | [optional] | -|**taxPaidAgent** | **Double** | | [optional] | -|**chap3StatusCode** | **String** | | [optional] | -|**chap4StatusCode** | **String** | | [optional] | -|**primaryWithholdingAgent** | [**PrimaryWithholdingAgent**](PrimaryWithholdingAgent.md) | | [optional] | -|**intermediaryOrFlowThrough** | [**IntermediaryOrFlowThrough**](IntermediaryOrFlowThrough.md) | | [optional] | -|**id** | **String** | | [optional] | -|**type** | **String** | | [optional] | -|**issuerId** | **Integer** | | [optional] | -|**issuerReferenceId** | **String** | | [optional] | -|**issuerTin** | **String** | | [optional] | -|**taxYear** | **Integer** | | [optional] | -|**federalEfile** | **Boolean** | | [optional] | -|**federalEfileStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**stateEfile** | **Boolean** | | [optional] | -|**stateEfileStatus** | [**List<StateEfileStatusDetail>**](StateEfileStatusDetail.md) | | [optional] | -|**postalMail** | **Boolean** | | [optional] | -|**postalMailStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**tinMatch** | **Boolean** | | [optional] | -|**tinMatchStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**addressVerification** | **Boolean** | | [optional] | -|**addressVerificationStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**eDeliveryStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**referenceId** | **String** | | [optional] | -|**email** | **String** | | [optional] | -|**tinType** | **String** | | [optional] | -|**fatcaFilingRequirement** | **Boolean** | | [optional] | -|**tin** | **String** | | [optional] | -|**noTin** | **Boolean** | | [optional] | -|**secondTinNotice** | **Boolean** | | [optional] | -|**recipientName** | **String** | | [optional] | -|**recipientSecondName** | **String** | | [optional] | -|**address** | **String** | | [optional] | -|**address2** | **String** | | [optional] | -|**city** | **String** | | [optional] | -|**state** | **String** | | [optional] | -|**zip** | **String** | | [optional] | -|**nonUsProvince** | **String** | | [optional] | -|**countryCode** | **String** | | [optional] | -|**accountNumber** | **String** | | [optional] | -|**officeCode** | **String** | | [optional] | -|**validationErrors** | [**List<ValidationError>**](ValidationError.md) | | [optional] | -|**createdAt** | **OffsetDateTime** | | [optional] | -|**updatedAt** | **OffsetDateTime** | | [optional] | -|**stateAndLocalWithholding** | [**StateAndLocalWithholding**](StateAndLocalWithholding.md) | | [optional] | +|**tinType** | [**TinTypeEnum**](#TinTypeEnum) | | [optional] [readonly] | +|**uniqueFormId** | **String** | Unique form identifier | | +|**recipientDateOfBirth** | **LocalDate** | Recipient's date of birth | [optional] | +|**recipientGiin** | **String** | Recipient's Global Intermediary Identification Number (GIIN). A valid GIIN looks like 'XXXXXX.XXXXX.XX.XXX'. | [optional] | +|**recipientForeignTin** | **String** | Recipient's foreign TIN. Required if email is specified, must fill either this or Chap3StatusCode. | [optional] | +|**lobCode** | [**LobCodeEnum**](#LobCodeEnum) | Limitation on Benefits (LOB) code for tax treaty purposes. Available values: - 01: Individual (Deprecated - valid only for tax years prior to 2019) - 02: Government - contracting state/political subdivision/local authority - 03: Tax exempt pension trust/Pension fund - 04: Tax exempt/Charitable organization - 05: Publicly-traded corporation - 06: Subsidiary of publicly-traded corporation - 07: Company that meets the ownership and base erosion test - 08: Company that meets the derivative benefits test - 09: Company with an item of income that meets the active trade or business test - 10: Discretionary determination - 11: Other - 12: No LOB article in treaty | [optional] | +|**incomeCode** | [**IncomeCodeEnum**](#IncomeCodeEnum) | Income code. Available values: Interest: - 01: Interest paid by US obligors - general - 02: Interest paid on real property mortgages - 03: Interest paid to controlling foreign corporations - 04: Interest paid by foreign corporations - 05: Interest on tax-free covenant bonds - 22: Interest paid on deposit with a foreign branch of a domestic corporation or partnership - 29: Deposit interest - 30: Original issue discount (OID) - 31: Short-term OID - 33: Substitute payment - interest - 51: Interest paid on certain actively traded or publicly offered securities(1) - 54: Substitute payments - interest from certain actively traded or publicly offered securities(1) Dividend: - 06: Dividends paid by U.S. corporations - general - 07: Dividends qualifying for direct dividend rate - 08: Dividends paid by foreign corporations - 34: Substitute payment - dividends - 40: Other dividend equivalents under IRC section 871(m) (formerly 871(l)) - 52: Dividends paid on certain actively traded or publicly offered securities(1) - 53: Substitute payments - dividends from certain actively traded or publicly offered securities(1) - 56: Dividend equivalents under IRC section 871(m) as a result of applying the combined transaction rules Other: - 09: Capital gains - 10: Industrial royalties - 11: Motion picture or television copyright royalties - 12: Other royalties (for example, copyright, software, broadcasting, endorsement payments) - 13: Royalties paid on certain publicly offered securities(1) - 14: Real property income and natural resources royalties - 15: Pensions, annuities, alimony, and/or insurance premiums - 16: Scholarship or fellowship grants - 17: Compensation for independent personal services(2) - 18: Compensation for dependent personal services(2) - 19: Compensation for teaching(2) - 20: Compensation during studying and training(2) - 23: Other income - 24: Qualified investment entity (QIE) distributions of capital gains - 25: Trust distributions subject to IRC section 1445 - 26: Unsevered growing crops and timber distributions by a trust subject to IRC section 1445 - 27: Publicly traded partnership distributions subject to IRC section 1446 - 28: Gambling winnings(3) - 32: Notional principal contract income(4) - 35: Substitute payment - other - 36: Capital gains distributions - 37: Return of capital - 38: Eligible deferred compensation items subject to IRC section 877A(d)(1) - 39: Distributions from a nongrantor trust subject to IRC section 877A(f)(1) - 41: Guarantee of indebtedness - 42: Earnings as an artist or athlete - no central withholding agreement(5) - 43: Earnings as an artist or athlete - central withholding agreement(5) - 44: Specified Federal procurement payments - 50: Income previously reported under escrow procedure(6) - 55: Taxable death benefits on life insurance contracts - 57: Amount realized under IRC section 1446(f) - 58: Publicly traded partnership distributions-undetermined | | +|**grossIncome** | **Double** | Gross income | | +|**withholdingIndicator** | [**WithholdingIndicatorEnum**](#WithholdingIndicatorEnum) | Withholding indicator Available values: - 3: Chapter 3 - 4: Chapter 4 | | +|**taxCountryCode** | **String** | Country code | | +|**exemptionCodeChap3** | [**ExemptionCodeChap3Enum**](#ExemptionCodeChap3Enum) | Exemption code (Chapter 3). Required if WithholdingIndicator is 3 (Chapter 3). Required when using TaxRateChap3. Available values: - Empty: Tax rate is due to backup withholding - 00: Not exempt - 01: Effectively connected income - 02: Exempt under IRC (other than portfolio interest) - 03: Income is not from US sources - 04: Exempt under tax treaty - 05: Portfolio interest exempt under IRC - 06: QI that assumes primary withholding responsibility - 07: WFP or WFT - 08: U.S. branch treated as U.S. Person - 09: Territory FI treated as U.S. Person - 10: QI represents that income is exempt - 11: QSL that assumes primary withholding responsibility - 12: Payee subjected to chapter 4 withholding - 22: QDD that assumes primary withholding responsibility - 23: Exempt under section 897(l) - 24: Exempt under section 892 | [optional] | +|**exemptionCodeChap4** | [**ExemptionCodeChap4Enum**](#ExemptionCodeChap4Enum) | Exemption code (Chapter 4). Required if WithholdingIndicator is 4 (Chapter 4). Available values: - 00: Not exempt - 13: Grandfathered payment - 14: Effectively connected income - 15: Payee not subject to chapter 4 withholding - 16: Excluded nonfinancial payment - 17: Foreign Entity that assumes primary withholding responsibility - 18: U.S. Payees - of participating FFI or registered deemed - compliant FFI - 19: Exempt from withholding under IGA(6) - 20: Dormant account(7) - 21: Other - payment not subject to chapter 4 withholding | [optional] | +|**taxRateChap3** | [**TaxRateChap3Enum**](#TaxRateChap3Enum) | Tax rate (Chapter 3) - Required if WithholdingIndicator is 3 (Chapter 3). Available values: - 00.00: 0.00% - 02.00: 2.00% - 04.00: 4.00% - 04.90: 4.90% - 04.95: 4.95% - 05.00: 5.00% - 07.00: 7.00% - 08.00: 8.00% - 10.00: 10.00% - 12.00: 12.00% - 12.50: 12.50% - 14.00: 14.00% - 15.00: 15.00% - 17.50: 17.50% - 20.00: 20.00% - 21.00: 21.00% - 24.00: 24.00% - 25.00: 25.00% - 27.50: 27.50% - 28.00: 28.00% - 30.00: 30.00% - 37.00: 37.00% | [optional] | +|**withholdingAllowance** | **Double** | Withholding allowance | [optional] | +|**federalTaxWithheld** | **Double** | Federal tax withheld | [optional] | +|**taxNotDepositedIndicator** | **Boolean** | Tax not deposited indicator | [optional] | +|**academicIndicator** | **Boolean** | Academic indicator | [optional] | +|**taxWithheldOtherAgents** | **Double** | Tax withheld by other agents | [optional] | +|**amountRepaid** | **Double** | Amount repaid to recipient | [optional] | +|**taxPaidAgent** | **Double** | Tax paid by withholding agent | [optional] | +|**chap3StatusCode** | [**Chap3StatusCodeEnum**](#Chap3StatusCodeEnum) | Chapter 3 status code - Required if WithholdingIndicator is 3 (Chapter 3) Available values: - 01: U.S. Withholding Agent - FI (Deprecated - valid only for tax years prior to 2020) - 02: U.S. Withholding Agent - Other (Deprecated - valid only for tax years prior to 2020) - 03: Territory FI - treated as U.S. Person - 04: Territory FI - not treated as U.S. Person - 05: U.S. branch - treated as U.S. Person - 06: U.S. branch - not treated as U.S. Person - 07: U.S. branch - ECI presumption applied - 08: Partnership other than Withholding Foreign Partnership - 09: Withholding Foreign Partnership - 10: Trust other than Withholding Foreign Trust - 11: Withholding Foreign Trust - 12: Qualified Intermediary - 13: Qualified Securities Lender - Qualified Intermediary - 14: Qualified Securities Lender - Other - 15: Corporation - 16: Individual - 17: Estate - 18: Private Foundation - 19: Government or International Organization - 20: Tax Exempt Organization (Section 501(c) entities) - 21: Unknown Recipient - 22: Artist or Athlete - 23: Pension - 24: Foreign Central Bank of Issue - 25: Nonqualified Intermediary - 26: Hybrid entity making Treaty Claim - 27: Withholding Rate Pool - General - 28: Withholding Rate Pool - Exempt Organization - 29: PAI Withholding Rate Pool - General - 30: PAI Withholding Rate Pool - Exempt Organization - 31: Agency Withholding Rate Pool - General - 32: Agency Withholding Rate Pool - Exempt Organization - 34: U.S. Withholding Agent-Foreign branch of FI (Deprecated - valid only for tax years prior to 2020) - 35: Qualified Derivatives Dealer - 36: Foreign Government - Integral Part - 37: Foreign Government - Controlled Entity - 38: Publicly Traded Partnership - 39: Disclosing Qualified Intermediary | [optional] | +|**chap4StatusCode** | [**Chap4StatusCodeEnum**](#Chap4StatusCodeEnum) | Chapter 4 status code. Required if WithholdingIndicator is 4 (Chapter 4). Required if email is specified, must fill either this or RecipientForeignTin. Available values: - 01: U.S. Withholding Agent - FI - 02: U.S. Withholding Agent - Other - 03: Territory FI - not treated as U.S. Person - 04: Territory FI - treated as U.S. Person - 05: Participating FFI - Other - 06: Participating FFI - Reporting Model 2 FFI - 07: Registered Deemed - Compliant FFI-Reporting Model 1 FFI - 08: Registered Deemed - Compliant FFI-Sponsored Entity - 09: Registered Deemed - Compliant FFI-Other - 10: Certified Deemed - Compliant FFI-Other - 11: Certified Deemed - Compliant FFI-FFI with Low Value Accounts - 12: Certified Deemed - Compliant FFI-Non-Registering Local Bank - 13: Certified Deemed - Compliant FFI-Sponsored Entity - 14: Certified Deemed - Compliant FFI-Investment Advisor or Investment Manager - 15: Nonparticipating FFI - 16: Owner-Documented FFI - 17: U.S. Branch - treated as U.S. person - 18: U.S. Branch - not treated as U.S. person (reporting under section 1471) - 19: Passive NFFE identifying Substantial U.S. Owners - 20: Passive NFFE with no Substantial U.S. Owners - 21: Publicly Traded NFFE or Affiliate of Publicly Traded NFFE - 22: Active NFFE - 23: Individual - 24: Section 501(c) Entities - 25: Excepted Territory NFFE - 26: Excepted NFFE - Other - 27: Exempt Beneficial Owner - 28: Entity Wholly Owned by Exempt Beneficial Owners - 29: Unknown Recipient - 30: Recalcitrant Account Holder - 31: Nonreporting IGA FFI - 32: Direct reporting NFFE - 33: U.S. reportable account - 34: Non-consenting U.S. account - 35: Sponsored direct reporting NFFE - 36: Excepted Inter-affiliate FFI - 37: Undocumented Preexisting Obligation - 38: U.S. Branch - ECI presumption applied - 39: Account Holder of Excluded Financial Account - 40: Passive NFFE reported by FFI - 41: NFFE subject to 1472 withholding - 42: Recalcitrant Pool - No U.S. Indicia - 43: Recalcitrant Pool - U.S. Indicia - 44: Recalcitrant Pool - Dormant Account - 45: Recalcitrant Pool - U.S. Persons - 46: Recalcitrant Pool - Passive NFFEs - 47: Nonparticipating FFI Pool - 48: U.S. Payees Pool - 49: QI - Recalcitrant Pool-General - 50: U.S. Withholding Agent-Foreign branch of FI | [optional] | +|**primaryWithholdingAgent** | [**PrimaryWithholdingAgent**](PrimaryWithholdingAgent.md) | Primary withholding agent information | [optional] | +|**intermediaryOrFlowThrough** | [**IntermediaryOrFlowThrough**](IntermediaryOrFlowThrough.md) | Intermediary or flow-through entity information | [optional] | +|**type** | [**TypeEnum**](#TypeEnum) | Form type | | +|**id** | **String** | Form ID. Unique identifier set when the record is created. | [optional] [readonly] | +|**issuerId** | **String** | Issuer ID - only required when creating forms | [optional] | +|**issuerReferenceId** | **String** | Issuer Reference ID - only required when creating forms | [optional] | +|**issuerTin** | **String** | Issuer TIN - readonly | [optional] | +|**taxYear** | **Integer** | Tax Year - only required when creating forms | [optional] | +|**referenceId** | **String** | Internal reference ID. Never shown to any agency or recipient. | [optional] | +|**tin** | **String** | Recipient's Federal Tax Identification Number (TIN). | [optional] | +|**recipientName** | **String** | Recipient name | | +|**recipientSecondName** | **String** | Recipient second name | [optional] | +|**address** | **String** | Address. | | +|**address2** | **String** | Address line 2. | [optional] | +|**city** | **String** | City. | | +|**state** | **String** | Two-letter US state or Canadian province code (required for US/CA addresses). | [optional] | +|**zip** | **String** | ZIP/postal code. | [optional] | +|**email** | **String** | Recipient's Contact email address. | [optional] | +|**accountNumber** | **String** | Account number | [optional] | +|**officeCode** | **String** | Office code | [optional] | +|**nonUsProvince** | **String** | Province or region for non-US/CA addresses. | [optional] | +|**countryCode** | **String** | Two-letter IRS country code (e.g., 'US', 'CA'), as defined at https://www.irs.gov/e-file-providers/country-codes. | | +|**federalEfileDate** | **LocalDate** | Date when federal e-filing should be scheduled for this form | [optional] | +|**postalMail** | **Boolean** | Boolean indicating that postal mailing to the recipient should be scheduled for this form | [optional] | +|**stateEfileDate** | **LocalDate** | Date when state e-filing should be scheduled for this form | [optional] | +|**recipientEdeliveryDate** | **LocalDate** | Date when recipient e-delivery should be scheduled for this form | [optional] | +|**tinMatch** | **Boolean** | Boolean indicating that TIN Matching should be scheduled for this form | [optional] | +|**noTin** | **Boolean** | No TIN indicator | [optional] | +|**addressVerification** | **Boolean** | Boolean indicating that address verification should be scheduled for this form | [optional] | +|**stateAndLocalWithholding** | [**StateAndLocalWithholding**](StateAndLocalWithholding.md) | State and local withholding information | [optional] | +|**secondTinNotice** | **Boolean** | Second TIN notice | [optional] | +|**federalEfileStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | Federal e-file status | [optional] [readonly] | +|**stateEfileStatus** | [**List<StateEfileStatusDetail>**](StateEfileStatusDetail.md) | State e-file status | [optional] [readonly] | +|**postalMailStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | Postal mail to recipient status | [optional] [readonly] | +|**tinMatchStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | TIN Match status | [optional] [readonly] | +|**addressVerificationStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | Address verification status | [optional] [readonly] | +|**eDeliveryStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | EDelivery status | [optional] [readonly] | +|**validationErrors** | [**List<ValidationError>**](ValidationError.md) | Validation errors | [optional] [readonly] | +|**createdAt** | **OffsetDateTime** | Date time when the record was created. | [optional] [readonly] | +|**updatedAt** | **OffsetDateTime** | Date time when the record was last updated. | [optional] [readonly] | + + + +## Enum: TinTypeEnum + +| Name | Value | +|---- | -----| +| EMPTY | "Empty" | +| EIN | "EIN" | +| SSN | "SSN" | +| ITIN | "ITIN" | +| ATIN | "ATIN" | + + + +## Enum: LobCodeEnum + +| Name | Value | +|---- | -----| +| _01 | "01" | +| _02 | "02" | +| _03 | "03" | +| _04 | "04" | +| _05 | "05" | +| _06 | "06" | +| _07 | "07" | +| _08 | "08" | +| _09 | "09" | +| _10 | "10" | +| _11 | "11" | +| _12 | "12" | + + + +## Enum: IncomeCodeEnum + +| Name | Value | +|---- | -----| +| _01 | "01" | +| _02 | "02" | +| _03 | "03" | +| _04 | "04" | +| _05 | "05" | +| _22 | "22" | +| _29 | "29" | +| _30 | "30" | +| _31 | "31" | +| _33 | "33" | +| _51 | "51" | +| _54 | "54" | +| _06 | "06" | +| _07 | "07" | +| _08 | "08" | +| _34 | "34" | +| _40 | "40" | +| _52 | "52" | +| _53 | "53" | +| _56 | "56" | +| _09 | "09" | +| _10 | "10" | +| _11 | "11" | +| _12 | "12" | +| _13 | "13" | +| _14 | "14" | +| _15 | "15" | +| _16 | "16" | +| _17 | "17" | +| _18 | "18" | +| _19 | "19" | +| _20 | "20" | +| _23 | "23" | +| _24 | "24" | +| _25 | "25" | +| _26 | "26" | +| _27 | "27" | +| _28 | "28" | +| _32 | "32" | +| _35 | "35" | +| _36 | "36" | +| _37 | "37" | +| _38 | "38" | +| _39 | "39" | +| _41 | "41" | +| _42 | "42" | +| _43 | "43" | +| _44 | "44" | +| _50 | "50" | +| _55 | "55" | +| _57 | "57" | +| _58 | "58" | + + + +## Enum: WithholdingIndicatorEnum + +| Name | Value | +|---- | -----| +| _3 | "3" | +| _4 | "4" | + + + +## Enum: ExemptionCodeChap3Enum + +| Name | Value | +|---- | -----| +| _00 | "00" | +| _01 | "01" | +| _02 | "02" | +| _03 | "03" | +| _04 | "04" | +| _05 | "05" | +| _06 | "06" | +| _07 | "07" | +| _08 | "08" | +| _09 | "09" | +| _10 | "10" | +| _11 | "11" | +| _12 | "12" | +| _22 | "22" | +| _23 | "23" | +| _24 | "24" | + + + +## Enum: ExemptionCodeChap4Enum + +| Name | Value | +|---- | -----| +| _00 | "00" | +| _13 | "13" | +| _14 | "14" | +| _15 | "15" | +| _16 | "16" | +| _17 | "17" | +| _18 | "18" | +| _19 | "19" | +| _20 | "20" | +| _21 | "21" | + + + +## Enum: TaxRateChap3Enum + +| Name | Value | +|---- | -----| +| _00_00 | "00.00" | +| _02_00 | "02.00" | +| _04_00 | "04.00" | +| _04_90 | "04.90" | +| _04_95 | "04.95" | +| _05_00 | "05.00" | +| _07_00 | "07.00" | +| _08_00 | "08.00" | +| _10_00 | "10.00" | +| _12_00 | "12.00" | +| _12_50 | "12.50" | +| _14_00 | "14.00" | +| _15_00 | "15.00" | +| _17_50 | "17.50" | +| _20_00 | "20.00" | +| _21_00 | "21.00" | +| _24_00 | "24.00" | +| _25_00 | "25.00" | +| _27_50 | "27.50" | +| _28_00 | "28.00" | +| _30_00 | "30.00" | +| _37_00 | "37.00" | + + + +## Enum: Chap3StatusCodeEnum + +| Name | Value | +|---- | -----| +| _01 | "01" | +| _02 | "02" | +| _34 | "34" | +| _03 | "03" | +| _04 | "04" | +| _05 | "05" | +| _06 | "06" | +| _07 | "07" | +| _08 | "08" | +| _09 | "09" | +| _10 | "10" | +| _11 | "11" | +| _12 | "12" | +| _13 | "13" | +| _14 | "14" | +| _15 | "15" | +| _16 | "16" | +| _17 | "17" | +| _18 | "18" | +| _19 | "19" | +| _20 | "20" | +| _21 | "21" | +| _22 | "22" | +| _23 | "23" | +| _24 | "24" | +| _25 | "25" | +| _26 | "26" | +| _27 | "27" | +| _28 | "28" | +| _29 | "29" | +| _30 | "30" | +| _31 | "31" | +| _32 | "32" | +| _35 | "35" | +| _36 | "36" | +| _37 | "37" | +| _38 | "38" | +| _39 | "39" | + + + +## Enum: Chap4StatusCodeEnum + +| Name | Value | +|---- | -----| +| _01 | "01" | +| _02 | "02" | +| _03 | "03" | +| _04 | "04" | +| _05 | "05" | +| _06 | "06" | +| _07 | "07" | +| _08 | "08" | +| _09 | "09" | +| _10 | "10" | +| _11 | "11" | +| _12 | "12" | +| _13 | "13" | +| _14 | "14" | +| _15 | "15" | +| _16 | "16" | +| _17 | "17" | +| _18 | "18" | +| _19 | "19" | +| _20 | "20" | +| _21 | "21" | +| _22 | "22" | +| _23 | "23" | +| _24 | "24" | +| _25 | "25" | +| _26 | "26" | +| _27 | "27" | +| _28 | "28" | +| _29 | "29" | +| _30 | "30" | +| _31 | "31" | +| _32 | "32" | +| _33 | "33" | +| _34 | "34" | +| _35 | "35" | +| _36 | "36" | +| _37 | "37" | +| _38 | "38" | +| _39 | "39" | +| _40 | "40" | +| _41 | "41" | +| _42 | "42" | +| _43 | "43" | +| _44 | "44" | +| _45 | "45" | +| _46 | "46" | +| _47 | "47" | +| _48 | "48" | +| _49 | "49" | +| _50 | "50" | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| _1099_NEC | "1099-NEC" | +| _1099_MISC | "1099-MISC" | +| _1099_DIV | "1099-DIV" | +| _1099_R | "1099-R" | +| _1099_K | "1099-K" | +| _1095_B | "1095-B" | +| _1042_S | "1042-S" | +| _1095_C | "1095-C" | +| _1099_INT | "1099-INT" | diff --git a/docs/A1099/V2/Form1095B.md b/docs/A1099/V2/Form1095B.md index b8cadd7..c7fa62f 100644 --- a/docs/A1099/V2/Form1095B.md +++ b/docs/A1099/V2/Form1095B.md @@ -2,52 +2,100 @@ # Form1095B +Form 1095-B: Health Coverage ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**originOfHealthCoverageCode** | **String** | | [optional] | -|**coveredIndividuals** | [**List<CoveredIndividualReference>**](CoveredIndividualReference.md) | | [optional] | -|**id** | **String** | | [optional] | -|**type** | **String** | | [optional] | -|**issuerId** | **Integer** | | [optional] | -|**issuerReferenceId** | **String** | | [optional] | -|**issuerTin** | **String** | | [optional] | -|**taxYear** | **Integer** | | [optional] | -|**federalEfile** | **Boolean** | | [optional] | -|**federalEfileStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**stateEfile** | **Boolean** | | [optional] | -|**stateEfileStatus** | [**List<StateEfileStatusDetail>**](StateEfileStatusDetail.md) | | [optional] | -|**postalMail** | **Boolean** | | [optional] | -|**postalMailStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**tinMatch** | **Boolean** | | [optional] | -|**tinMatchStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**addressVerification** | **Boolean** | | [optional] | -|**addressVerificationStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**eDeliveryStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**referenceId** | **String** | | [optional] | -|**email** | **String** | | [optional] | -|**tinType** | **String** | | [optional] | -|**fatcaFilingRequirement** | **Boolean** | | [optional] | -|**tin** | **String** | | [optional] | -|**noTin** | **Boolean** | | [optional] | -|**secondTinNotice** | **Boolean** | | [optional] | -|**recipientName** | **String** | | [optional] | -|**recipientSecondName** | **String** | | [optional] | -|**address** | **String** | | [optional] | -|**address2** | **String** | | [optional] | -|**city** | **String** | | [optional] | -|**state** | **String** | | [optional] | -|**zip** | **String** | | [optional] | -|**nonUsProvince** | **String** | | [optional] | -|**countryCode** | **String** | | [optional] | -|**accountNumber** | **String** | | [optional] | -|**officeCode** | **String** | | [optional] | -|**validationErrors** | [**List<ValidationError>**](ValidationError.md) | | [optional] | -|**createdAt** | **OffsetDateTime** | | [optional] | -|**updatedAt** | **OffsetDateTime** | | [optional] | -|**stateAndLocalWithholding** | [**StateAndLocalWithholding**](StateAndLocalWithholding.md) | | [optional] | +|**employeeFirstName** | **String** | Employee's first name | | +|**employeeMiddleName** | **String** | Employee's middle name | [optional] | +|**employeeLastName** | **String** | Employee's last name | | +|**employeeNameSuffix** | **String** | Employee's name suffix | [optional] | +|**employeeDateOfBirth** | **LocalDate** | Employee's date of birth | [optional] | +|**originOfHealthCoverageCode** | [**OriginOfHealthCoverageCodeEnum**](#OriginOfHealthCoverageCodeEnum) | Origin of health coverage code Available values: - A: Small Business Health Options Program (SHOP) - B: Employer-sponsored coverage - C: Government-sponsored program - D: Individual market insurance - E: Multiemployer plan - F: Other designated minimum essential coverage - G: Employer-sponsored coverage that is an individual coverage HRA (valid for tax years 2020 and later) | | +|**coveredIndividuals** | [**List<CoveredIndividual>**](CoveredIndividual.md) | Covered individuals information - At least one month of coverage must be entered if it's not a correction. | [optional] | +|**type** | [**TypeEnum**](#TypeEnum) | Form type | | +|**id** | **String** | Form ID. Unique identifier set when the record is created. | [optional] [readonly] | +|**issuerId** | **String** | Issuer ID - only required when creating forms | [optional] | +|**issuerReferenceId** | **String** | Issuer Reference ID - only required when creating forms | [optional] | +|**issuerTin** | **String** | Issuer TIN - readonly | [optional] | +|**taxYear** | **Integer** | Tax Year - only required when creating forms | [optional] | +|**referenceId** | **String** | Internal reference ID. Never shown to any agency or recipient. | [optional] | +|**tin** | **String** | Recipient's Federal Tax Identification Number (TIN). | [optional] | +|**recipientName** | **String** | Recipient name | | +|**tinType** | [**TinTypeEnum**](#TinTypeEnum) | Type of TIN (Tax ID Number) | [optional] | +|**recipientSecondName** | **String** | Recipient second name | [optional] | +|**address** | **String** | Address. | | +|**address2** | **String** | Address line 2. | [optional] | +|**city** | **String** | City. | | +|**state** | **String** | Two-letter US state or Canadian province code (required for US/CA addresses). | [optional] | +|**zip** | **String** | ZIP/postal code. | [optional] | +|**email** | **String** | Recipient's Contact email address. | [optional] | +|**accountNumber** | **String** | Account number | [optional] | +|**officeCode** | **String** | Office code | [optional] | +|**nonUsProvince** | **String** | Province or region for non-US/CA addresses. | [optional] | +|**countryCode** | **String** | Two-letter IRS country code (e.g., 'US', 'CA'), as defined at https://www.irs.gov/e-file-providers/country-codes. | | +|**federalEfileDate** | **LocalDate** | Date when federal e-filing should be scheduled for this form | [optional] | +|**postalMail** | **Boolean** | Boolean indicating that postal mailing to the recipient should be scheduled for this form | [optional] | +|**stateEfileDate** | **LocalDate** | Date when state e-filing should be scheduled for this form | [optional] | +|**recipientEdeliveryDate** | **LocalDate** | Date when recipient e-delivery should be scheduled for this form | [optional] | +|**tinMatch** | **Boolean** | Boolean indicating that TIN Matching should be scheduled for this form | [optional] | +|**noTin** | **Boolean** | No TIN indicator | [optional] | +|**addressVerification** | **Boolean** | Boolean indicating that address verification should be scheduled for this form | [optional] | +|**stateAndLocalWithholding** | [**StateAndLocalWithholding**](StateAndLocalWithholding.md) | State and local withholding information | [optional] | +|**secondTinNotice** | **Boolean** | Second TIN notice | [optional] | +|**federalEfileStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | Federal e-file status | [optional] [readonly] | +|**stateEfileStatus** | [**List<StateEfileStatusDetail>**](StateEfileStatusDetail.md) | State e-file status | [optional] [readonly] | +|**postalMailStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | Postal mail to recipient status | [optional] [readonly] | +|**tinMatchStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | TIN Match status | [optional] [readonly] | +|**addressVerificationStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | Address verification status | [optional] [readonly] | +|**eDeliveryStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | EDelivery status | [optional] [readonly] | +|**validationErrors** | [**List<ValidationError>**](ValidationError.md) | Validation errors | [optional] [readonly] | +|**createdAt** | **OffsetDateTime** | Date time when the record was created. | [optional] [readonly] | +|**updatedAt** | **OffsetDateTime** | Date time when the record was last updated. | [optional] [readonly] | + + + +## Enum: OriginOfHealthCoverageCodeEnum + +| Name | Value | +|---- | -----| +| A | "A" | +| B | "B" | +| C | "C" | +| D | "D" | +| E | "E" | +| F | "F" | +| G | "G" | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| _1099_NEC | "1099-NEC" | +| _1099_MISC | "1099-MISC" | +| _1099_DIV | "1099-DIV" | +| _1099_R | "1099-R" | +| _1099_K | "1099-K" | +| _1095_B | "1095-B" | +| _1042_S | "1042-S" | +| _1095_C | "1095-C" | +| _1099_INT | "1099-INT" | + + + +## Enum: TinTypeEnum + +| Name | Value | +|---- | -----| +| EMPTY | "Empty" | +| EIN | "EIN" | +| SSN | "SSN" | +| ITIN | "ITIN" | +| ATIN | "ATIN" | diff --git a/docs/A1099/V2/Form1095C.md b/docs/A1099/V2/Form1095C.md new file mode 100644 index 0000000..7a37515 --- /dev/null +++ b/docs/A1099/V2/Form1095C.md @@ -0,0 +1,109 @@ + + +# Form1095C + +Form 1095-C: Employer-Provided Health Insurance Offer and Coverage + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**employeeFirstName** | **String** | Employee's first name | | +|**employeeMiddleName** | **String** | Employee's middle name | [optional] | +|**employeeLastName** | **String** | Employee's last name | | +|**employeeNameSuffix** | **String** | Employee's name suffix | [optional] | +|**recipientDateOfBirth** | **LocalDate** | Recipient's date of birth | [optional] | +|**planStartMonth** | [**PlanStartMonthEnum**](#PlanStartMonthEnum) | Plan start month. The calendar month during which the plan year begins of the health plan in which the employee is offered coverage (or would be offered coverage if the employee were eligible to participate in the plan). Available values: - 00: None - 01: January - 02: February - 03: March - 04: April - 05: May - 06: June - 07: July - 08: August - 09: September - 10: October - 11: November - 12: December | | +|**employerProvidedSiCoverage** | **Boolean** | Employer provided self-insured coverage | [optional] | +|**offerAndCoverages** | [**List<OfferAndCoverage>**](OfferAndCoverage.md) | Offer and coverage information | | +|**coveredIndividuals** | [**List<CoveredIndividual>**](CoveredIndividual.md) | Covered individuals information | [optional] | +|**type** | [**TypeEnum**](#TypeEnum) | Form type | | +|**id** | **String** | Form ID. Unique identifier set when the record is created. | [optional] [readonly] | +|**issuerId** | **String** | Issuer ID - only required when creating forms | [optional] | +|**issuerReferenceId** | **String** | Issuer Reference ID - only required when creating forms | [optional] | +|**issuerTin** | **String** | Issuer TIN - readonly | [optional] | +|**taxYear** | **Integer** | Tax Year - only required when creating forms | [optional] | +|**referenceId** | **String** | Internal reference ID. Never shown to any agency or recipient. | [optional] | +|**tin** | **String** | Recipient's Federal Tax Identification Number (TIN). | [optional] | +|**recipientName** | **String** | Recipient name | | +|**tinType** | [**TinTypeEnum**](#TinTypeEnum) | Type of TIN (Tax ID Number) | [optional] | +|**recipientSecondName** | **String** | Recipient second name | [optional] | +|**address** | **String** | Address. | | +|**address2** | **String** | Address line 2. | [optional] | +|**city** | **String** | City. | | +|**state** | **String** | Two-letter US state or Canadian province code (required for US/CA addresses). | [optional] | +|**zip** | **String** | ZIP/postal code. | [optional] | +|**email** | **String** | Recipient's Contact email address. | [optional] | +|**accountNumber** | **String** | Account number | [optional] | +|**officeCode** | **String** | Office code | [optional] | +|**nonUsProvince** | **String** | Province or region for non-US/CA addresses. | [optional] | +|**countryCode** | **String** | Two-letter IRS country code (e.g., 'US', 'CA'), as defined at https://www.irs.gov/e-file-providers/country-codes. | | +|**federalEfileDate** | **LocalDate** | Date when federal e-filing should be scheduled for this form | [optional] | +|**postalMail** | **Boolean** | Boolean indicating that postal mailing to the recipient should be scheduled for this form | [optional] | +|**stateEfileDate** | **LocalDate** | Date when state e-filing should be scheduled for this form | [optional] | +|**recipientEdeliveryDate** | **LocalDate** | Date when recipient e-delivery should be scheduled for this form | [optional] | +|**tinMatch** | **Boolean** | Boolean indicating that TIN Matching should be scheduled for this form | [optional] | +|**noTin** | **Boolean** | No TIN indicator | [optional] | +|**addressVerification** | **Boolean** | Boolean indicating that address verification should be scheduled for this form | [optional] | +|**stateAndLocalWithholding** | [**StateAndLocalWithholding**](StateAndLocalWithholding.md) | State and local withholding information | [optional] | +|**secondTinNotice** | **Boolean** | Second TIN notice | [optional] | +|**federalEfileStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | Federal e-file status | [optional] [readonly] | +|**stateEfileStatus** | [**List<StateEfileStatusDetail>**](StateEfileStatusDetail.md) | State e-file status | [optional] [readonly] | +|**postalMailStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | Postal mail to recipient status | [optional] [readonly] | +|**tinMatchStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | TIN Match status | [optional] [readonly] | +|**addressVerificationStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | Address verification status | [optional] [readonly] | +|**eDeliveryStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | EDelivery status | [optional] [readonly] | +|**validationErrors** | [**List<ValidationError>**](ValidationError.md) | Validation errors | [optional] [readonly] | +|**createdAt** | **OffsetDateTime** | Date time when the record was created. | [optional] [readonly] | +|**updatedAt** | **OffsetDateTime** | Date time when the record was last updated. | [optional] [readonly] | + + + +## Enum: PlanStartMonthEnum + +| Name | Value | +|---- | -----| +| _00 | "00" | +| _01 | "01" | +| _02 | "02" | +| _03 | "03" | +| _04 | "04" | +| _05 | "05" | +| _06 | "06" | +| _07 | "07" | +| _08 | "08" | +| _09 | "09" | +| _10 | "10" | +| _11 | "11" | +| _12 | "12" | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| _1099_NEC | "1099-NEC" | +| _1099_MISC | "1099-MISC" | +| _1099_DIV | "1099-DIV" | +| _1099_R | "1099-R" | +| _1099_K | "1099-K" | +| _1095_B | "1095-B" | +| _1042_S | "1042-S" | +| _1095_C | "1095-C" | +| _1099_INT | "1099-INT" | + + + +## Enum: TinTypeEnum + +| Name | Value | +|---- | -----| +| EMPTY | "Empty" | +| EIN | "EIN" | +| SSN | "SSN" | +| ITIN | "ITIN" | +| ATIN | "ATIN" | + + + diff --git a/docs/A1099/V2/Form1099Base.md b/docs/A1099/V2/Form1099Base.md index dd5ff7b..4b6f1ce 100644 --- a/docs/A1099/V2/Form1099Base.md +++ b/docs/A1099/V2/Form1099Base.md @@ -7,45 +7,73 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**id** | **String** | | [optional] | -|**type** | **String** | | [optional] | -|**issuerId** | **Integer** | | [optional] | -|**issuerReferenceId** | **String** | | [optional] | -|**issuerTin** | **String** | | [optional] | -|**taxYear** | **Integer** | | [optional] | -|**federalEfile** | **Boolean** | | [optional] | -|**federalEfileStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**stateEfile** | **Boolean** | | [optional] | -|**stateEfileStatus** | [**List<StateEfileStatusDetail>**](StateEfileStatusDetail.md) | | [optional] | -|**postalMail** | **Boolean** | | [optional] | -|**postalMailStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**tinMatch** | **Boolean** | | [optional] | -|**tinMatchStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**addressVerification** | **Boolean** | | [optional] | -|**addressVerificationStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**eDeliveryStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**referenceId** | **String** | | [optional] | -|**email** | **String** | | [optional] | -|**tinType** | **String** | | [optional] | -|**fatcaFilingRequirement** | **Boolean** | | [optional] | -|**tin** | **String** | | [optional] | -|**noTin** | **Boolean** | | [optional] | -|**secondTinNotice** | **Boolean** | | [optional] | -|**recipientName** | **String** | | [optional] | -|**recipientSecondName** | **String** | | [optional] | -|**address** | **String** | | [optional] | -|**address2** | **String** | | [optional] | -|**city** | **String** | | [optional] | -|**state** | **String** | | [optional] | -|**zip** | **String** | | [optional] | -|**nonUsProvince** | **String** | | [optional] | -|**countryCode** | **String** | | [optional] | -|**accountNumber** | **String** | | [optional] | -|**officeCode** | **String** | | [optional] | -|**validationErrors** | [**List<ValidationError>**](ValidationError.md) | | [optional] | -|**createdAt** | **OffsetDateTime** | | [optional] | -|**updatedAt** | **OffsetDateTime** | | [optional] | -|**stateAndLocalWithholding** | [**StateAndLocalWithholding**](StateAndLocalWithholding.md) | | [optional] | +|**type** | [**TypeEnum**](#TypeEnum) | Form type | | +|**id** | **String** | Form ID. Unique identifier set when the record is created. | [optional] [readonly] | +|**issuerId** | **String** | Issuer ID - only required when creating forms | [optional] | +|**issuerReferenceId** | **String** | Issuer Reference ID - only required when creating forms | [optional] | +|**issuerTin** | **String** | Issuer TIN - readonly | [optional] | +|**taxYear** | **Integer** | Tax Year - only required when creating forms | [optional] | +|**referenceId** | **String** | Internal reference ID. Never shown to any agency or recipient. | [optional] | +|**tin** | **String** | Recipient's Federal Tax Identification Number (TIN). | [optional] | +|**recipientName** | **String** | Recipient name | | +|**tinType** | [**TinTypeEnum**](#TinTypeEnum) | Type of TIN (Tax ID Number) | [optional] | +|**recipientSecondName** | **String** | Recipient second name | [optional] | +|**address** | **String** | Address. | | +|**address2** | **String** | Address line 2. | [optional] | +|**city** | **String** | City. | | +|**state** | **String** | Two-letter US state or Canadian province code (required for US/CA addresses). | [optional] | +|**zip** | **String** | ZIP/postal code. | [optional] | +|**email** | **String** | Recipient's Contact email address. | [optional] | +|**accountNumber** | **String** | Account number | [optional] | +|**officeCode** | **String** | Office code | [optional] | +|**nonUsProvince** | **String** | Province or region for non-US/CA addresses. | [optional] | +|**countryCode** | **String** | Two-letter IRS country code (e.g., 'US', 'CA'), as defined at https://www.irs.gov/e-file-providers/country-codes. | | +|**federalEfileDate** | **LocalDate** | Date when federal e-filing should be scheduled for this form | [optional] | +|**postalMail** | **Boolean** | Boolean indicating that postal mailing to the recipient should be scheduled for this form | [optional] | +|**stateEfileDate** | **LocalDate** | Date when state e-filing should be scheduled for this form | [optional] | +|**recipientEdeliveryDate** | **LocalDate** | Date when recipient e-delivery should be scheduled for this form | [optional] | +|**tinMatch** | **Boolean** | Boolean indicating that TIN Matching should be scheduled for this form | [optional] | +|**noTin** | **Boolean** | No TIN indicator | [optional] | +|**addressVerification** | **Boolean** | Boolean indicating that address verification should be scheduled for this form | [optional] | +|**stateAndLocalWithholding** | [**StateAndLocalWithholding**](StateAndLocalWithholding.md) | State and local withholding information | [optional] | +|**secondTinNotice** | **Boolean** | Second TIN notice | [optional] | +|**federalEfileStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | Federal e-file status | [optional] [readonly] | +|**stateEfileStatus** | [**List<StateEfileStatusDetail>**](StateEfileStatusDetail.md) | State e-file status | [optional] [readonly] | +|**postalMailStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | Postal mail to recipient status | [optional] [readonly] | +|**tinMatchStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | TIN Match status | [optional] [readonly] | +|**addressVerificationStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | Address verification status | [optional] [readonly] | +|**eDeliveryStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | EDelivery status | [optional] [readonly] | +|**validationErrors** | [**List<ValidationError>**](ValidationError.md) | Validation errors | [optional] [readonly] | +|**createdAt** | **OffsetDateTime** | Date time when the record was created. | [optional] [readonly] | +|**updatedAt** | **OffsetDateTime** | Date time when the record was last updated. | [optional] [readonly] | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| _1099_NEC | "1099-NEC" | +| _1099_MISC | "1099-MISC" | +| _1099_DIV | "1099-DIV" | +| _1099_R | "1099-R" | +| _1099_K | "1099-K" | +| _1095_B | "1095-B" | +| _1042_S | "1042-S" | +| _1095_C | "1095-C" | +| _1099_INT | "1099-INT" | + + + +## Enum: TinTypeEnum + +| Name | Value | +|---- | -----| +| EMPTY | "Empty" | +| EIN | "EIN" | +| SSN | "SSN" | +| ITIN | "ITIN" | +| ATIN | "ATIN" | diff --git a/docs/A1099/V2/Form1099Div.md b/docs/A1099/V2/Form1099Div.md index ac64f8e..68c00e0 100644 --- a/docs/A1099/V2/Form1099Div.md +++ b/docs/A1099/V2/Form1099Div.md @@ -2,68 +2,98 @@ # Form1099Div +Form 1099-DIV: Dividends and Distributions ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**totalOrdinaryDividends** | **Double** | | [optional] | -|**qualifiedDividends** | **Double** | | [optional] | -|**totalCapitalGainDistributions** | **Double** | | [optional] | -|**unrecapturedSection1250Gain** | **Double** | | [optional] | -|**section1202Gain** | **Double** | | [optional] | -|**collectiblesGain** | **Double** | | [optional] | -|**section897OrdinaryDividends** | **Double** | | [optional] | -|**section897CapitalGain** | **Double** | | [optional] | -|**nondividendDistributions** | **Double** | | [optional] | -|**federalIncomeTaxWithheld** | **Double** | | [optional] | -|**section199ADividends** | **Double** | | [optional] | -|**investmentExpenses** | **Double** | | [optional] | -|**foreignTaxPaid** | **Double** | | [optional] | -|**foreignCountryOrUSPossession** | **String** | | [optional] | -|**cashLiquidationDistributions** | **Double** | | [optional] | -|**noncashLiquidationDistributions** | **Double** | | [optional] | -|**exemptInterestDividends** | **Double** | | [optional] | -|**specifiedPrivateActivityBondInterestDividends** | **Double** | | [optional] | -|**fatcaFilingRequirement** | **Boolean** | | [optional] | -|**id** | **String** | | [optional] | -|**type** | **String** | | [optional] | -|**issuerId** | **Integer** | | [optional] | -|**issuerReferenceId** | **String** | | [optional] | -|**issuerTin** | **String** | | [optional] | -|**taxYear** | **Integer** | | [optional] | -|**federalEfile** | **Boolean** | | [optional] | -|**federalEfileStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**stateEfile** | **Boolean** | | [optional] | -|**stateEfileStatus** | [**List<StateEfileStatusDetail>**](StateEfileStatusDetail.md) | | [optional] | -|**postalMail** | **Boolean** | | [optional] | -|**postalMailStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**tinMatch** | **Boolean** | | [optional] | -|**tinMatchStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**addressVerification** | **Boolean** | | [optional] | -|**addressVerificationStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**eDeliveryStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**referenceId** | **String** | | [optional] | -|**email** | **String** | | [optional] | -|**tinType** | **String** | | [optional] | -|**tin** | **String** | | [optional] | -|**noTin** | **Boolean** | | [optional] | -|**secondTinNotice** | **Boolean** | | [optional] | -|**recipientName** | **String** | | [optional] | -|**recipientSecondName** | **String** | | [optional] | -|**address** | **String** | | [optional] | -|**address2** | **String** | | [optional] | -|**city** | **String** | | [optional] | -|**state** | **String** | | [optional] | -|**zip** | **String** | | [optional] | -|**nonUsProvince** | **String** | | [optional] | -|**countryCode** | **String** | | [optional] | -|**accountNumber** | **String** | | [optional] | -|**officeCode** | **String** | | [optional] | -|**validationErrors** | [**List<ValidationError>**](ValidationError.md) | | [optional] | -|**createdAt** | **OffsetDateTime** | | [optional] | -|**updatedAt** | **OffsetDateTime** | | [optional] | -|**stateAndLocalWithholding** | [**StateAndLocalWithholding**](StateAndLocalWithholding.md) | | [optional] | +|**totalOrdinaryDividends** | **Double** | Total ordinary dividends | [optional] | +|**qualifiedDividends** | **Double** | Qualified dividends | [optional] | +|**totalCapitalGainDistributions** | **Double** | Total capital gain distributions | [optional] | +|**unrecapturedSection1250Gain** | **Double** | Unrecaptured Section 1250 gain | [optional] | +|**section1202Gain** | **Double** | Section 1202 gain | [optional] | +|**collectiblesGain** | **Double** | Collectibles (28%) gain | [optional] | +|**section897OrdinaryDividends** | **Double** | Section 897 ordinary dividends | [optional] | +|**section897CapitalGain** | **Double** | Section 897 capital gain | [optional] | +|**nondividendDistributions** | **Double** | Nondividend distributions | [optional] | +|**federalIncomeTaxWithheld** | **Double** | Federal income tax withheld | [optional] | +|**section199ADividends** | **Double** | Section 199A dividends | [optional] | +|**investmentExpenses** | **Double** | Investment expenses | [optional] | +|**foreignTaxPaid** | **Double** | Foreign tax paid | [optional] | +|**foreignCountryOrUSPossession** | **String** | Foreign country or U.S. possession | [optional] | +|**cashLiquidationDistributions** | **Double** | Cash liquidation distributions | [optional] | +|**noncashLiquidationDistributions** | **Double** | Noncash liquidation distributions | [optional] | +|**exemptInterestDividends** | **Double** | Exempt-interest dividends | [optional] | +|**specifiedPrivateActivityBondInterestDividends** | **Double** | Specified private activity bond interest dividends | [optional] | +|**fatcaFilingRequirement** | **Boolean** | FATCA filing requirement | [optional] | +|**type** | [**TypeEnum**](#TypeEnum) | Form type | | +|**id** | **String** | Form ID. Unique identifier set when the record is created. | [optional] [readonly] | +|**issuerId** | **String** | Issuer ID - only required when creating forms | [optional] | +|**issuerReferenceId** | **String** | Issuer Reference ID - only required when creating forms | [optional] | +|**issuerTin** | **String** | Issuer TIN - readonly | [optional] | +|**taxYear** | **Integer** | Tax Year - only required when creating forms | [optional] | +|**referenceId** | **String** | Internal reference ID. Never shown to any agency or recipient. | [optional] | +|**tin** | **String** | Recipient's Federal Tax Identification Number (TIN). | [optional] | +|**recipientName** | **String** | Recipient name | | +|**tinType** | [**TinTypeEnum**](#TinTypeEnum) | Type of TIN (Tax ID Number) | [optional] | +|**recipientSecondName** | **String** | Recipient second name | [optional] | +|**address** | **String** | Address. | | +|**address2** | **String** | Address line 2. | [optional] | +|**city** | **String** | City. | | +|**state** | **String** | Two-letter US state or Canadian province code (required for US/CA addresses). | [optional] | +|**zip** | **String** | ZIP/postal code. | [optional] | +|**email** | **String** | Recipient's Contact email address. | [optional] | +|**accountNumber** | **String** | Account number | [optional] | +|**officeCode** | **String** | Office code | [optional] | +|**nonUsProvince** | **String** | Province or region for non-US/CA addresses. | [optional] | +|**countryCode** | **String** | Two-letter IRS country code (e.g., 'US', 'CA'), as defined at https://www.irs.gov/e-file-providers/country-codes. | | +|**federalEfileDate** | **LocalDate** | Date when federal e-filing should be scheduled for this form | [optional] | +|**postalMail** | **Boolean** | Boolean indicating that postal mailing to the recipient should be scheduled for this form | [optional] | +|**stateEfileDate** | **LocalDate** | Date when state e-filing should be scheduled for this form | [optional] | +|**recipientEdeliveryDate** | **LocalDate** | Date when recipient e-delivery should be scheduled for this form | [optional] | +|**tinMatch** | **Boolean** | Boolean indicating that TIN Matching should be scheduled for this form | [optional] | +|**noTin** | **Boolean** | No TIN indicator | [optional] | +|**addressVerification** | **Boolean** | Boolean indicating that address verification should be scheduled for this form | [optional] | +|**stateAndLocalWithholding** | [**StateAndLocalWithholding**](StateAndLocalWithholding.md) | State and local withholding information | [optional] | +|**secondTinNotice** | **Boolean** | Second TIN notice | [optional] | +|**federalEfileStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | Federal e-file status | [optional] [readonly] | +|**stateEfileStatus** | [**List<StateEfileStatusDetail>**](StateEfileStatusDetail.md) | State e-file status | [optional] [readonly] | +|**postalMailStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | Postal mail to recipient status | [optional] [readonly] | +|**tinMatchStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | TIN Match status | [optional] [readonly] | +|**addressVerificationStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | Address verification status | [optional] [readonly] | +|**eDeliveryStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | EDelivery status | [optional] [readonly] | +|**validationErrors** | [**List<ValidationError>**](ValidationError.md) | Validation errors | [optional] [readonly] | +|**createdAt** | **OffsetDateTime** | Date time when the record was created. | [optional] [readonly] | +|**updatedAt** | **OffsetDateTime** | Date time when the record was last updated. | [optional] [readonly] | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| _1099_NEC | "1099-NEC" | +| _1099_MISC | "1099-MISC" | +| _1099_DIV | "1099-DIV" | +| _1099_R | "1099-R" | +| _1099_K | "1099-K" | +| _1095_B | "1095-B" | +| _1042_S | "1042-S" | +| _1095_C | "1095-C" | +| _1099_INT | "1099-INT" | + + + +## Enum: TinTypeEnum + +| Name | Value | +|---- | -----| +| EMPTY | "Empty" | +| EIN | "EIN" | +| SSN | "SSN" | +| ITIN | "ITIN" | +| ATIN | "ATIN" | diff --git a/docs/A1099/V2/Form1099Int.md b/docs/A1099/V2/Form1099Int.md index 441c5e5..ebb4cfb 100644 --- a/docs/A1099/V2/Form1099Int.md +++ b/docs/A1099/V2/Form1099Int.md @@ -7,59 +7,88 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**interestIncome** | **Double** | | [optional] | -|**earlyWithdrawalPenalty** | **Double** | | [optional] | -|**usSavingsBondsInterest** | **Double** | | [optional] | -|**federalIncomeTaxWithheld** | **Double** | | [optional] | -|**investmentExpenses** | **Double** | | [optional] | -|**foreignTaxPaid** | **Double** | | [optional] | -|**foreignCountry** | **String** | | [optional] | -|**taxExemptInterest** | **Double** | | [optional] | -|**specifiedPrivateActivityBondInterest** | **Double** | | [optional] | -|**marketDiscount** | **Double** | | [optional] | -|**bondPremium** | **Double** | | [optional] | -|**bondPremiumOnTreasuryObligations** | **Double** | | [optional] | -|**bondPremiumOnTaxExemptBond** | **Double** | | [optional] | -|**taxExemptBondCusipNumber** | **String** | | [optional] | -|**id** | **String** | | [optional] | -|**type** | **String** | | [optional] | -|**issuerId** | **Integer** | | [optional] | -|**issuerReferenceId** | **String** | | [optional] | -|**issuerTin** | **String** | | [optional] | -|**taxYear** | **Integer** | | [optional] | -|**federalEfile** | **Boolean** | | [optional] | -|**federalEfileStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**stateEfile** | **Boolean** | | [optional] | -|**stateEfileStatus** | [**List<StateEfileStatusDetail>**](StateEfileStatusDetail.md) | | [optional] | -|**postalMail** | **Boolean** | | [optional] | -|**postalMailStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**tinMatch** | **Boolean** | | [optional] | -|**tinMatchStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**addressVerification** | **Boolean** | | [optional] | -|**addressVerificationStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**eDeliveryStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**referenceId** | **String** | | [optional] | -|**email** | **String** | | [optional] | -|**tinType** | **String** | | [optional] | -|**fatcaFilingRequirement** | **Boolean** | | [optional] | -|**tin** | **String** | | [optional] | -|**noTin** | **Boolean** | | [optional] | -|**secondTinNotice** | **Boolean** | | [optional] | -|**recipientName** | **String** | | [optional] | -|**recipientSecondName** | **String** | | [optional] | -|**address** | **String** | | [optional] | -|**address2** | **String** | | [optional] | -|**city** | **String** | | [optional] | -|**state** | **String** | | [optional] | -|**zip** | **String** | | [optional] | -|**nonUsProvince** | **String** | | [optional] | -|**countryCode** | **String** | | [optional] | -|**accountNumber** | **String** | | [optional] | -|**officeCode** | **String** | | [optional] | -|**validationErrors** | [**List<ValidationError>**](ValidationError.md) | | [optional] | -|**createdAt** | **OffsetDateTime** | | [optional] | -|**updatedAt** | **OffsetDateTime** | | [optional] | -|**stateAndLocalWithholding** | [**StateAndLocalWithholding**](StateAndLocalWithholding.md) | | [optional] | +|**interestIncome** | **Double** | Interest Income | [optional] | +|**earlyWithdrawalPenalty** | **Double** | Early Withdrawal Penalty | [optional] | +|**usSavingsBondsInterest** | **Double** | Interest on U.S. Savings Bonds and Treasury obligations | [optional] | +|**federalIncomeTaxWithheld** | **Double** | Federal income tax withheld | [optional] | +|**investmentExpenses** | **Double** | Investment Expenses | [optional] | +|**foreignTaxPaid** | **Double** | Foreign tax paid | [optional] | +|**foreignCountry** | **String** | Foreign country or U.S. possession | [optional] | +|**taxExemptInterest** | **Double** | Tax-Exempt Interest | [optional] | +|**specifiedPrivateActivityBondInterest** | **Double** | Specified Private activity | [optional] | +|**marketDiscount** | **Double** | Market Discount | [optional] | +|**bondPremium** | **Double** | Bond Premium | [optional] | +|**bondPremiumOnTreasuryObligations** | **Double** | Bond Premium on Treasury obligations | [optional] | +|**bondPremiumOnTaxExemptBond** | **Double** | Bond Premium on tax exempt bond | [optional] | +|**taxExemptBondCusipNumber** | **String** | Tax exempt bond CUSIP no. | [optional] | +|**fatcaFilingRequirement** | **Boolean** | FATCA filing requirement | [optional] | +|**type** | [**TypeEnum**](#TypeEnum) | Form type | | +|**id** | **String** | Form ID. Unique identifier set when the record is created. | [optional] [readonly] | +|**issuerId** | **String** | Issuer ID - only required when creating forms | [optional] | +|**issuerReferenceId** | **String** | Issuer Reference ID - only required when creating forms | [optional] | +|**issuerTin** | **String** | Issuer TIN - readonly | [optional] | +|**taxYear** | **Integer** | Tax Year - only required when creating forms | [optional] | +|**referenceId** | **String** | Internal reference ID. Never shown to any agency or recipient. | [optional] | +|**tin** | **String** | Recipient's Federal Tax Identification Number (TIN). | [optional] | +|**recipientName** | **String** | Recipient name | | +|**tinType** | [**TinTypeEnum**](#TinTypeEnum) | Type of TIN (Tax ID Number) | [optional] | +|**recipientSecondName** | **String** | Recipient second name | [optional] | +|**address** | **String** | Address. | | +|**address2** | **String** | Address line 2. | [optional] | +|**city** | **String** | City. | | +|**state** | **String** | Two-letter US state or Canadian province code (required for US/CA addresses). | [optional] | +|**zip** | **String** | ZIP/postal code. | [optional] | +|**email** | **String** | Recipient's Contact email address. | [optional] | +|**accountNumber** | **String** | Account number | [optional] | +|**officeCode** | **String** | Office code | [optional] | +|**nonUsProvince** | **String** | Province or region for non-US/CA addresses. | [optional] | +|**countryCode** | **String** | Two-letter IRS country code (e.g., 'US', 'CA'), as defined at https://www.irs.gov/e-file-providers/country-codes. | | +|**federalEfileDate** | **LocalDate** | Date when federal e-filing should be scheduled for this form | [optional] | +|**postalMail** | **Boolean** | Boolean indicating that postal mailing to the recipient should be scheduled for this form | [optional] | +|**stateEfileDate** | **LocalDate** | Date when state e-filing should be scheduled for this form | [optional] | +|**recipientEdeliveryDate** | **LocalDate** | Date when recipient e-delivery should be scheduled for this form | [optional] | +|**tinMatch** | **Boolean** | Boolean indicating that TIN Matching should be scheduled for this form | [optional] | +|**noTin** | **Boolean** | No TIN indicator | [optional] | +|**addressVerification** | **Boolean** | Boolean indicating that address verification should be scheduled for this form | [optional] | +|**stateAndLocalWithholding** | [**StateAndLocalWithholding**](StateAndLocalWithholding.md) | State and local withholding information | [optional] | +|**secondTinNotice** | **Boolean** | Second TIN notice | [optional] | +|**federalEfileStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | Federal e-file status | [optional] [readonly] | +|**stateEfileStatus** | [**List<StateEfileStatusDetail>**](StateEfileStatusDetail.md) | State e-file status | [optional] [readonly] | +|**postalMailStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | Postal mail to recipient status | [optional] [readonly] | +|**tinMatchStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | TIN Match status | [optional] [readonly] | +|**addressVerificationStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | Address verification status | [optional] [readonly] | +|**eDeliveryStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | EDelivery status | [optional] [readonly] | +|**validationErrors** | [**List<ValidationError>**](ValidationError.md) | Validation errors | [optional] [readonly] | +|**createdAt** | **OffsetDateTime** | Date time when the record was created. | [optional] [readonly] | +|**updatedAt** | **OffsetDateTime** | Date time when the record was last updated. | [optional] [readonly] | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| _1099_NEC | "1099-NEC" | +| _1099_MISC | "1099-MISC" | +| _1099_DIV | "1099-DIV" | +| _1099_R | "1099-R" | +| _1099_K | "1099-K" | +| _1095_B | "1095-B" | +| _1042_S | "1042-S" | +| _1095_C | "1095-C" | +| _1099_INT | "1099-INT" | + + + +## Enum: TinTypeEnum + +| Name | Value | +|---- | -----| +| EMPTY | "Empty" | +| EIN | "EIN" | +| SSN | "SSN" | +| ITIN | "ITIN" | +| ATIN | "ATIN" | diff --git a/docs/A1099/V2/Form1099K.md b/docs/A1099/V2/Form1099K.md index c5cff45..72f1112 100644 --- a/docs/A1099/V2/Form1099K.md +++ b/docs/A1099/V2/Form1099K.md @@ -2,70 +2,71 @@ # Form1099K +Form 1099-K: Payment Card and Third Party Network Transactions ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**filerType** | [**FilerTypeEnum**](#FilerTypeEnum) | | [optional] | -|**paymentType** | [**PaymentTypeEnum**](#PaymentTypeEnum) | | [optional] | -|**paymentSettlementEntityNamePhoneNumber** | **String** | | [optional] | -|**grossAmountPaymentCard** | **Double** | | [optional] | -|**cardNotPresentTransactions** | **Double** | | [optional] | -|**merchantCategoryCode** | **String** | | [optional] | -|**paymentTransactionNumber** | **Double** | | [optional] | -|**federalIncomeTaxWithheld** | **Double** | | [optional] | -|**january** | **Double** | | [optional] | -|**february** | **Double** | | [optional] | -|**march** | **Double** | | [optional] | -|**april** | **Double** | | [optional] | -|**may** | **Double** | | [optional] | -|**june** | **Double** | | [optional] | -|**july** | **Double** | | [optional] | -|**august** | **Double** | | [optional] | -|**sept** | **Double** | | [optional] | -|**october** | **Double** | | [optional] | -|**november** | **Double** | | [optional] | -|**december** | **Double** | | [optional] | -|**id** | **String** | | [optional] | -|**type** | **String** | | [optional] | -|**issuerId** | **Integer** | | [optional] | -|**issuerReferenceId** | **String** | | [optional] | -|**issuerTin** | **String** | | [optional] | -|**taxYear** | **Integer** | | [optional] | -|**federalEfile** | **Boolean** | | [optional] | -|**federalEfileStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**stateEfile** | **Boolean** | | [optional] | -|**stateEfileStatus** | [**List<StateEfileStatusDetail>**](StateEfileStatusDetail.md) | | [optional] | -|**postalMail** | **Boolean** | | [optional] | -|**postalMailStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**tinMatch** | **Boolean** | | [optional] | -|**tinMatchStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**addressVerification** | **Boolean** | | [optional] | -|**addressVerificationStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**eDeliveryStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**referenceId** | **String** | | [optional] | -|**email** | **String** | | [optional] | -|**tinType** | **String** | | [optional] | -|**fatcaFilingRequirement** | **Boolean** | | [optional] | -|**tin** | **String** | | [optional] | -|**noTin** | **Boolean** | | [optional] | -|**secondTinNotice** | **Boolean** | | [optional] | -|**recipientName** | **String** | | [optional] | -|**recipientSecondName** | **String** | | [optional] | -|**address** | **String** | | [optional] | -|**address2** | **String** | | [optional] | -|**city** | **String** | | [optional] | -|**state** | **String** | | [optional] | -|**zip** | **String** | | [optional] | -|**nonUsProvince** | **String** | | [optional] | -|**countryCode** | **String** | | [optional] | -|**accountNumber** | **String** | | [optional] | -|**officeCode** | **String** | | [optional] | -|**validationErrors** | [**List<ValidationError>**](ValidationError.md) | | [optional] | -|**createdAt** | **OffsetDateTime** | | [optional] | -|**updatedAt** | **OffsetDateTime** | | [optional] | -|**stateAndLocalWithholding** | [**StateAndLocalWithholding**](StateAndLocalWithholding.md) | | [optional] | +|**filerType** | [**FilerTypeEnum**](#FilerTypeEnum) | Filer type (PSE or EPF) | [optional] | +|**paymentType** | [**PaymentTypeEnum**](#PaymentTypeEnum) | Payment type (payment card or third party network) | [optional] | +|**paymentSettlementEntityNamePhoneNumber** | **String** | Payment settlement entity name and phone number | [optional] | +|**grossAmountPaymentCard** | **Double** | Gross amount of payment card/third party network transactions | [optional] | +|**cardNotPresentTransactions** | **Double** | Card not present transactions | [optional] | +|**merchantCategoryCode** | **String** | Merchant category code | [optional] | +|**paymentTransactionNumber** | **Double** | Number of payment transactions | [optional] | +|**federalIncomeTaxWithheld** | **Double** | Federal income tax withheld | [optional] | +|**january** | **Double** | January gross payments | [optional] | +|**february** | **Double** | February gross payments | [optional] | +|**march** | **Double** | March gross payments | [optional] | +|**april** | **Double** | April gross payments | [optional] | +|**may** | **Double** | May gross payments | [optional] | +|**june** | **Double** | June gross payments | [optional] | +|**july** | **Double** | July gross payments | [optional] | +|**august** | **Double** | August gross payments | [optional] | +|**september** | **Double** | September gross payments | [optional] | +|**october** | **Double** | October gross payments | [optional] | +|**november** | **Double** | November gross payments | [optional] | +|**december** | **Double** | December gross payments | [optional] | +|**type** | [**TypeEnum**](#TypeEnum) | Form type | | +|**id** | **String** | Form ID. Unique identifier set when the record is created. | [optional] [readonly] | +|**issuerId** | **String** | Issuer ID - only required when creating forms | [optional] | +|**issuerReferenceId** | **String** | Issuer Reference ID - only required when creating forms | [optional] | +|**issuerTin** | **String** | Issuer TIN - readonly | [optional] | +|**taxYear** | **Integer** | Tax Year - only required when creating forms | [optional] | +|**referenceId** | **String** | Internal reference ID. Never shown to any agency or recipient. | [optional] | +|**tin** | **String** | Recipient's Federal Tax Identification Number (TIN). | [optional] | +|**recipientName** | **String** | Recipient name | | +|**tinType** | [**TinTypeEnum**](#TinTypeEnum) | Type of TIN (Tax ID Number) | [optional] | +|**recipientSecondName** | **String** | Recipient second name | [optional] | +|**address** | **String** | Address. | | +|**address2** | **String** | Address line 2. | [optional] | +|**city** | **String** | City. | | +|**state** | **String** | Two-letter US state or Canadian province code (required for US/CA addresses). | [optional] | +|**zip** | **String** | ZIP/postal code. | [optional] | +|**email** | **String** | Recipient's Contact email address. | [optional] | +|**accountNumber** | **String** | Account number | [optional] | +|**officeCode** | **String** | Office code | [optional] | +|**nonUsProvince** | **String** | Province or region for non-US/CA addresses. | [optional] | +|**countryCode** | **String** | Two-letter IRS country code (e.g., 'US', 'CA'), as defined at https://www.irs.gov/e-file-providers/country-codes. | | +|**federalEfileDate** | **LocalDate** | Date when federal e-filing should be scheduled for this form | [optional] | +|**postalMail** | **Boolean** | Boolean indicating that postal mailing to the recipient should be scheduled for this form | [optional] | +|**stateEfileDate** | **LocalDate** | Date when state e-filing should be scheduled for this form | [optional] | +|**recipientEdeliveryDate** | **LocalDate** | Date when recipient e-delivery should be scheduled for this form | [optional] | +|**tinMatch** | **Boolean** | Boolean indicating that TIN Matching should be scheduled for this form | [optional] | +|**noTin** | **Boolean** | No TIN indicator | [optional] | +|**addressVerification** | **Boolean** | Boolean indicating that address verification should be scheduled for this form | [optional] | +|**stateAndLocalWithholding** | [**StateAndLocalWithholding**](StateAndLocalWithholding.md) | State and local withholding information | [optional] | +|**secondTinNotice** | **Boolean** | Second TIN notice | [optional] | +|**federalEfileStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | Federal e-file status | [optional] [readonly] | +|**stateEfileStatus** | [**List<StateEfileStatusDetail>**](StateEfileStatusDetail.md) | State e-file status | [optional] [readonly] | +|**postalMailStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | Postal mail to recipient status | [optional] [readonly] | +|**tinMatchStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | TIN Match status | [optional] [readonly] | +|**addressVerificationStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | Address verification status | [optional] [readonly] | +|**eDeliveryStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | EDelivery status | [optional] [readonly] | +|**validationErrors** | [**List<ValidationError>**](ValidationError.md) | Validation errors | [optional] [readonly] | +|**createdAt** | **OffsetDateTime** | Date time when the record was created. | [optional] [readonly] | +|**updatedAt** | **OffsetDateTime** | Date time when the record was last updated. | [optional] [readonly] | @@ -88,3 +89,31 @@ +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| _1099_NEC | "1099-NEC" | +| _1099_MISC | "1099-MISC" | +| _1099_DIV | "1099-DIV" | +| _1099_R | "1099-R" | +| _1099_K | "1099-K" | +| _1095_B | "1095-B" | +| _1042_S | "1042-S" | +| _1095_C | "1095-C" | +| _1099_INT | "1099-INT" | + + + +## Enum: TinTypeEnum + +| Name | Value | +|---- | -----| +| EMPTY | "Empty" | +| EIN | "EIN" | +| SSN | "SSN" | +| ITIN | "ITIN" | +| ATIN | "ATIN" | + + + diff --git a/docs/A1099/V2/Form1099ListRequest.md b/docs/A1099/V2/Form1099ListRequest.md new file mode 100644 index 0000000..be8b894 --- /dev/null +++ b/docs/A1099/V2/Form1099ListRequest.md @@ -0,0 +1,30 @@ + + +# Form1099ListRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | [**TypeEnum**](#TypeEnum) | | [optional] | +|**forms** | [**List<Get1099Form200Response>**](Get1099Form200Response.md) | | [optional] | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| _1099_NEC | "1099-NEC" | +| _1099_MISC | "1099-MISC" | +| _1099_DIV | "1099-DIV" | +| _1099_R | "1099-R" | +| _1099_K | "1099-K" | +| _1095_B | "1095-B" | +| _1042_S | "1042-S" | +| _1095_C | "1095-C" | +| _1099_INT | "1099-INT" | + + + diff --git a/docs/A1099/V2/Form1099Misc.md b/docs/A1099/V2/Form1099Misc.md index 5cd260d..f3c0eca 100644 --- a/docs/A1099/V2/Form1099Misc.md +++ b/docs/A1099/V2/Form1099Misc.md @@ -2,64 +2,94 @@ # Form1099Misc +Form 1099-MISC: Miscellaneous Income ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**rents** | **Double** | | [optional] | -|**royalties** | **Double** | | [optional] | -|**otherIncome** | **Double** | | [optional] | -|**fedIncomeTaxWithheld** | **Double** | | [optional] | -|**fishingBoatProceeds** | **Double** | | [optional] | -|**medicalAndHealthCarePayments** | **Double** | | [optional] | -|**substitutePayments** | **Double** | | [optional] | -|**directSalesIndicator** | **Boolean** | | [optional] | -|**cropInsuranceProceeds** | **Double** | | [optional] | -|**excessGoldenParachutePayments** | **Double** | | [optional] | -|**grossProceedsPaidToAttorney** | **Double** | | [optional] | -|**fishPurchasedForResale** | **Double** | | [optional] | -|**section409ADeferrals** | **Double** | | [optional] | -|**nonqualifiedDeferredCompensation** | **Double** | | [optional] | -|**id** | **String** | | [optional] | -|**type** | **String** | | [optional] | -|**issuerId** | **Integer** | | [optional] | -|**issuerReferenceId** | **String** | | [optional] | -|**issuerTin** | **String** | | [optional] | -|**taxYear** | **Integer** | | [optional] | -|**federalEfile** | **Boolean** | | [optional] | -|**federalEfileStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**stateEfile** | **Boolean** | | [optional] | -|**stateEfileStatus** | [**List<StateEfileStatusDetail>**](StateEfileStatusDetail.md) | | [optional] | -|**postalMail** | **Boolean** | | [optional] | -|**postalMailStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**tinMatch** | **Boolean** | | [optional] | -|**tinMatchStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**addressVerification** | **Boolean** | | [optional] | -|**addressVerificationStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**eDeliveryStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**referenceId** | **String** | | [optional] | -|**email** | **String** | | [optional] | -|**tinType** | **String** | | [optional] | -|**fatcaFilingRequirement** | **Boolean** | | [optional] | -|**tin** | **String** | | [optional] | -|**noTin** | **Boolean** | | [optional] | -|**secondTinNotice** | **Boolean** | | [optional] | -|**recipientName** | **String** | | [optional] | -|**recipientSecondName** | **String** | | [optional] | -|**address** | **String** | | [optional] | -|**address2** | **String** | | [optional] | -|**city** | **String** | | [optional] | -|**state** | **String** | | [optional] | -|**zip** | **String** | | [optional] | -|**nonUsProvince** | **String** | | [optional] | -|**countryCode** | **String** | | [optional] | -|**accountNumber** | **String** | | [optional] | -|**officeCode** | **String** | | [optional] | -|**validationErrors** | [**List<ValidationError>**](ValidationError.md) | | [optional] | -|**createdAt** | **OffsetDateTime** | | [optional] | -|**updatedAt** | **OffsetDateTime** | | [optional] | -|**stateAndLocalWithholding** | [**StateAndLocalWithholding**](StateAndLocalWithholding.md) | | [optional] | +|**rents** | **Double** | Rents | [optional] | +|**royalties** | **Double** | Royalties | [optional] | +|**otherIncome** | **Double** | Other income | [optional] | +|**federalIncomeTaxWithheld** | **Double** | Federal income tax withheld | [optional] | +|**fishingBoatProceeds** | **Double** | Fishing boat proceeds | [optional] | +|**medicalAndHealthCarePayments** | **Double** | Medical and health care payments | [optional] | +|**directSalesIndicator** | **Boolean** | Payer made direct sales totaling $5,000 or more of consumer products to recipient for resale | [optional] | +|**substitutePayments** | **Double** | Substitute payments in lieu of dividends or interest | [optional] | +|**cropInsuranceProceeds** | **Double** | Crop insurance proceeds | [optional] | +|**grossProceedsPaidToAttorney** | **Double** | Gross proceeds paid to an attorney | [optional] | +|**fishPurchasedForResale** | **Double** | Fish purchased for resale | [optional] | +|**section409ADeferrals** | **Double** | Section 409A deferrals | [optional] | +|**excessGoldenParachutePayments** | **Double** | (Legacy field) Excess golden parachute payments | [optional] | +|**nonqualifiedDeferredCompensation** | **Double** | Nonqualified deferred compensation | [optional] | +|**fatcaFilingRequirement** | **Boolean** | FATCA filing requirement | [optional] | +|**type** | [**TypeEnum**](#TypeEnum) | Form type | | +|**id** | **String** | Form ID. Unique identifier set when the record is created. | [optional] [readonly] | +|**issuerId** | **String** | Issuer ID - only required when creating forms | [optional] | +|**issuerReferenceId** | **String** | Issuer Reference ID - only required when creating forms | [optional] | +|**issuerTin** | **String** | Issuer TIN - readonly | [optional] | +|**taxYear** | **Integer** | Tax Year - only required when creating forms | [optional] | +|**referenceId** | **String** | Internal reference ID. Never shown to any agency or recipient. | [optional] | +|**tin** | **String** | Recipient's Federal Tax Identification Number (TIN). | [optional] | +|**recipientName** | **String** | Recipient name | | +|**tinType** | [**TinTypeEnum**](#TinTypeEnum) | Type of TIN (Tax ID Number) | [optional] | +|**recipientSecondName** | **String** | Recipient second name | [optional] | +|**address** | **String** | Address. | | +|**address2** | **String** | Address line 2. | [optional] | +|**city** | **String** | City. | | +|**state** | **String** | Two-letter US state or Canadian province code (required for US/CA addresses). | [optional] | +|**zip** | **String** | ZIP/postal code. | [optional] | +|**email** | **String** | Recipient's Contact email address. | [optional] | +|**accountNumber** | **String** | Account number | [optional] | +|**officeCode** | **String** | Office code | [optional] | +|**nonUsProvince** | **String** | Province or region for non-US/CA addresses. | [optional] | +|**countryCode** | **String** | Two-letter IRS country code (e.g., 'US', 'CA'), as defined at https://www.irs.gov/e-file-providers/country-codes. | | +|**federalEfileDate** | **LocalDate** | Date when federal e-filing should be scheduled for this form | [optional] | +|**postalMail** | **Boolean** | Boolean indicating that postal mailing to the recipient should be scheduled for this form | [optional] | +|**stateEfileDate** | **LocalDate** | Date when state e-filing should be scheduled for this form | [optional] | +|**recipientEdeliveryDate** | **LocalDate** | Date when recipient e-delivery should be scheduled for this form | [optional] | +|**tinMatch** | **Boolean** | Boolean indicating that TIN Matching should be scheduled for this form | [optional] | +|**noTin** | **Boolean** | No TIN indicator | [optional] | +|**addressVerification** | **Boolean** | Boolean indicating that address verification should be scheduled for this form | [optional] | +|**stateAndLocalWithholding** | [**StateAndLocalWithholding**](StateAndLocalWithholding.md) | State and local withholding information | [optional] | +|**secondTinNotice** | **Boolean** | Second TIN notice | [optional] | +|**federalEfileStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | Federal e-file status | [optional] [readonly] | +|**stateEfileStatus** | [**List<StateEfileStatusDetail>**](StateEfileStatusDetail.md) | State e-file status | [optional] [readonly] | +|**postalMailStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | Postal mail to recipient status | [optional] [readonly] | +|**tinMatchStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | TIN Match status | [optional] [readonly] | +|**addressVerificationStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | Address verification status | [optional] [readonly] | +|**eDeliveryStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | EDelivery status | [optional] [readonly] | +|**validationErrors** | [**List<ValidationError>**](ValidationError.md) | Validation errors | [optional] [readonly] | +|**createdAt** | **OffsetDateTime** | Date time when the record was created. | [optional] [readonly] | +|**updatedAt** | **OffsetDateTime** | Date time when the record was last updated. | [optional] [readonly] | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| _1099_NEC | "1099-NEC" | +| _1099_MISC | "1099-MISC" | +| _1099_DIV | "1099-DIV" | +| _1099_R | "1099-R" | +| _1099_K | "1099-K" | +| _1095_B | "1095-B" | +| _1042_S | "1042-S" | +| _1095_C | "1095-C" | +| _1099_INT | "1099-INT" | + + + +## Enum: TinTypeEnum + +| Name | Value | +|---- | -----| +| EMPTY | "Empty" | +| EIN | "EIN" | +| SSN | "SSN" | +| ITIN | "ITIN" | +| ATIN | "ATIN" | diff --git a/docs/A1099/V2/Form1099Nec.md b/docs/A1099/V2/Form1099Nec.md index edba895..179b854 100644 --- a/docs/A1099/V2/Form1099Nec.md +++ b/docs/A1099/V2/Form1099Nec.md @@ -7,48 +7,76 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**nonemployeeCompensation** | **Double** | | [optional] | -|**federalIncomeTaxWithheld** | **Double** | | [optional] | -|**directSalesIndicator** | **Boolean** | | [optional] | -|**id** | **String** | | [optional] | -|**type** | **String** | | [optional] | -|**issuerId** | **Integer** | | [optional] | -|**issuerReferenceId** | **String** | | [optional] | -|**issuerTin** | **String** | | [optional] | -|**taxYear** | **Integer** | | [optional] | -|**federalEfile** | **Boolean** | | [optional] | -|**federalEfileStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**stateEfile** | **Boolean** | | [optional] | -|**stateEfileStatus** | [**List<StateEfileStatusDetail>**](StateEfileStatusDetail.md) | | [optional] | -|**postalMail** | **Boolean** | | [optional] | -|**postalMailStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**tinMatch** | **Boolean** | | [optional] | -|**tinMatchStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**addressVerification** | **Boolean** | | [optional] | -|**addressVerificationStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**eDeliveryStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**referenceId** | **String** | | [optional] | -|**email** | **String** | | [optional] | -|**tinType** | **String** | | [optional] | -|**fatcaFilingRequirement** | **Boolean** | | [optional] | -|**tin** | **String** | | [optional] | -|**noTin** | **Boolean** | | [optional] | -|**secondTinNotice** | **Boolean** | | [optional] | -|**recipientName** | **String** | | [optional] | -|**recipientSecondName** | **String** | | [optional] | -|**address** | **String** | | [optional] | -|**address2** | **String** | | [optional] | -|**city** | **String** | | [optional] | -|**state** | **String** | | [optional] | -|**zip** | **String** | | [optional] | -|**nonUsProvince** | **String** | | [optional] | -|**countryCode** | **String** | | [optional] | -|**accountNumber** | **String** | | [optional] | -|**officeCode** | **String** | | [optional] | -|**validationErrors** | [**List<ValidationError>**](ValidationError.md) | | [optional] | -|**createdAt** | **OffsetDateTime** | | [optional] | -|**updatedAt** | **OffsetDateTime** | | [optional] | -|**stateAndLocalWithholding** | [**StateAndLocalWithholding**](StateAndLocalWithholding.md) | | [optional] | +|**nonemployeeCompensation** | **Double** | Nonemployee compensation | | +|**directSalesIndicator** | **Boolean** | Payer made direct sales totaling $5,000 or more of consumer products to recipient for resale | [optional] | +|**federalIncomeTaxWithheld** | **Double** | Federal income tax withheld | [optional] | +|**type** | [**TypeEnum**](#TypeEnum) | Form type | | +|**id** | **String** | Form ID. Unique identifier set when the record is created. | [optional] [readonly] | +|**issuerId** | **String** | Issuer ID - only required when creating forms | [optional] | +|**issuerReferenceId** | **String** | Issuer Reference ID - only required when creating forms | [optional] | +|**issuerTin** | **String** | Issuer TIN - readonly | [optional] | +|**taxYear** | **Integer** | Tax Year - only required when creating forms | [optional] | +|**referenceId** | **String** | Internal reference ID. Never shown to any agency or recipient. | [optional] | +|**tin** | **String** | Recipient's Federal Tax Identification Number (TIN). | [optional] | +|**recipientName** | **String** | Recipient name | | +|**tinType** | [**TinTypeEnum**](#TinTypeEnum) | Type of TIN (Tax ID Number) | [optional] | +|**recipientSecondName** | **String** | Recipient second name | [optional] | +|**address** | **String** | Address. | | +|**address2** | **String** | Address line 2. | [optional] | +|**city** | **String** | City. | | +|**state** | **String** | Two-letter US state or Canadian province code (required for US/CA addresses). | [optional] | +|**zip** | **String** | ZIP/postal code. | [optional] | +|**email** | **String** | Recipient's Contact email address. | [optional] | +|**accountNumber** | **String** | Account number | [optional] | +|**officeCode** | **String** | Office code | [optional] | +|**nonUsProvince** | **String** | Province or region for non-US/CA addresses. | [optional] | +|**countryCode** | **String** | Two-letter IRS country code (e.g., 'US', 'CA'), as defined at https://www.irs.gov/e-file-providers/country-codes. | | +|**federalEfileDate** | **LocalDate** | Date when federal e-filing should be scheduled for this form | [optional] | +|**postalMail** | **Boolean** | Boolean indicating that postal mailing to the recipient should be scheduled for this form | [optional] | +|**stateEfileDate** | **LocalDate** | Date when state e-filing should be scheduled for this form | [optional] | +|**recipientEdeliveryDate** | **LocalDate** | Date when recipient e-delivery should be scheduled for this form | [optional] | +|**tinMatch** | **Boolean** | Boolean indicating that TIN Matching should be scheduled for this form | [optional] | +|**noTin** | **Boolean** | No TIN indicator | [optional] | +|**addressVerification** | **Boolean** | Boolean indicating that address verification should be scheduled for this form | [optional] | +|**stateAndLocalWithholding** | [**StateAndLocalWithholding**](StateAndLocalWithholding.md) | State and local withholding information | [optional] | +|**secondTinNotice** | **Boolean** | Second TIN notice | [optional] | +|**federalEfileStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | Federal e-file status | [optional] [readonly] | +|**stateEfileStatus** | [**List<StateEfileStatusDetail>**](StateEfileStatusDetail.md) | State e-file status | [optional] [readonly] | +|**postalMailStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | Postal mail to recipient status | [optional] [readonly] | +|**tinMatchStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | TIN Match status | [optional] [readonly] | +|**addressVerificationStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | Address verification status | [optional] [readonly] | +|**eDeliveryStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | EDelivery status | [optional] [readonly] | +|**validationErrors** | [**List<ValidationError>**](ValidationError.md) | Validation errors | [optional] [readonly] | +|**createdAt** | **OffsetDateTime** | Date time when the record was created. | [optional] [readonly] | +|**updatedAt** | **OffsetDateTime** | Date time when the record was last updated. | [optional] [readonly] | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| _1099_NEC | "1099-NEC" | +| _1099_MISC | "1099-MISC" | +| _1099_DIV | "1099-DIV" | +| _1099_R | "1099-R" | +| _1099_K | "1099-K" | +| _1095_B | "1095-B" | +| _1042_S | "1042-S" | +| _1095_C | "1095-C" | +| _1099_INT | "1099-INT" | + + + +## Enum: TinTypeEnum + +| Name | Value | +|---- | -----| +| EMPTY | "Empty" | +| EIN | "EIN" | +| SSN | "SSN" | +| ITIN | "ITIN" | +| ATIN | "ATIN" | diff --git a/docs/A1099/V2/Form1099R.md b/docs/A1099/V2/Form1099R.md index fae524a..e87993c 100644 --- a/docs/A1099/V2/Form1099R.md +++ b/docs/A1099/V2/Form1099R.md @@ -2,69 +2,99 @@ # Form1099R +Form 1099-R: Distributions From Pensions, Annuities, Retirement or Profit-Sharing Plans, IRAs, Insurance Contracts, etc. ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**grossDistributions** | **Double** | | [optional] | -|**taxableAmount** | **Double** | | [optional] | -|**taxableAmountNotDetermined** | **Boolean** | | [optional] | -|**totalDistributionIndicator** | **Boolean** | | [optional] | -|**capitalGain** | **Double** | | [optional] | -|**fedIncomeTaxWithheld** | **Double** | | [optional] | -|**employeeContributions** | **Double** | | [optional] | -|**netUnrealizedAppreciation** | **Double** | | [optional] | -|**distributionCodeRequired** | **String** | | [optional] | -|**distributionCodeOptional** | **String** | | [optional] | -|**iraSepSimpleIndicator** | **Boolean** | | [optional] | -|**totalIraSepSimpleDistribution** | **Double** | | [optional] | -|**other** | **Double** | | [optional] | -|**otherPercent** | **String** | | [optional] | -|**percentageTotalDistribution** | **String** | | [optional] | -|**totalEmployeeContributions** | **Double** | | [optional] | -|**amountAllocableToIrr** | **Double** | | [optional] | -|**firstYearDesignatedRothContrib** | **String** | | [optional] | -|**dateOfPayment** | **String** | | [optional] | -|**id** | **String** | | [optional] | -|**type** | **String** | | [optional] | -|**issuerId** | **Integer** | | [optional] | -|**issuerReferenceId** | **String** | | [optional] | -|**issuerTin** | **String** | | [optional] | -|**taxYear** | **Integer** | | [optional] | -|**federalEfile** | **Boolean** | | [optional] | -|**federalEfileStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**stateEfile** | **Boolean** | | [optional] | -|**stateEfileStatus** | [**List<StateEfileStatusDetail>**](StateEfileStatusDetail.md) | | [optional] | -|**postalMail** | **Boolean** | | [optional] | -|**postalMailStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**tinMatch** | **Boolean** | | [optional] | -|**tinMatchStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**addressVerification** | **Boolean** | | [optional] | -|**addressVerificationStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**eDeliveryStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | | [optional] | -|**referenceId** | **String** | | [optional] | -|**email** | **String** | | [optional] | -|**tinType** | **String** | | [optional] | -|**fatcaFilingRequirement** | **Boolean** | | [optional] | -|**tin** | **String** | | [optional] | -|**noTin** | **Boolean** | | [optional] | -|**secondTinNotice** | **Boolean** | | [optional] | -|**recipientName** | **String** | | [optional] | -|**recipientSecondName** | **String** | | [optional] | -|**address** | **String** | | [optional] | -|**address2** | **String** | | [optional] | -|**city** | **String** | | [optional] | -|**state** | **String** | | [optional] | -|**zip** | **String** | | [optional] | -|**nonUsProvince** | **String** | | [optional] | -|**countryCode** | **String** | | [optional] | -|**accountNumber** | **String** | | [optional] | -|**officeCode** | **String** | | [optional] | -|**validationErrors** | [**List<ValidationError>**](ValidationError.md) | | [optional] | -|**createdAt** | **OffsetDateTime** | | [optional] | -|**updatedAt** | **OffsetDateTime** | | [optional] | -|**stateAndLocalWithholding** | [**StateAndLocalWithholding**](StateAndLocalWithholding.md) | | [optional] | +|**grossDistribution** | **Double** | Gross distribution | [optional] | +|**taxableAmount** | **Double** | Taxable amount | [optional] | +|**taxableAmountNotDetermined** | **Boolean** | Taxable amount not determined | [optional] | +|**totalDistributionDetermined** | **Boolean** | Total distribution | [optional] | +|**capitalGain** | **Double** | Capital gain (included in Box 2a) | [optional] | +|**federalIncomeTaxWithheld** | **Double** | Federal income tax withheld | [optional] | +|**employeeContributionsOrDesignatedRothOrInsurancePremiums** | **Double** | Employee contributions/Designated Roth contributions or insurance premiums | [optional] | +|**netUnrealizedAppreciationInEmployerSecurities** | **Double** | Net unrealized appreciation in employer's securities | [optional] | +|**distributionCode** | **String** | Distribution code | [optional] | +|**secondDistributionCode** | **String** | Second distribution code | [optional] | +|**iraSepSimple** | **Boolean** | IRA/SEP/SIMPLE | [optional] | +|**traditionalIraSepSimpleOrRothConversionAmount** | **Double** | Traditional IRA/SEP/SIMPLE or Roth conversion amount | [optional] | +|**otherAmount** | **Double** | Other amount | [optional] | +|**otherPercentage** | **String** | Other percentage | [optional] | +|**totalDistributionPercentage** | **String** | Total distribution percentage | [optional] | +|**totalEmployeeContributions** | **Double** | Total employee contributions | [optional] | +|**amountAllocableToIrrWithin5Years** | **Double** | Amount allocable to IRR within 5 years | [optional] | +|**firstYearOfDesignatedRothContribution** | **String** | First year of designated Roth contribution | [optional] | +|**dateOfPayment** | **LocalDate** | Date of payment | [optional] | +|**fatcaFilingRequirement** | **Boolean** | FATCA filing requirement | [optional] | +|**type** | [**TypeEnum**](#TypeEnum) | Form type | | +|**id** | **String** | Form ID. Unique identifier set when the record is created. | [optional] [readonly] | +|**issuerId** | **String** | Issuer ID - only required when creating forms | [optional] | +|**issuerReferenceId** | **String** | Issuer Reference ID - only required when creating forms | [optional] | +|**issuerTin** | **String** | Issuer TIN - readonly | [optional] | +|**taxYear** | **Integer** | Tax Year - only required when creating forms | [optional] | +|**referenceId** | **String** | Internal reference ID. Never shown to any agency or recipient. | [optional] | +|**tin** | **String** | Recipient's Federal Tax Identification Number (TIN). | [optional] | +|**recipientName** | **String** | Recipient name | | +|**tinType** | [**TinTypeEnum**](#TinTypeEnum) | Type of TIN (Tax ID Number) | [optional] | +|**recipientSecondName** | **String** | Recipient second name | [optional] | +|**address** | **String** | Address. | | +|**address2** | **String** | Address line 2. | [optional] | +|**city** | **String** | City. | | +|**state** | **String** | Two-letter US state or Canadian province code (required for US/CA addresses). | [optional] | +|**zip** | **String** | ZIP/postal code. | [optional] | +|**email** | **String** | Recipient's Contact email address. | [optional] | +|**accountNumber** | **String** | Account number | [optional] | +|**officeCode** | **String** | Office code | [optional] | +|**nonUsProvince** | **String** | Province or region for non-US/CA addresses. | [optional] | +|**countryCode** | **String** | Two-letter IRS country code (e.g., 'US', 'CA'), as defined at https://www.irs.gov/e-file-providers/country-codes. | | +|**federalEfileDate** | **LocalDate** | Date when federal e-filing should be scheduled for this form | [optional] | +|**postalMail** | **Boolean** | Boolean indicating that postal mailing to the recipient should be scheduled for this form | [optional] | +|**stateEfileDate** | **LocalDate** | Date when state e-filing should be scheduled for this form | [optional] | +|**recipientEdeliveryDate** | **LocalDate** | Date when recipient e-delivery should be scheduled for this form | [optional] | +|**tinMatch** | **Boolean** | Boolean indicating that TIN Matching should be scheduled for this form | [optional] | +|**noTin** | **Boolean** | No TIN indicator | [optional] | +|**addressVerification** | **Boolean** | Boolean indicating that address verification should be scheduled for this form | [optional] | +|**stateAndLocalWithholding** | [**StateAndLocalWithholding**](StateAndLocalWithholding.md) | State and local withholding information | [optional] | +|**secondTinNotice** | **Boolean** | Second TIN notice | [optional] | +|**federalEfileStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | Federal e-file status | [optional] [readonly] | +|**stateEfileStatus** | [**List<StateEfileStatusDetail>**](StateEfileStatusDetail.md) | State e-file status | [optional] [readonly] | +|**postalMailStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | Postal mail to recipient status | [optional] [readonly] | +|**tinMatchStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | TIN Match status | [optional] [readonly] | +|**addressVerificationStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | Address verification status | [optional] [readonly] | +|**eDeliveryStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | EDelivery status | [optional] [readonly] | +|**validationErrors** | [**List<ValidationError>**](ValidationError.md) | Validation errors | [optional] [readonly] | +|**createdAt** | **OffsetDateTime** | Date time when the record was created. | [optional] [readonly] | +|**updatedAt** | **OffsetDateTime** | Date time when the record was last updated. | [optional] [readonly] | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| _1099_NEC | "1099-NEC" | +| _1099_MISC | "1099-MISC" | +| _1099_DIV | "1099-DIV" | +| _1099_R | "1099-R" | +| _1099_K | "1099-K" | +| _1095_B | "1095-B" | +| _1042_S | "1042-S" | +| _1095_C | "1095-C" | +| _1099_INT | "1099-INT" | + + + +## Enum: TinTypeEnum + +| Name | Value | +|---- | -----| +| EMPTY | "Empty" | +| EIN | "EIN" | +| SSN | "SSN" | +| ITIN | "ITIN" | +| ATIN | "ATIN" | diff --git a/docs/A1099/V2/Forms1099Api.md b/docs/A1099/V2/Forms1099Api.md index 8737dea..94ffc42 100644 --- a/docs/A1099/V2/Forms1099Api.md +++ b/docs/A1099/V2/Forms1099Api.md @@ -1,6 +1,6 @@ # Forms1099Api -All URIs are relative to *https://api-ava1099.eta.sbx.us-east-1.aws.avalara.io/avalara1099* +All URIs are relative to *https://api.sbx.avalara.com/avalara1099* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -16,11 +16,11 @@ Method | HTTP request | Description ## bulkUpsert1099Forms -> Form1099ProccessResult bulkUpsert1099Forms(avalaraVersion, dryRun, xCorrelationId, xAvalaraClient, bulkUpsert1099FormsRequest) +> JobResponse bulkUpsert1099Forms(avalaraVersion, dryRun, xCorrelationId, xAvalaraClient, form1099ListRequest) Create or update multiple 1099/1095/W2/1042S forms -This endpoint allows you to create or update multiple 1099/1095/W2/1042S forms. You can use one of the following payload structures: **Form 1099-MISC:** ```json { \"formType\": \"1099-MISC\", \"forms\": [ { \"IssuerId\": \"123456\", \"IssuerReferenceId\": \"REF123\", \"IssuerTin\": \"12-3456789\", \"TaxYear\": 2023, \"ReferenceId\": \"FORM123456\", \"RecipientName\": \"John Doe\", \"RecipientTin\": \"587-65-4321\", \"TinType\": \"SSN\", \"RecipientSecondName\": \"Jane Doe\", \"Address\": \"123 Main Street\", \"Address2\": \"Apt 4B\", \"City\": \"New York\", \"State\": \"NY\", \"Zip\": \"10001\", \"Email\": \"john.doe@email.com\", \"AccountNumber\": \"ACC123456\", \"OfficeCode\": \"NYC01\", \"SecondTinNotice\": false, \"NonUsProvince\": \"\", \"CountryCode\": \"US\", \"Rents\": 12000.00, \"Royalties\": 5000.00, \"OtherIncome\": 3000.00, \"FishingBoatProceeds\": 0.00, \"MedicalAndHealthCarePayments\": 15000.00, \"SubstitutePayments\": 1000.00, \"CropInsuranceProceeds\": 0.00, \"GrossProceedsPaidToAttorney\": 7500.00, \"FishPurchasedForResale\": 0.00, \"FedIncomeTaxWithheld\": 5000.00, \"Section409ADeferrals\": 0.00, \"ExcessGoldenParachutePayments\": 0.00, \"NonqualifiedDeferredCompensation\": 0.00, \"DirectSalesIndicator\": false, \"FatcaFilingRequirement\": false, \"StateAndLocalWithholding\": { \"StateTaxWithheld\": 2500.00, \"LocalTaxWithheld\": 1000.00, \"State\": \"NY\", \"StateIdNumber\": \"NY123456\", \"Locality\": \"New York City\", \"StateIncome\": 35000.00, \"LocalIncome\": 35000.00 } } ] } ``` **Form 1099-NEC:** ```json { \"formType\": \"1099-NEC\", \"forms\": [ { \"issuerID\": \"180337282\", \"issuerReferenceId\": \"ISS123\", \"issuerTin\": \"12-3000000\", \"taxYear\": 2024, \"referenceID\": \"REF-002\", \"recipientName\": \"Jane Smith\", \"recipientSecondName\": \"\", \"recipientTin\": \"587-65-4321\", \"tinType\": \"SSN\", \"address\": \"123 Center St\", \"address2\": \"\", \"city\": \"Santa Monica\", \"state\": \"CA\", \"zip\": \"90401\", \"countryCode\": \"US\", \"nonUsProvince\": \"\", \"email\": \"\", \"accountNumber\": \"\", \"officeCode\": \"\", \"secondTinNotice\": false, \"nonemployeeCompensation\": 123.45, \"directSalesIndicator\": false, \"federalIncomeTaxWithheld\": 12.34, \"stateAndLocalWithholding\": { \"state\": \"CA\", \"stateIdNumber\": \"123123123\", \"stateIncome\": 123.45, \"stateTaxWithheld\": 12.34, \"locality\": \"Santa Monica\", \"localityIdNumber\": \"456456\", \"localTaxWithheld\": 12.34, \"localIncome\": 50000.00 }, \"federalEFile\": true, \"postalMail\": true, \"stateEFile\": true, \"tinMatch\": true, \"addressVerification\": true } ] } ``` For the full version of the payload and its schema details, refer to the Swagger schemas section. +This endpoint allows you to create or update multiple 1099/1095/W2/1042S forms. Maximum of 5000 forms can be processed in a single bulk request. ### Example @@ -51,12 +51,12 @@ public class Example { Forms1099Api apiInstance = new Forms1099Api(apiClient); String avalaraVersion = "2.0.0"; // String | API version - Boolean dryRun = false; // Boolean | - String xCorrelationId = "fc005c04-52f7-44d6-bf16-6551603a8324"; // String | Unique correlation Id in a GUID format + Boolean dryRun = false; // Boolean | defaults to false. If true, it will NOT change the DB. It will just return a report of what would've have been changed in the DB + String xCorrelationId = "8dc909fe-720e-43fb-b983-58faed44f2fa"; // String | Unique correlation Id in a GUID format String xAvalaraClient = "Swagger UI; 22.1.0"; // String | Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . - BulkUpsert1099FormsRequest bulkUpsert1099FormsRequest = new BulkUpsert1099FormsRequest(); // BulkUpsert1099FormsRequest | + Form1099ListRequest form1099ListRequest = new Form1099ListRequest(); // Form1099ListRequest | try { - Form1099ProccessResult result = apiInstance.bulkUpsert1099Forms(avalaraVersion, dryRun, xCorrelationId, xAvalaraClient, bulkUpsert1099FormsRequest); + JobResponse result = apiInstance.bulkUpsert1099Forms(avalaraVersion, dryRun, xCorrelationId, xAvalaraClient, form1099ListRequest); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling Forms1099Api#bulkUpsert1099Forms"); @@ -75,14 +75,14 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **avalaraVersion** | **String**| API version | - **dryRun** | **Boolean**| | [optional] [default to false] + **dryRun** | **Boolean**| defaults to false. If true, it will NOT change the DB. It will just return a report of what would've have been changed in the DB | [optional] [default to false] **xCorrelationId** | **String**| Unique correlation Id in a GUID format | [optional] **xAvalaraClient** | **String**| Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . | [optional] - **bulkUpsert1099FormsRequest** | [**BulkUpsert1099FormsRequest**](BulkUpsert1099FormsRequest.md)| | [optional] + **form1099ListRequest** | [**Form1099ListRequest**](Form1099ListRequest.md)| | [optional] ### Return type -[**Form1099ProccessResult**](Form1099ProccessResult.md) +[**JobResponse**](JobResponse.md) ### Authorization @@ -106,7 +106,7 @@ Name | Type | Description | Notes ## create1099Form -> Create1099Form201Response create1099Form(avalaraVersion, xCorrelationId, xAvalaraClient, icreateForm1099Request) +> Get1099Form200Response create1099Form(avalaraVersion, xCorrelationId, xAvalaraClient, get1099Form200Response) Create a 1099/1095/W2/1042S form @@ -141,11 +141,11 @@ public class Example { Forms1099Api apiInstance = new Forms1099Api(apiClient); String avalaraVersion = "2.0.0"; // String | API version - String xCorrelationId = "13eb4eb0-0e7d-41e3-adf3-61b131c1a92c"; // String | Unique correlation Id in a GUID format + String xCorrelationId = "ad4f746f-04e3-4a59-8f2a-71982cba7d13"; // String | Unique correlation Id in a GUID format String xAvalaraClient = "Swagger UI; 22.1.0"; // String | Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . - ICreateForm1099Request icreateForm1099Request = new ICreateForm1099Request(); // ICreateForm1099Request | + Get1099Form200Response get1099Form200Response = new Get1099Form200Response(); // Get1099Form200Response | try { - Create1099Form201Response result = apiInstance.create1099Form(avalaraVersion, xCorrelationId, xAvalaraClient, icreateForm1099Request); + Get1099Form200Response result = apiInstance.create1099Form(avalaraVersion, xCorrelationId, xAvalaraClient, get1099Form200Response); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling Forms1099Api#create1099Form"); @@ -166,11 +166,11 @@ Name | Type | Description | Notes **avalaraVersion** | **String**| API version | **xCorrelationId** | **String**| Unique correlation Id in a GUID format | [optional] **xAvalaraClient** | **String**| Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . | [optional] - **icreateForm1099Request** | [**ICreateForm1099Request**](ICreateForm1099Request.md)| | [optional] + **get1099Form200Response** | [**Get1099Form200Response**](Get1099Form200Response.md)| | [optional] ### Return type -[**Create1099Form201Response**](Create1099Form201Response.md) +[**Get1099Form200Response**](Get1099Form200Response.md) ### Authorization @@ -229,7 +229,7 @@ public class Example { Forms1099Api apiInstance = new Forms1099Api(apiClient); String id = "id_example"; // String | The unique identifier of the desired form to delete. String avalaraVersion = "2.0.0"; // String | API version - String xCorrelationId = "2bcc9cf0-9638-46d5-a792-be61566e0651"; // String | Unique correlation Id in a GUID format + String xCorrelationId = "275dadca-90a3-446a-b0fa-bc0dbaa2b6ef"; // String | Unique correlation Id in a GUID format String xAvalaraClient = "Swagger UI; 22.1.0"; // String | Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . try { apiInstance.delete1099Form(id, avalaraVersion, xCorrelationId, xAvalaraClient); @@ -317,7 +317,7 @@ public class Example { Forms1099Api apiInstance = new Forms1099Api(apiClient); String id = "id_example"; // String | String avalaraVersion = "2.0.0"; // String | API version - String xCorrelationId = "6e842a03-8b64-4b02-8c5e-7073bf4e8a8c"; // String | Unique correlation Id in a GUID format + String xCorrelationId = "90f6f993-5bc8-491a-a091-0a9796c654b6"; // String | Unique correlation Id in a GUID format String xAvalaraClient = "Swagger UI; 22.1.0"; // String | Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . try { Get1099Form200Response result = apiInstance.get1099Form(id, avalaraVersion, xCorrelationId, xAvalaraClient); @@ -406,7 +406,7 @@ public class Example { String id = "id_example"; // String | The ID of the form String avalaraVersion = "2.0.0"; // String | API version Boolean markEdelivered = true; // Boolean | Optional boolean that if set indicates that the form should be marked as having been successfully edelivered - String xCorrelationId = "7b4aa70b-3a10-4fa0-bf19-7592170409b7"; // String | Unique correlation Id in a GUID format + String xCorrelationId = "c159dc0f-6a68-4e21-921f-125572625a71"; // String | Unique correlation Id in a GUID format String xAvalaraClient = "Swagger UI; 22.1.0"; // String | Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . try { File result = apiInstance.get1099FormPdf(id, avalaraVersion, markEdelivered, xCorrelationId, xAvalaraClient); @@ -459,11 +459,11 @@ Name | Type | Description | Notes ## list1099Forms -> Form1099ListResponse list1099Forms(avalaraVersion, $filter, $top, $skip, $orderBy, xCorrelationId, xAvalaraClient) +> PaginatedQueryResultModelForm1099Base list1099Forms(avalaraVersion, $filter, $top, $skip, $orderBy, count, countOnly, xCorrelationId, xAvalaraClient) List 1099/1095/W2/1042S forms -List 1099/1095/W2/1042S forms. Filterable fields are name, referenceId and taxYear. +List 1099/1095/W2/1042S forms. Collections support filtering only on certain fields. An attempt to filter on an unsupported field will receive a 400 Bad Request response. Supported filtering fields are as follows: - issuerId - issuerReferenceId - taxYear - addressVerificationStatus - possible values are: unknown, pending, failed, incomplete, unchanged, verified - createdAt - edeliveryStatus - possible values are: sent, unscheduled, bad_verify, bad_verify_limit, scheduled, bounced, accepted - email - federalEfileStatus - possible values are: unscheduled, scheduled, sent, corrected_scheduled, accepted, corrected, corrected_accepted, held - recipientName - mailStatus - possible values are: sent, unscheduled, pending, delivered - referenceId - tinMatchStatus - possible values are: none, pending, matched, failed - type - possible values are: 940, 941, 943, 944, 945, 1042, 1042-S, 1095-B, 1095-C, 1097-BTC, 1098, 1098-C, 1098-E, 1098-Q, 1098-T, 3921, 3922, 5498, 5498-ESA, 5498-SA, 1099-MISC, 1099-A, 1099-B, 1099-C, 1099-CAP, 1099-DIV, 1099-G, 1099-INT, 1099-K, 1099-LS, 1099-LTC, 1099-NEC, 1099-OID, 1099-PATR, 1099-Q, 1099-R, 1099-S, 1099-SA, T4A, W-2, W-2G, 1099-HC - updatedAt - validity - possible values are: true, false For more information on filtering, see <see href=\"https://developer.avalara.com/avatax/filtering-in-rest/\">Filtering in REST</see>. ### Example @@ -494,14 +494,16 @@ public class Example { Forms1099Api apiInstance = new Forms1099Api(apiClient); String avalaraVersion = "2.0.0"; // String | API version - String $filter = "issuerId eq 884781823"; // String | A filter statement to identify specific records to retrieve. For more information on filtering, see Filtering in REST. Collections support filtering only on certain fields. An attempt to filter on an unsupported field will receive a 400 Bad Request response. Supported filtering fields are as follows: issuerId issuerReferenceId taxYear addressVerificationStatus - possible values are: unknown, pending, failed, incomplete, unchanged, verified createdAt edeliveryStatus - possible values are: sent, unscheduled, bad_verify, bad_verify_limit, scheduled, bounced, accepted email federalEfileStatus - possible values are: unscheduled, scheduled, sent, corrected_scheduled, accepted, corrected, corrected_accepted, held recipientName mailStatus - possible values are: sent, unscheduled, pending, delivered referenceId tinMatchStatus - possible values are: none, pending, matched, failed type - possible values are: 940, 941, 943, 944, 945, 1042, 1042-S, 1095-B, 1095-C, 1097-BTC, 1098, 1098-C, 1098-E, 1098-Q, 1098-T, 3921, 3922, 5498, 5498-ESA, 5498-SA, 1099-MISC, 1099-A, 1099-B, 1099-C, 1099-CAP, 1099-DIV, 1099-G, 1099-INT, 1099-K, 1099-LS, 1099-LTC, 1099-NEC, 1099-OID, 1099-PATR, 1099-Q, 1099-R, 1099-S, 1099-SA, T4A, W-2, W-2G, 1099-HC updatedAt validity - possible values are: true, false - Integer $top = 10; // Integer | 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. - Integer $skip = 0; // Integer | If nonzero, skip this number of results before returning data. Used with top to provide pagination for large datasets. - String $orderBy = "$orderBy_example"; // String | A comma separated list of sort statements in the format (fieldname) [ASC|DESC], for example issuerReferenceId ASC. Supported sorting fields are: issuerReferenceId taxYear createdAt recipientName updatedAt - String xCorrelationId = "7766bce5-4834-4907-81e9-dd0fd6c13079"; // String | Unique correlation Id in a GUID format + String $filter = "issuerId eq 884781823"; // String | A filter statement to identify specific records to retrieve. For more information on filtering, see Filtering in REST. + Integer $top = 56; // Integer | If zero or greater than 1000, return at most 1000 results. Otherwise, return this number of results. Used with skip to provide pagination for large datasets. + Integer $skip = 56; // Integer | If nonzero, skip this number of results before returning data. Used with top to provide pagination for large datasets. + String $orderBy = "$orderBy_example"; // String | A comma separated list of sort statements in the format (fieldname) [ASC|DESC], for example id ASC. + Boolean count = true; // Boolean | If true, return the global count of elements in the collection. + Boolean countOnly = true; // Boolean | If true, return ONLY the global count of elements in the collection. It only applies when count=true. + String xCorrelationId = "75d30018-83d1-41b9-b7b4-6de919434c8b"; // String | Unique correlation Id in a GUID format String xAvalaraClient = "Swagger UI; 22.1.0"; // String | Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . try { - Form1099ListResponse result = apiInstance.list1099Forms(avalaraVersion, $filter, $top, $skip, $orderBy, xCorrelationId, xAvalaraClient); + PaginatedQueryResultModelForm1099Base result = apiInstance.list1099Forms(avalaraVersion, $filter, $top, $skip, $orderBy, count, countOnly, xCorrelationId, xAvalaraClient); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling Forms1099Api#list1099Forms"); @@ -520,16 +522,18 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **avalaraVersion** | **String**| API version | - **$filter** | **String**| A filter statement to identify specific records to retrieve. For more information on filtering, see <a href=\"https://developer.avalara.com/avatax/filtering-in-rest/\">Filtering in REST</a>. Collections support filtering only on certain fields. An attempt to filter on an unsupported field will receive a 400 Bad Request response. Supported filtering fields are as follows: issuerId issuerReferenceId taxYear addressVerificationStatus - possible values are: unknown, pending, failed, incomplete, unchanged, verified createdAt edeliveryStatus - possible values are: sent, unscheduled, bad_verify, bad_verify_limit, scheduled, bounced, accepted email federalEfileStatus - possible values are: unscheduled, scheduled, sent, corrected_scheduled, accepted, corrected, corrected_accepted, held recipientName mailStatus - possible values are: sent, unscheduled, pending, delivered referenceId tinMatchStatus - possible values are: none, pending, matched, failed type - possible values are: 940, 941, 943, 944, 945, 1042, 1042-S, 1095-B, 1095-C, 1097-BTC, 1098, 1098-C, 1098-E, 1098-Q, 1098-T, 3921, 3922, 5498, 5498-ESA, 5498-SA, 1099-MISC, 1099-A, 1099-B, 1099-C, 1099-CAP, 1099-DIV, 1099-G, 1099-INT, 1099-K, 1099-LS, 1099-LTC, 1099-NEC, 1099-OID, 1099-PATR, 1099-Q, 1099-R, 1099-S, 1099-SA, T4A, W-2, W-2G, 1099-HC updatedAt validity - possible values are: true, false | [optional] - **$top** | **Integer**| 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] [default to 10] - **$skip** | **Integer**| If nonzero, skip this number of results before returning data. Used with top to provide pagination for large datasets. | [optional] [default to 0] - **$orderBy** | **String**| A comma separated list of sort statements in the format (fieldname) [ASC|DESC], for example issuerReferenceId ASC. Supported sorting fields are: issuerReferenceId taxYear createdAt recipientName updatedAt | [optional] + **$filter** | **String**| A filter statement to identify specific records to retrieve. For more information on filtering, see <a href=\"https://developer.avalara.com/avatax/filtering-in-rest/\">Filtering in REST</a>. | [optional] + **$top** | **Integer**| If zero or greater than 1000, return at most 1000 results. Otherwise, return this number of results. Used with skip to provide pagination for large datasets. | [optional] + **$skip** | **Integer**| If nonzero, skip this number of results before returning data. Used with top to provide pagination for large datasets. | [optional] + **$orderBy** | **String**| A comma separated list of sort statements in the format (fieldname) [ASC|DESC], for example id ASC. | [optional] + **count** | **Boolean**| If true, return the global count of elements in the collection. | [optional] + **countOnly** | **Boolean**| If true, return ONLY the global count of elements in the collection. It only applies when count=true. | [optional] **xCorrelationId** | **String**| Unique correlation Id in a GUID format | [optional] **xAvalaraClient** | **String**| Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . | [optional] ### Return type -[**Form1099ListResponse**](Form1099ListResponse.md) +[**PaginatedQueryResultModelForm1099Base**](PaginatedQueryResultModelForm1099Base.md) ### Authorization @@ -553,7 +557,7 @@ Name | Type | Description | Notes ## update1099Form -> Update1099Form200Response update1099Form(id, avalaraVersion, xCorrelationId, xAvalaraClient, iupdateForm1099Request) +> Get1099Form200Response update1099Form(id, avalaraVersion, xCorrelationId, xAvalaraClient, get1099Form200Response) Update a 1099/1095/W2/1042S form @@ -589,11 +593,11 @@ public class Example { Forms1099Api apiInstance = new Forms1099Api(apiClient); String id = "id_example"; // String | String avalaraVersion = "2.0.0"; // String | API version - String xCorrelationId = "9f622e4f-7992-4e4f-8e24-e628c5339402"; // String | Unique correlation Id in a GUID format + String xCorrelationId = "31ca64fc-d116-4f15-b49f-4877baa12e4a"; // String | Unique correlation Id in a GUID format String xAvalaraClient = "Swagger UI; 22.1.0"; // String | Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . - IUpdateForm1099Request iupdateForm1099Request = new IUpdateForm1099Request(); // IUpdateForm1099Request | + Get1099Form200Response get1099Form200Response = new Get1099Form200Response(); // Get1099Form200Response | try { - Update1099Form200Response result = apiInstance.update1099Form(id, avalaraVersion, xCorrelationId, xAvalaraClient, iupdateForm1099Request); + Get1099Form200Response result = apiInstance.update1099Form(id, avalaraVersion, xCorrelationId, xAvalaraClient, get1099Form200Response); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling Forms1099Api#update1099Form"); @@ -615,11 +619,11 @@ Name | Type | Description | Notes **avalaraVersion** | **String**| API version | **xCorrelationId** | **String**| Unique correlation Id in a GUID format | [optional] **xAvalaraClient** | **String**| Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . | [optional] - **iupdateForm1099Request** | [**IUpdateForm1099Request**](IUpdateForm1099Request.md)| | [optional] + **get1099Form200Response** | [**Get1099Form200Response**](Get1099Form200Response.md)| | [optional] ### Return type -[**Update1099Form200Response**](Update1099Form200Response.md) +[**Get1099Form200Response**](Get1099Form200Response.md) ### Authorization diff --git a/docs/A1099/V2/FormsW9Api.md b/docs/A1099/V2/FormsW9Api.md index c09353d..3adcad2 100644 --- a/docs/A1099/V2/FormsW9Api.md +++ b/docs/A1099/V2/FormsW9Api.md @@ -1,9 +1,10 @@ # FormsW9Api -All URIs are relative to *https://api-ava1099.eta.sbx.us-east-1.aws.avalara.io/avalara1099* +All URIs are relative to *https://api.sbx.avalara.com/avalara1099* Method | HTTP request | Description ------------- | ------------- | ------------- +[**createAndSendW9FormEmail**](FormsW9Api.md#createAndSendW9FormEmail) | **POST** /w9/forms/$create-and-send-email | Create a minimal W9/W4/W8 form and sends the e-mail request [**createW9Form**](FormsW9Api.md#createW9Form) | **POST** /w9/forms | Create a W9/W4/W8 form [**deleteW9Form**](FormsW9Api.md#deleteW9Form) | **DELETE** /w9/forms/{id} | Delete a W9/W4/W8 form [**getW9Form**](FormsW9Api.md#getW9Form) | **GET** /w9/forms/{id} | Retrieve a W9/W4/W8 form @@ -14,6 +15,92 @@ Method | HTTP request | Description +## createAndSendW9FormEmail + +> CreateW9Form201Response createAndSendW9FormEmail(avalaraVersion, xCorrelationId, xAvalaraClient, createAndSendW9FormEmailRequest) + +Create a minimal W9/W4/W8 form and sends the e-mail request + +Create a minimal W9/W4/W8 form and sends the e-mail request. + +### 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.A1099.V2.FormsW9Api; + +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); + + FormsW9Api apiInstance = new FormsW9Api(apiClient); + String avalaraVersion = "2.0.0"; // String | API version + String xCorrelationId = "980ae482-1742-4c81-a302-1593d823d304"; // String | Unique correlation Id in a GUID format + String xAvalaraClient = "Swagger UI; 22.1.0"; // String | Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . + CreateAndSendW9FormEmailRequest createAndSendW9FormEmailRequest = new CreateAndSendW9FormEmailRequest(); // CreateAndSendW9FormEmailRequest | Form to be created + try { + CreateW9Form201Response result = apiInstance.createAndSendW9FormEmail(avalaraVersion, xCorrelationId, xAvalaraClient, createAndSendW9FormEmailRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FormsW9Api#createAndSendW9FormEmail"); + 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**| API version | + **xCorrelationId** | **String**| Unique correlation Id in a GUID format | [optional] + **xAvalaraClient** | **String**| Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . | [optional] + **createAndSendW9FormEmailRequest** | [**CreateAndSendW9FormEmailRequest**](CreateAndSendW9FormEmailRequest.md)| Form to be created | [optional] + +### Return type + +[**CreateW9Form201Response**](CreateW9Form201Response.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: application/json, text/json, application/*+json +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | The created W9/W4/W8 form | - | +| **400** | Bad request (e.g. Unknown form type: W10\") | - | +| **401** | Authentication failed | - | + + ## createW9Form > CreateW9Form201Response createW9Form(avalaraVersion, xCorrelationId, xAvalaraClient, createW9FormRequest) @@ -51,7 +138,7 @@ public class Example { FormsW9Api apiInstance = new FormsW9Api(apiClient); String avalaraVersion = "2.0.0"; // String | API version - String xCorrelationId = "d8cc3501-afdd-4b9e-af90-85db9793cbbc"; // String | Unique correlation Id in a GUID format + String xCorrelationId = "b5120bcc-613a-4c1c-828d-6478c1df4d6d"; // String | Unique correlation Id in a GUID format String xAvalaraClient = "Swagger UI; 22.1.0"; // String | Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . CreateW9FormRequest createW9FormRequest = new CreateW9FormRequest(); // CreateW9FormRequest | Form to be created try { @@ -138,7 +225,7 @@ public class Example { FormsW9Api apiInstance = new FormsW9Api(apiClient); String id = "id_example"; // String | ID of the form to delete String avalaraVersion = "2.0.0"; // String | API version - String xCorrelationId = "0013f0dd-e304-45c6-9f17-bd023626ba48"; // String | Unique correlation Id in a GUID format + String xCorrelationId = "70ca9f7a-4f25-471d-8618-41c0838ccb66"; // String | Unique correlation Id in a GUID format String xAvalaraClient = "Swagger UI; 22.1.0"; // String | Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . try { apiInstance.deleteW9Form(id, avalaraVersion, xCorrelationId, xAvalaraClient); @@ -223,7 +310,7 @@ public class Example { FormsW9Api apiInstance = new FormsW9Api(apiClient); String id = "id_example"; // String | ID of the form String avalaraVersion = "2.0.0"; // String | API version - String xCorrelationId = "e76a4eb2-f5f0-4586-888a-c25443f75fc4"; // String | Unique correlation Id in a GUID format + String xCorrelationId = "053c9414-f1a1-42a6-8bb8-e90544cb8473"; // String | Unique correlation Id in a GUID format String xAvalaraClient = "Swagger UI; 22.1.0"; // String | Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . try { CreateW9Form201Response result = apiInstance.getW9Form(id, avalaraVersion, xCorrelationId, xAvalaraClient); @@ -314,7 +401,7 @@ public class Example { String $orderBy = "$orderBy_example"; // String | A comma separated list of sort statements in the format (fieldname) [ASC|DESC], for example id ASC. Boolean count = true; // Boolean | If true, return the global count of elements in the collection. Boolean countOnly = true; // Boolean | If true, return ONLY the global count of elements in the collection. It only applies when count=true. - String xCorrelationId = "8092ac9c-17d0-4ee8-a00e-804088e5ab81"; // String | Unique correlation Id in a GUID format + String xCorrelationId = "5552b14e-19e1-48b3-a921-484638d7982b"; // String | Unique correlation Id in a GUID format String xAvalaraClient = "Swagger UI; 22.1.0"; // String | Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . try { PaginatedQueryResultModelW9FormBaseResponse result = apiInstance.listW9Forms(avalaraVersion, $filter, $top, $skip, $orderBy, count, countOnly, xCorrelationId, xAvalaraClient); @@ -364,16 +451,16 @@ Name | Type | Description | Notes |-------------|-------------|------------------| | **400** | Bad request (e.g., invalid sort key) | - | | **401** | Authentication failed | - | -| **200** | List of forms | - | +| **200** | list | - | ## sendW9FormEmail -> IW9FormDataModelsOneOf sendW9FormEmail(id, avalaraVersion, xCorrelationId, xAvalaraClient) +> CreateW9Form201Response sendW9FormEmail(id, avalaraVersion, xCorrelationId, xAvalaraClient) Send an email to the vendor/payee requesting they fill out a W9/W4/W8 form -Send an email to the vendor/payee requesting they fill out a W9/W4/W8 form. +Send an email to the vendor/payee requesting they fill out a W9/W4/W8 form. If the form is not in 'Requested' status, it will either use an existing descendant form in 'Requested' status or create a new minimal form and send the email request. ### Example @@ -405,10 +492,10 @@ public class Example { FormsW9Api apiInstance = new FormsW9Api(apiClient); String id = "id_example"; // String | The ID of the W9/W4/W8 form. String avalaraVersion = "2.0.0"; // String | API version - String xCorrelationId = "05ca3285-5ab1-43c0-88d7-f23c30428d54"; // String | Unique correlation Id in a GUID format + String xCorrelationId = "fbb41ab0-ac34-47fc-815d-946a0d2c48cb"; // String | Unique correlation Id in a GUID format String xAvalaraClient = "Swagger UI; 22.1.0"; // String | Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . try { - IW9FormDataModelsOneOf result = apiInstance.sendW9FormEmail(id, avalaraVersion, xCorrelationId, xAvalaraClient); + CreateW9Form201Response result = apiInstance.sendW9FormEmail(id, avalaraVersion, xCorrelationId, xAvalaraClient); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FormsW9Api#sendW9FormEmail"); @@ -433,7 +520,7 @@ Name | Type | Description | Notes ### Return type -[**IW9FormDataModelsOneOf**](IW9FormDataModelsOneOf.md) +[**CreateW9Form201Response**](CreateW9Form201Response.md) ### Authorization @@ -448,7 +535,8 @@ Name | Type | Description | Notes ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | The updated W9/W4/W8 form | - | +| **200** | Email sent using existing form (form was already in 'Requested' status or descendant found) | - | +| **201** | Email sent using newly created minimal form | - | | **400** | Bad request (e.g., invalid sort key) | - | | **401** | Authentication failed | - | @@ -491,7 +579,7 @@ public class Example { FormsW9Api apiInstance = new FormsW9Api(apiClient); String id = "id_example"; // String | ID of the form to update String avalaraVersion = "2.0.0"; // String | API version - String xCorrelationId = "87498441-c774-4e3a-864e-dd604bff0d41"; // String | Unique correlation Id in a GUID format + String xCorrelationId = "737bda48-54bc-418f-82d0-aa9ea5dbb6a2"; // String | Unique correlation Id in a GUID format String xAvalaraClient = "Swagger UI; 22.1.0"; // String | Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . IW9FormDataModelsOneOf iw9FormDataModelsOneOf = new IW9FormDataModelsOneOf(); // IW9FormDataModelsOneOf | Form to be updated try { @@ -539,6 +627,7 @@ Name | Type | Description | Notes | **200** | The updated W9/W4/W8 form | - | | **400** | Bad request (e.g., invalid sort key) | - | | **401** | Authentication failed | - | +| **404** | W9/W4/W8 form not found | - | ## uploadW9Files @@ -579,7 +668,7 @@ public class Example { FormsW9Api apiInstance = new FormsW9Api(apiClient); String id = "id_example"; // String | Id of the form String avalaraVersion = "2.0.0"; // String | API version - String xCorrelationId = "453b7d64-1fd0-4ed3-ba3c-a1d9ca1d69e6"; // String | Unique correlation Id in a GUID format + String xCorrelationId = "b246e2b5-17b2-4229-9f03-86095b6b4b54"; // String | Unique correlation Id in a GUID format String xAvalaraClient = "Swagger UI; 22.1.0"; // String | Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . File _file = new File("/path/to/file"); // File | try { diff --git a/docs/A1099/V2/Get1099Form200Response.md b/docs/A1099/V2/Get1099Form200Response.md index fbff5a1..142990b 100644 --- a/docs/A1099/V2/Get1099Form200Response.md +++ b/docs/A1099/V2/Get1099Form200Response.md @@ -7,57 +7,19 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**id** | **String** | ID of the form | [readonly] | -|**type** | **String** | Type of the form. Will be one of: * 940 * 941 * 943 * 944 * 945 * 1042 * 1042-S * 1095-B * 1095-C * 1097-BTC * 1098 * 1098-C * 1098-E * 1098-Q * 1098-T * 3921 * 3922 * 5498 * 5498-ESA * 5498-SA * 1099-MISC * 1099-A * 1099-B * 1099-C * 1099-CAP * 1099-DIV * 1099-G * 1099-INT * 1099-K * 1099-LS * 1099-LTC * 1099-NEC * 1099-OID * 1099-PATR * 1099-Q * 1099-R * 1099-S * 1099-SA * T4A * W-2 * W-2G * 1099-HC | | -|**issuerId** | **Integer** | Issuer ID | | -|**issuerReferenceId** | **String** | Issuer Reference ID | [optional] | -|**issuerTin** | **String** | Issuer TIN | [optional] | -|**taxYear** | **Integer** | Tax year | [optional] | -|**federalEfile** | **Boolean** | Boolean indicating that federal e-filing has been scheduled for this form | | -|**federalEfileStatus** | [**StatusDetail**](StatusDetail.md) | Federal e-file status | [optional] [readonly] | -|**stateEfile** | **Boolean** | Boolean indicating that state e-filing has been scheduled for this form | | -|**stateEfileStatus** | [**List<StateEfileStatusDetailResponse>**](StateEfileStatusDetailResponse.md) | State e-file status | [optional] [readonly] | -|**postalMail** | **Boolean** | Boolean indicating that postal mailing to the recipient has been scheduled for this form | | -|**postalMailStatus** | [**StatusDetail**](StatusDetail.md) | Postal mail to recipient status | [optional] [readonly] | -|**tinMatch** | **Boolean** | Boolean indicating that TIN Matching has been scheduled for this form | | -|**tinMatchStatus** | [**StatusDetail**](StatusDetail.md) | TIN Match status | [optional] [readonly] | -|**addressVerification** | **Boolean** | Boolean indicating that address verification has been scheduled for this form | | -|**addressVerificationStatus** | [**StatusDetail**](StatusDetail.md) | Address verification status | [optional] [readonly] | -|**eDeliveryStatus** | [**StatusDetail**](StatusDetail.md) | EDelivery status | [optional] [readonly] | -|**referenceId** | **String** | Reference ID | [optional] | -|**email** | **String** | Recipient email address | [optional] | -|**tinType** | **String** | Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN | [optional] | -|**tin** | **String** | Recipient Tax ID Number | [optional] | -|**noTin** | **Boolean** | Indicates whether the recipient has no TIN | [optional] | -|**secondTinNotice** | **Boolean** | Second Tin Notice | [optional] | -|**recipientName** | **String** | Recipient name | [optional] | -|**recipientSecondName** | **String** | Recipient second name | [optional] | -|**address** | **String** | Address | [optional] | -|**address2** | **String** | Address line 2 | [optional] | -|**city** | **String** | City | [optional] | -|**state** | **String** | US state | [optional] | -|**zip** | **String** | Zip/postal code | [optional] | -|**nonUsProvince** | **String** | Foreign province | [optional] | -|**countryCode** | **String** | Country code, as defined at https://www.irs.gov/e-file-providers/country-codes | [optional] | -|**accountNumber** | **String** | Account Number | [optional] | -|**officeCode** | **String** | Office Code | [optional] | -|**fatcaFilingRequirement** | **Boolean** | FATCA filing requirement | [optional] | -|**validationErrors** | [**List<ValidationErrorResponse>**](ValidationErrorResponse.md) | Validation errors | [optional] [readonly] | -|**createdAt** | **OffsetDateTime** | Creation time | [optional] [readonly] | -|**updatedAt** | **OffsetDateTime** | Update time | [optional] [readonly] | -|**stateAndLocalWithholding** | [**StateAndLocalWithholdingResponse**](StateAndLocalWithholdingResponse.md) | | [optional] | -|**uniqueFormId** | **String** | Unique form identifier | [optional] | -|**recipientDateOfBirth** | **OffsetDateTime** | Recipient's date of birth | [optional] | -|**recipientGiin** | **String** | Recipient's GIIN (Global Intermediary Identification Number) | [optional] | -|**recipientForeignTin** | **String** | Recipient's foreign TIN | [optional] | -|**lobCode** | **String** | Limitation on benefits code | [optional] | -|**incomeCode** | **String** | Income code | [optional] | -|**grossIncome** | **Double** | Gross income | [optional] | -|**withholdingIndicator** | **String** | Withholding indicator | [optional] | -|**taxCountryCode** | **String** | Country code | [optional] | -|**exemptionCodeChap3** | **String** | Exemption code (Chapter 3) | [optional] | -|**exemptionCodeChap4** | **String** | Exemption code (Chapter 4) | [optional] | -|**taxRateChap3** | **String** | Tax rate (Chapter 3) | [optional] | +|**tinType** | [**TinTypeEnum**](#TinTypeEnum) | Type of TIN (Tax ID Number) | [optional] | +|**uniqueFormId** | **String** | Unique form identifier | | +|**recipientDateOfBirth** | **LocalDate** | Recipient's date of birth | [optional] | +|**recipientGiin** | **String** | Recipient's Global Intermediary Identification Number (GIIN). A valid GIIN looks like 'XXXXXX.XXXXX.XX.XXX'. | [optional] | +|**recipientForeignTin** | **String** | Recipient's foreign TIN. Required if email is specified, must fill either this or Chap3StatusCode. | [optional] | +|**lobCode** | [**LobCodeEnum**](#LobCodeEnum) | Limitation on Benefits (LOB) code for tax treaty purposes. Available values: - 01: Individual (Deprecated - valid only for tax years prior to 2019) - 02: Government - contracting state/political subdivision/local authority - 03: Tax exempt pension trust/Pension fund - 04: Tax exempt/Charitable organization - 05: Publicly-traded corporation - 06: Subsidiary of publicly-traded corporation - 07: Company that meets the ownership and base erosion test - 08: Company that meets the derivative benefits test - 09: Company with an item of income that meets the active trade or business test - 10: Discretionary determination - 11: Other - 12: No LOB article in treaty | [optional] | +|**incomeCode** | [**IncomeCodeEnum**](#IncomeCodeEnum) | Income code. Available values: Interest: - 01: Interest paid by US obligors - general - 02: Interest paid on real property mortgages - 03: Interest paid to controlling foreign corporations - 04: Interest paid by foreign corporations - 05: Interest on tax-free covenant bonds - 22: Interest paid on deposit with a foreign branch of a domestic corporation or partnership - 29: Deposit interest - 30: Original issue discount (OID) - 31: Short-term OID - 33: Substitute payment - interest - 51: Interest paid on certain actively traded or publicly offered securities(1) - 54: Substitute payments - interest from certain actively traded or publicly offered securities(1) Dividend: - 06: Dividends paid by U.S. corporations - general - 07: Dividends qualifying for direct dividend rate - 08: Dividends paid by foreign corporations - 34: Substitute payment - dividends - 40: Other dividend equivalents under IRC section 871(m) (formerly 871(l)) - 52: Dividends paid on certain actively traded or publicly offered securities(1) - 53: Substitute payments - dividends from certain actively traded or publicly offered securities(1) - 56: Dividend equivalents under IRC section 871(m) as a result of applying the combined transaction rules Other: - 09: Capital gains - 10: Industrial royalties - 11: Motion picture or television copyright royalties - 12: Other royalties (for example, copyright, software, broadcasting, endorsement payments) - 13: Royalties paid on certain publicly offered securities(1) - 14: Real property income and natural resources royalties - 15: Pensions, annuities, alimony, and/or insurance premiums - 16: Scholarship or fellowship grants - 17: Compensation for independent personal services(2) - 18: Compensation for dependent personal services(2) - 19: Compensation for teaching(2) - 20: Compensation during studying and training(2) - 23: Other income - 24: Qualified investment entity (QIE) distributions of capital gains - 25: Trust distributions subject to IRC section 1445 - 26: Unsevered growing crops and timber distributions by a trust subject to IRC section 1445 - 27: Publicly traded partnership distributions subject to IRC section 1446 - 28: Gambling winnings(3) - 32: Notional principal contract income(4) - 35: Substitute payment - other - 36: Capital gains distributions - 37: Return of capital - 38: Eligible deferred compensation items subject to IRC section 877A(d)(1) - 39: Distributions from a nongrantor trust subject to IRC section 877A(f)(1) - 41: Guarantee of indebtedness - 42: Earnings as an artist or athlete - no central withholding agreement(5) - 43: Earnings as an artist or athlete - central withholding agreement(5) - 44: Specified Federal procurement payments - 50: Income previously reported under escrow procedure(6) - 55: Taxable death benefits on life insurance contracts - 57: Amount realized under IRC section 1446(f) - 58: Publicly traded partnership distributions-undetermined | | +|**grossIncome** | **Double** | Gross income | | +|**withholdingIndicator** | [**WithholdingIndicatorEnum**](#WithholdingIndicatorEnum) | Withholding indicator Available values: - 3: Chapter 3 - 4: Chapter 4 | | +|**taxCountryCode** | **String** | Country code | | +|**exemptionCodeChap3** | [**ExemptionCodeChap3Enum**](#ExemptionCodeChap3Enum) | Exemption code (Chapter 3). Required if WithholdingIndicator is 3 (Chapter 3). Required when using TaxRateChap3. Available values: - Empty: Tax rate is due to backup withholding - 00: Not exempt - 01: Effectively connected income - 02: Exempt under IRC (other than portfolio interest) - 03: Income is not from US sources - 04: Exempt under tax treaty - 05: Portfolio interest exempt under IRC - 06: QI that assumes primary withholding responsibility - 07: WFP or WFT - 08: U.S. branch treated as U.S. Person - 09: Territory FI treated as U.S. Person - 10: QI represents that income is exempt - 11: QSL that assumes primary withholding responsibility - 12: Payee subjected to chapter 4 withholding - 22: QDD that assumes primary withholding responsibility - 23: Exempt under section 897(l) - 24: Exempt under section 892 | [optional] | +|**exemptionCodeChap4** | [**ExemptionCodeChap4Enum**](#ExemptionCodeChap4Enum) | Exemption code (Chapter 4). Required if WithholdingIndicator is 4 (Chapter 4). Available values: - 00: Not exempt - 13: Grandfathered payment - 14: Effectively connected income - 15: Payee not subject to chapter 4 withholding - 16: Excluded nonfinancial payment - 17: Foreign Entity that assumes primary withholding responsibility - 18: U.S. Payees - of participating FFI or registered deemed - compliant FFI - 19: Exempt from withholding under IGA(6) - 20: Dormant account(7) - 21: Other - payment not subject to chapter 4 withholding | [optional] | +|**taxRateChap3** | [**TaxRateChap3Enum**](#TaxRateChap3Enum) | Tax rate (Chapter 3) - Required if WithholdingIndicator is 3 (Chapter 3). Available values: - 00.00: 0.00% - 02.00: 2.00% - 04.00: 4.00% - 04.90: 4.90% - 04.95: 4.95% - 05.00: 5.00% - 07.00: 7.00% - 08.00: 8.00% - 10.00: 10.00% - 12.00: 12.00% - 12.50: 12.50% - 14.00: 14.00% - 15.00: 15.00% - 17.50: 17.50% - 20.00: 20.00% - 21.00: 21.00% - 24.00: 24.00% - 25.00: 25.00% - 27.50: 27.50% - 28.00: 28.00% - 30.00: 30.00% - 37.00: 37.00% | [optional] | |**withholdingAllowance** | **Double** | Withholding allowance | [optional] | |**federalTaxWithheld** | **Double** | Federal tax withheld | [optional] | |**taxNotDepositedIndicator** | **Boolean** | Tax not deposited indicator | [optional] | @@ -65,12 +27,58 @@ |**taxWithheldOtherAgents** | **Double** | Tax withheld by other agents | [optional] | |**amountRepaid** | **Double** | Amount repaid to recipient | [optional] | |**taxPaidAgent** | **Double** | Tax paid by withholding agent | [optional] | -|**chap3StatusCode** | **String** | Chapter 3 status code | [optional] | -|**chap4StatusCode** | **String** | Chapter 4 status code | [optional] | -|**primaryWithholdingAgent** | [**PrimaryWithholdingAgentResponse**](PrimaryWithholdingAgentResponse.md) | Primary withholding agent information | [optional] | -|**intermediaryOrFlowThrough** | [**IntermediaryOrFlowThroughResponse**](IntermediaryOrFlowThroughResponse.md) | Intermediary or flow-through entity information | [optional] | -|**originOfHealthCoverageCode** | **String** | Origin of health coverage code | [optional] | -|**coveredIndividuals** | [**List<CoveredIndividualReferenceResponse>**](CoveredIndividualReferenceResponse.md) | Covered individuals information | [optional] | +|**chap3StatusCode** | [**Chap3StatusCodeEnum**](#Chap3StatusCodeEnum) | Chapter 3 status code - Required if WithholdingIndicator is 3 (Chapter 3) Available values: - 01: U.S. Withholding Agent - FI (Deprecated - valid only for tax years prior to 2020) - 02: U.S. Withholding Agent - Other (Deprecated - valid only for tax years prior to 2020) - 03: Territory FI - treated as U.S. Person - 04: Territory FI - not treated as U.S. Person - 05: U.S. branch - treated as U.S. Person - 06: U.S. branch - not treated as U.S. Person - 07: U.S. branch - ECI presumption applied - 08: Partnership other than Withholding Foreign Partnership - 09: Withholding Foreign Partnership - 10: Trust other than Withholding Foreign Trust - 11: Withholding Foreign Trust - 12: Qualified Intermediary - 13: Qualified Securities Lender - Qualified Intermediary - 14: Qualified Securities Lender - Other - 15: Corporation - 16: Individual - 17: Estate - 18: Private Foundation - 19: Government or International Organization - 20: Tax Exempt Organization (Section 501(c) entities) - 21: Unknown Recipient - 22: Artist or Athlete - 23: Pension - 24: Foreign Central Bank of Issue - 25: Nonqualified Intermediary - 26: Hybrid entity making Treaty Claim - 27: Withholding Rate Pool - General - 28: Withholding Rate Pool - Exempt Organization - 29: PAI Withholding Rate Pool - General - 30: PAI Withholding Rate Pool - Exempt Organization - 31: Agency Withholding Rate Pool - General - 32: Agency Withholding Rate Pool - Exempt Organization - 34: U.S. Withholding Agent-Foreign branch of FI (Deprecated - valid only for tax years prior to 2020) - 35: Qualified Derivatives Dealer - 36: Foreign Government - Integral Part - 37: Foreign Government - Controlled Entity - 38: Publicly Traded Partnership - 39: Disclosing Qualified Intermediary | [optional] | +|**chap4StatusCode** | [**Chap4StatusCodeEnum**](#Chap4StatusCodeEnum) | Chapter 4 status code. Required if WithholdingIndicator is 4 (Chapter 4). Required if email is specified, must fill either this or RecipientForeignTin. Available values: - 01: U.S. Withholding Agent - FI - 02: U.S. Withholding Agent - Other - 03: Territory FI - not treated as U.S. Person - 04: Territory FI - treated as U.S. Person - 05: Participating FFI - Other - 06: Participating FFI - Reporting Model 2 FFI - 07: Registered Deemed - Compliant FFI-Reporting Model 1 FFI - 08: Registered Deemed - Compliant FFI-Sponsored Entity - 09: Registered Deemed - Compliant FFI-Other - 10: Certified Deemed - Compliant FFI-Other - 11: Certified Deemed - Compliant FFI-FFI with Low Value Accounts - 12: Certified Deemed - Compliant FFI-Non-Registering Local Bank - 13: Certified Deemed - Compliant FFI-Sponsored Entity - 14: Certified Deemed - Compliant FFI-Investment Advisor or Investment Manager - 15: Nonparticipating FFI - 16: Owner-Documented FFI - 17: U.S. Branch - treated as U.S. person - 18: U.S. Branch - not treated as U.S. person (reporting under section 1471) - 19: Passive NFFE identifying Substantial U.S. Owners - 20: Passive NFFE with no Substantial U.S. Owners - 21: Publicly Traded NFFE or Affiliate of Publicly Traded NFFE - 22: Active NFFE - 23: Individual - 24: Section 501(c) Entities - 25: Excepted Territory NFFE - 26: Excepted NFFE - Other - 27: Exempt Beneficial Owner - 28: Entity Wholly Owned by Exempt Beneficial Owners - 29: Unknown Recipient - 30: Recalcitrant Account Holder - 31: Nonreporting IGA FFI - 32: Direct reporting NFFE - 33: U.S. reportable account - 34: Non-consenting U.S. account - 35: Sponsored direct reporting NFFE - 36: Excepted Inter-affiliate FFI - 37: Undocumented Preexisting Obligation - 38: U.S. Branch - ECI presumption applied - 39: Account Holder of Excluded Financial Account - 40: Passive NFFE reported by FFI - 41: NFFE subject to 1472 withholding - 42: Recalcitrant Pool - No U.S. Indicia - 43: Recalcitrant Pool - U.S. Indicia - 44: Recalcitrant Pool - Dormant Account - 45: Recalcitrant Pool - U.S. Persons - 46: Recalcitrant Pool - Passive NFFEs - 47: Nonparticipating FFI Pool - 48: U.S. Payees Pool - 49: QI - Recalcitrant Pool-General - 50: U.S. Withholding Agent-Foreign branch of FI | [optional] | +|**primaryWithholdingAgent** | [**PrimaryWithholdingAgent**](PrimaryWithholdingAgent.md) | Primary withholding agent information | [optional] | +|**intermediaryOrFlowThrough** | [**IntermediaryOrFlowThrough**](IntermediaryOrFlowThrough.md) | Intermediary or flow-through entity information | [optional] | +|**type** | [**TypeEnum**](#TypeEnum) | Form type | | +|**id** | **String** | Form ID. Unique identifier set when the record is created. | [optional] [readonly] | +|**issuerId** | **String** | Issuer ID - only required when creating forms | [optional] | +|**issuerReferenceId** | **String** | Issuer Reference ID - only required when creating forms | [optional] | +|**issuerTin** | **String** | Issuer TIN - readonly | [optional] | +|**taxYear** | **Integer** | Tax Year - only required when creating forms | [optional] | +|**referenceId** | **String** | Internal reference ID. Never shown to any agency or recipient. | [optional] | +|**tin** | **String** | Recipient's Federal Tax Identification Number (TIN). | [optional] | +|**recipientName** | **String** | Recipient name | | +|**recipientSecondName** | **String** | Recipient second name | [optional] | +|**address** | **String** | Address. | | +|**address2** | **String** | Address line 2. | [optional] | +|**city** | **String** | City. | | +|**state** | **String** | Two-letter US state or Canadian province code (required for US/CA addresses). | [optional] | +|**zip** | **String** | ZIP/postal code. | [optional] | +|**email** | **String** | Recipient's Contact email address. | [optional] | +|**accountNumber** | **String** | Account number | [optional] | +|**officeCode** | **String** | Office code | [optional] | +|**nonUsProvince** | **String** | Province or region for non-US/CA addresses. | [optional] | +|**countryCode** | **String** | Two-letter IRS country code (e.g., 'US', 'CA'), as defined at https://www.irs.gov/e-file-providers/country-codes. | | +|**federalEfileDate** | **LocalDate** | Date when federal e-filing should be scheduled for this form | [optional] | +|**postalMail** | **Boolean** | Boolean indicating that postal mailing to the recipient should be scheduled for this form | [optional] | +|**stateEfileDate** | **LocalDate** | Date when state e-filing should be scheduled for this form | [optional] | +|**recipientEdeliveryDate** | **LocalDate** | Date when recipient e-delivery should be scheduled for this form | [optional] | +|**tinMatch** | **Boolean** | Boolean indicating that TIN Matching should be scheduled for this form | [optional] | +|**noTin** | **Boolean** | No TIN indicator | [optional] | +|**addressVerification** | **Boolean** | Boolean indicating that address verification should be scheduled for this form | [optional] | +|**stateAndLocalWithholding** | [**StateAndLocalWithholding**](StateAndLocalWithholding.md) | State and local withholding information | [optional] | +|**secondTinNotice** | **Boolean** | Second TIN notice | [optional] | +|**federalEfileStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | Federal e-file status | [optional] [readonly] | +|**stateEfileStatus** | [**List<StateEfileStatusDetail>**](StateEfileStatusDetail.md) | State e-file status | [optional] [readonly] | +|**postalMailStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | Postal mail to recipient status | [optional] [readonly] | +|**tinMatchStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | TIN Match status | [optional] [readonly] | +|**addressVerificationStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | Address verification status | [optional] [readonly] | +|**eDeliveryStatus** | [**Form1099StatusDetail**](Form1099StatusDetail.md) | EDelivery status | [optional] [readonly] | +|**validationErrors** | [**List<ValidationError>**](ValidationError.md) | Validation errors | [optional] [readonly] | +|**createdAt** | **OffsetDateTime** | Date time when the record was created. | [optional] [readonly] | +|**updatedAt** | **OffsetDateTime** | Date time when the record was last updated. | [optional] [readonly] | +|**employeeFirstName** | **String** | Employee's first name | | +|**employeeMiddleName** | **String** | Employee's middle name | [optional] | +|**employeeLastName** | **String** | Employee's last name | | +|**employeeNameSuffix** | **String** | Employee's name suffix | [optional] | +|**employeeDateOfBirth** | **LocalDate** | Employee's date of birth | [optional] | +|**originOfHealthCoverageCode** | [**OriginOfHealthCoverageCodeEnum**](#OriginOfHealthCoverageCodeEnum) | Origin of health coverage code Available values: - A: Small Business Health Options Program (SHOP) - B: Employer-sponsored coverage - C: Government-sponsored program - D: Individual market insurance - E: Multiemployer plan - F: Other designated minimum essential coverage - G: Employer-sponsored coverage that is an individual coverage HRA (valid for tax years 2020 and later) | | +|**coveredIndividuals** | [**List<CoveredIndividual>**](CoveredIndividual.md) | Covered individuals information | [optional] | +|**planStartMonth** | [**PlanStartMonthEnum**](#PlanStartMonthEnum) | Plan start month. The calendar month during which the plan year begins of the health plan in which the employee is offered coverage (or would be offered coverage if the employee were eligible to participate in the plan). Available values: - 00: None - 01: January - 02: February - 03: March - 04: April - 05: May - 06: June - 07: July - 08: August - 09: September - 10: October - 11: November - 12: December | | +|**employerProvidedSiCoverage** | **Boolean** | Employer provided self-insured coverage | [optional] | +|**offerAndCoverages** | [**List<OfferAndCoverage>**](OfferAndCoverage.md) | Offer and coverage information | | |**totalOrdinaryDividends** | **Double** | Total ordinary dividends | [optional] | |**qualifiedDividends** | **Double** | Qualified dividends | [optional] | |**totalCapitalGainDistributions** | **Double** | Total capital gain distributions | [optional] | @@ -82,24 +90,25 @@ |**nondividendDistributions** | **Double** | Nondividend distributions | [optional] | |**federalIncomeTaxWithheld** | **Double** | Federal income tax withheld | [optional] | |**section199ADividends** | **Double** | Section 199A dividends | [optional] | -|**investmentExpenses** | **Double** | Investment expenses | [optional] | +|**investmentExpenses** | **Double** | Investment Expenses | [optional] | |**foreignTaxPaid** | **Double** | Foreign tax paid | [optional] | |**foreignCountryOrUSPossession** | **String** | Foreign country or U.S. possession | [optional] | |**cashLiquidationDistributions** | **Double** | Cash liquidation distributions | [optional] | |**noncashLiquidationDistributions** | **Double** | Noncash liquidation distributions | [optional] | |**exemptInterestDividends** | **Double** | Exempt-interest dividends | [optional] | |**specifiedPrivateActivityBondInterestDividends** | **Double** | Specified private activity bond interest dividends | [optional] | +|**fatcaFilingRequirement** | **Boolean** | FATCA filing requirement | [optional] | |**interestIncome** | **Double** | Interest Income | [optional] | -|**earlyWithdrawalPenalty** | **Double** | Early withdrawal penalty | [optional] | +|**earlyWithdrawalPenalty** | **Double** | Early Withdrawal Penalty | [optional] | |**usSavingsBondsInterest** | **Double** | Interest on U.S. Savings Bonds and Treasury obligations | [optional] | |**foreignCountry** | **String** | Foreign country or U.S. possession | [optional] | -|**taxExemptInterest** | **Double** | Tax-exempt interest | [optional] | -|**specifiedPrivateActivityBondInterest** | **Double** | Specified private activity bond interest | [optional] | -|**marketDiscount** | **Double** | Market discount | [optional] | -|**bondPremium** | **Double** | Bond premium | [optional] | -|**bondPremiumOnTreasuryObligations** | **Double** | Bond premium on Treasury obligations | [optional] | -|**bondPremiumOnTaxExemptBond** | **Double** | Bond premium on tax exempt bond | [optional] | -|**taxExemptBondCusipNumber** | **String** | Tax exempt bond CUSIP number | [optional] | +|**taxExemptInterest** | **Double** | Tax-Exempt Interest | [optional] | +|**specifiedPrivateActivityBondInterest** | **Double** | Specified Private activity | [optional] | +|**marketDiscount** | **Double** | Market Discount | [optional] | +|**bondPremium** | **Double** | Bond Premium | [optional] | +|**bondPremiumOnTreasuryObligations** | **Double** | Bond Premium on Treasury obligations | [optional] | +|**bondPremiumOnTaxExemptBond** | **Double** | Bond Premium on tax exempt bond | [optional] | +|**taxExemptBondCusipNumber** | **String** | Tax exempt bond CUSIP no. | [optional] | |**filerType** | [**FilerTypeEnum**](#FilerTypeEnum) | Filer type (PSE or EPF) | [optional] | |**paymentType** | [**PaymentTypeEnum**](#PaymentTypeEnum) | Payment type (payment card or third party network) | [optional] | |**paymentSettlementEntityNamePhoneNumber** | **String** | Payment settlement entity name and phone number | [optional] | @@ -115,43 +124,362 @@ |**june** | **Double** | June gross payments | [optional] | |**july** | **Double** | July gross payments | [optional] | |**august** | **Double** | August gross payments | [optional] | -|**sept** | **Double** | September gross payments | [optional] | +|**september** | **Double** | September gross payments | [optional] | |**october** | **Double** | October gross payments | [optional] | |**november** | **Double** | November gross payments | [optional] | |**december** | **Double** | December gross payments | [optional] | |**rents** | **Double** | Rents | [optional] | |**royalties** | **Double** | Royalties | [optional] | |**otherIncome** | **Double** | Other income | [optional] | -|**fedIncomeTaxWithheld** | **Double** | Federal income tax withheld | [optional] | |**fishingBoatProceeds** | **Double** | Fishing boat proceeds | [optional] | |**medicalAndHealthCarePayments** | **Double** | Medical and health care payments | [optional] | -|**substitutePayments** | **Double** | Substitute payments in lieu of dividends or interest | [optional] | |**directSalesIndicator** | **Boolean** | Payer made direct sales totaling $5,000 or more of consumer products to recipient for resale | [optional] | +|**substitutePayments** | **Double** | Substitute payments in lieu of dividends or interest | [optional] | |**cropInsuranceProceeds** | **Double** | Crop insurance proceeds | [optional] | -|**excessGoldenParachutePayments** | **Double** | (Legacy field) Excess golden parachute payments | [optional] | |**grossProceedsPaidToAttorney** | **Double** | Gross proceeds paid to an attorney | [optional] | |**fishPurchasedForResale** | **Double** | Fish purchased for resale | [optional] | |**section409ADeferrals** | **Double** | Section 409A deferrals | [optional] | +|**excessGoldenParachutePayments** | **Double** | (Legacy field) Excess golden parachute payments | [optional] | |**nonqualifiedDeferredCompensation** | **Double** | Nonqualified deferred compensation | [optional] | -|**nonemployeeCompensation** | **Double** | Nonemployee compensation | [optional] | -|**grossDistributions** | **Double** | Gross distribution | [optional] | +|**nonemployeeCompensation** | **Double** | Nonemployee compensation | | +|**grossDistribution** | **Double** | Gross distribution | [optional] | |**taxableAmount** | **Double** | Taxable amount | [optional] | |**taxableAmountNotDetermined** | **Boolean** | Taxable amount not determined | [optional] | -|**totalDistributionIndicator** | **Boolean** | Total distribution | [optional] | +|**totalDistributionDetermined** | **Boolean** | Total distribution | [optional] | |**capitalGain** | **Double** | Capital gain (included in Box 2a) | [optional] | -|**employeeContributions** | **Double** | Employee contributions/Designated Roth contributions or insurance premiums | [optional] | -|**netUnrealizedAppreciation** | **Double** | Net unrealized appreciation in employer's securities | [optional] | -|**distributionCodeRequired** | **String** | Distribution code | [optional] | -|**distributionCodeOptional** | **String** | Second distribution code | [optional] | -|**iraSepSimpleIndicator** | **Boolean** | IRA/SEP/SIMPLE | [optional] | -|**totalIraSepSimpleDistribution** | **Double** | Traditional IRA/SEP/SIMPLE or Roth conversion amount | [optional] | -|**other** | **Double** | Other amount | [optional] | -|**otherPercent** | **String** | Other percentage | [optional] | -|**percentageTotalDistribution** | **String** | Total distribution percentage | [optional] | +|**employeeContributionsOrDesignatedRothOrInsurancePremiums** | **Double** | Employee contributions/Designated Roth contributions or insurance premiums | [optional] | +|**netUnrealizedAppreciationInEmployerSecurities** | **Double** | Net unrealized appreciation in employer's securities | [optional] | +|**distributionCode** | **String** | Distribution code | [optional] | +|**secondDistributionCode** | **String** | Second distribution code | [optional] | +|**iraSepSimple** | **Boolean** | IRA/SEP/SIMPLE | [optional] | +|**traditionalIraSepSimpleOrRothConversionAmount** | **Double** | Traditional IRA/SEP/SIMPLE or Roth conversion amount | [optional] | +|**otherAmount** | **Double** | Other amount | [optional] | +|**otherPercentage** | **String** | Other percentage | [optional] | +|**totalDistributionPercentage** | **String** | Total distribution percentage | [optional] | |**totalEmployeeContributions** | **Double** | Total employee contributions | [optional] | -|**amountAllocableToIrr** | **Double** | Amount allocable to IRR within 5 years | [optional] | -|**firstYearDesignatedRothContrib** | **String** | First year of designated Roth contribution | [optional] | -|**dateOfPayment** | **String** | Date of payment | [optional] | +|**amountAllocableToIrrWithin5Years** | **Double** | Amount allocable to IRR within 5 years | [optional] | +|**firstYearOfDesignatedRothContribution** | **String** | First year of designated Roth contribution | [optional] | +|**dateOfPayment** | **LocalDate** | Date of payment | [optional] | + + + +## Enum: TinTypeEnum + +| Name | Value | +|---- | -----| +| EMPTY | "Empty" | +| EIN | "EIN" | +| SSN | "SSN" | +| ITIN | "ITIN" | +| ATIN | "ATIN" | + + + +## Enum: LobCodeEnum + +| Name | Value | +|---- | -----| +| _01 | "01" | +| _02 | "02" | +| _03 | "03" | +| _04 | "04" | +| _05 | "05" | +| _06 | "06" | +| _07 | "07" | +| _08 | "08" | +| _09 | "09" | +| _10 | "10" | +| _11 | "11" | +| _12 | "12" | + + + +## Enum: IncomeCodeEnum + +| Name | Value | +|---- | -----| +| _01 | "01" | +| _02 | "02" | +| _03 | "03" | +| _04 | "04" | +| _05 | "05" | +| _22 | "22" | +| _29 | "29" | +| _30 | "30" | +| _31 | "31" | +| _33 | "33" | +| _51 | "51" | +| _54 | "54" | +| _06 | "06" | +| _07 | "07" | +| _08 | "08" | +| _34 | "34" | +| _40 | "40" | +| _52 | "52" | +| _53 | "53" | +| _56 | "56" | +| _09 | "09" | +| _10 | "10" | +| _11 | "11" | +| _12 | "12" | +| _13 | "13" | +| _14 | "14" | +| _15 | "15" | +| _16 | "16" | +| _17 | "17" | +| _18 | "18" | +| _19 | "19" | +| _20 | "20" | +| _23 | "23" | +| _24 | "24" | +| _25 | "25" | +| _26 | "26" | +| _27 | "27" | +| _28 | "28" | +| _32 | "32" | +| _35 | "35" | +| _36 | "36" | +| _37 | "37" | +| _38 | "38" | +| _39 | "39" | +| _41 | "41" | +| _42 | "42" | +| _43 | "43" | +| _44 | "44" | +| _50 | "50" | +| _55 | "55" | +| _57 | "57" | +| _58 | "58" | + + + +## Enum: WithholdingIndicatorEnum + +| Name | Value | +|---- | -----| +| _3 | "3" | +| _4 | "4" | + + + +## Enum: ExemptionCodeChap3Enum + +| Name | Value | +|---- | -----| +| _00 | "00" | +| _01 | "01" | +| _02 | "02" | +| _03 | "03" | +| _04 | "04" | +| _05 | "05" | +| _06 | "06" | +| _07 | "07" | +| _08 | "08" | +| _09 | "09" | +| _10 | "10" | +| _11 | "11" | +| _12 | "12" | +| _22 | "22" | +| _23 | "23" | +| _24 | "24" | + + + +## Enum: ExemptionCodeChap4Enum + +| Name | Value | +|---- | -----| +| _00 | "00" | +| _13 | "13" | +| _14 | "14" | +| _15 | "15" | +| _16 | "16" | +| _17 | "17" | +| _18 | "18" | +| _19 | "19" | +| _20 | "20" | +| _21 | "21" | + + + +## Enum: TaxRateChap3Enum + +| Name | Value | +|---- | -----| +| _00_00 | "00.00" | +| _02_00 | "02.00" | +| _04_00 | "04.00" | +| _04_90 | "04.90" | +| _04_95 | "04.95" | +| _05_00 | "05.00" | +| _07_00 | "07.00" | +| _08_00 | "08.00" | +| _10_00 | "10.00" | +| _12_00 | "12.00" | +| _12_50 | "12.50" | +| _14_00 | "14.00" | +| _15_00 | "15.00" | +| _17_50 | "17.50" | +| _20_00 | "20.00" | +| _21_00 | "21.00" | +| _24_00 | "24.00" | +| _25_00 | "25.00" | +| _27_50 | "27.50" | +| _28_00 | "28.00" | +| _30_00 | "30.00" | +| _37_00 | "37.00" | + + + +## Enum: Chap3StatusCodeEnum + +| Name | Value | +|---- | -----| +| _01 | "01" | +| _02 | "02" | +| _34 | "34" | +| _03 | "03" | +| _04 | "04" | +| _05 | "05" | +| _06 | "06" | +| _07 | "07" | +| _08 | "08" | +| _09 | "09" | +| _10 | "10" | +| _11 | "11" | +| _12 | "12" | +| _13 | "13" | +| _14 | "14" | +| _15 | "15" | +| _16 | "16" | +| _17 | "17" | +| _18 | "18" | +| _19 | "19" | +| _20 | "20" | +| _21 | "21" | +| _22 | "22" | +| _23 | "23" | +| _24 | "24" | +| _25 | "25" | +| _26 | "26" | +| _27 | "27" | +| _28 | "28" | +| _29 | "29" | +| _30 | "30" | +| _31 | "31" | +| _32 | "32" | +| _35 | "35" | +| _36 | "36" | +| _37 | "37" | +| _38 | "38" | +| _39 | "39" | + + + +## Enum: Chap4StatusCodeEnum + +| Name | Value | +|---- | -----| +| _01 | "01" | +| _02 | "02" | +| _03 | "03" | +| _04 | "04" | +| _05 | "05" | +| _06 | "06" | +| _07 | "07" | +| _08 | "08" | +| _09 | "09" | +| _10 | "10" | +| _11 | "11" | +| _12 | "12" | +| _13 | "13" | +| _14 | "14" | +| _15 | "15" | +| _16 | "16" | +| _17 | "17" | +| _18 | "18" | +| _19 | "19" | +| _20 | "20" | +| _21 | "21" | +| _22 | "22" | +| _23 | "23" | +| _24 | "24" | +| _25 | "25" | +| _26 | "26" | +| _27 | "27" | +| _28 | "28" | +| _29 | "29" | +| _30 | "30" | +| _31 | "31" | +| _32 | "32" | +| _33 | "33" | +| _34 | "34" | +| _35 | "35" | +| _36 | "36" | +| _37 | "37" | +| _38 | "38" | +| _39 | "39" | +| _40 | "40" | +| _41 | "41" | +| _42 | "42" | +| _43 | "43" | +| _44 | "44" | +| _45 | "45" | +| _46 | "46" | +| _47 | "47" | +| _48 | "48" | +| _49 | "49" | +| _50 | "50" | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| _1099_NEC | "1099-NEC" | +| _1099_MISC | "1099-MISC" | +| _1099_DIV | "1099-DIV" | +| _1099_R | "1099-R" | +| _1099_K | "1099-K" | +| _1095_B | "1095-B" | +| _1042_S | "1042-S" | +| _1095_C | "1095-C" | +| _1099_INT | "1099-INT" | + + + +## Enum: OriginOfHealthCoverageCodeEnum + +| Name | Value | +|---- | -----| +| A | "A" | +| B | "B" | +| C | "C" | +| D | "D" | +| E | "E" | +| F | "F" | +| G | "G" | + + + +## Enum: PlanStartMonthEnum + +| Name | Value | +|---- | -----| +| _00 | "00" | +| _01 | "01" | +| _02 | "02" | +| _03 | "03" | +| _04 | "04" | +| _05 | "05" | +| _06 | "06" | +| _07 | "07" | +| _08 | "08" | +| _09 | "09" | +| _10 | "10" | +| _11 | "11" | +| _12 | "12" | diff --git a/docs/A1099/V2/IntermediaryOrFlowThrough.md b/docs/A1099/V2/IntermediaryOrFlowThrough.md index 344886c..edb1552 100644 --- a/docs/A1099/V2/IntermediaryOrFlowThrough.md +++ b/docs/A1099/V2/IntermediaryOrFlowThrough.md @@ -2,22 +2,23 @@ # IntermediaryOrFlowThrough +Intermediary or flow-through entity information for tax forms ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**ein** | **String** | | [optional] | -|**chap3StatusCode** | **String** | | [optional] | -|**chap4StatusCode** | **String** | | [optional] | -|**name** | **String** | | [optional] | -|**giin** | **String** | | [optional] | -|**countryCode** | **String** | | [optional] | -|**foreignTin** | **String** | | [optional] | -|**address** | **String** | | [optional] | -|**city** | **String** | | [optional] | -|**state** | **String** | | [optional] | -|**zip** | **String** | | [optional] | +|**ein** | **String** | EIN (Employer Identification Number) of the intermediary or flow-through entity | [optional] | +|**chap3StatusCode** | **String** | Chapter 3 status code for the intermediary or flow-through entity | [optional] | +|**chap4StatusCode** | **String** | Chapter 4 status code for the intermediary or flow-through entity | [optional] | +|**name** | **String** | Name of the intermediary or flow-through entity | [optional] | +|**giin** | **String** | GIIN (Global Intermediary Identification Number) of the intermediary or flow-through entity | [optional] | +|**countryCode** | **String** | Country code for the intermediary or flow-through entity | [optional] | +|**foreignTin** | **String** | Foreign TIN of the intermediary or flow-through entity | [optional] | +|**address** | **String** | Address of the intermediary or flow-through entity | [optional] | +|**city** | **String** | City of the intermediary or flow-through entity | [optional] | +|**state** | **String** | State of the intermediary or flow-through entity | [optional] | +|**zip** | **String** | Zip code of the intermediary or flow-through entity | [optional] | diff --git a/docs/A1099/V2/IssuerCommand.md b/docs/A1099/V2/IssuerCommand.md index 240423c..6d45d44 100644 --- a/docs/A1099/V2/IssuerCommand.md +++ b/docs/A1099/V2/IssuerCommand.md @@ -7,21 +7,21 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**name** | **String** | Legal name, not DBA | [optional] | -|**nameDba** | **String** | Optional DBA name or continuation of a long legal name | [optional] | -|**tin** | **String** | Tax identification number | [optional] | -|**referenceId** | **String** | Optional identifier for your reference, never shown to any agency or recipient. We will also prefix download filenames with this value, if present. Can only include letters, numbers, dashes, underscores and spaces. | [optional] | -|**telephone** | **String** | Telephone number | [optional] | -|**taxYear** | **Integer** | Tax year | [optional] | -|**countryCode** | **String** | If there is a transfer agent, use the shipping address of the transfer agent. | [optional] | -|**email** | **String** | Email address | [optional] | -|**address** | **String** | Address | [optional] | -|**city** | **String** | City | [optional] | -|**state** | **String** | State | [optional] | -|**zip** | **String** | Zip code | [optional] | -|**foreignProvince** | **String** | Foreign province | [optional] | -|**transferAgentName** | **String** | Transfer Agent's Name | [optional] | -|**lastFiling** | **Boolean** | Last year of filing for this payer | [optional] | +|**name** | **String** | Legal name. Not the DBA name. | | +|**dbaName** | **String** | Doing Business As (DBA) name or continuation of a long legal name. Use either this or 'transferAgentName'. | [optional] | +|**tin** | **String** | Federal Tax Identification Number (TIN). | [optional] | +|**referenceId** | **String** | Internal reference ID. Never shown to any agency or recipient. If present, it will prefix download filenames. Allowed characters: letters, numbers, dashes, underscores, and spaces. | [optional] | +|**telephone** | **String** | Contact phone number (must contain at least 10 digits, max 15 characters). For recipient inquiries. | | +|**taxYear** | **Integer** | Tax year for which the forms are being filed (e.g., 2024). Must be within current tax year and current tax year - 4. | | +|**countryCode** | **String** | Two-letter IRS country code (e.g., 'US', 'CA'), as defined at https://www.irs.gov/e-file-providers/country-codes. If there is a transfer agent, use the transfer agent's shipping address. | [optional] | +|**email** | **String** | Contact email address. For recipient inquiries. | | +|**address** | **String** | Address. | | +|**city** | **String** | City. | | +|**state** | **String** | Two-letter US state or Canadian province code (required for US/CA addresses). | | +|**zip** | **String** | ZIP/postal code. | | +|**foreignProvince** | **String** | Province or region for non-US/CA addresses. | [optional] | +|**transferAgentName** | **String** | Name of the transfer agent, if applicable — optional; use either this or 'dbaName'. | [optional] | +|**lastFiling** | **Boolean** | Indicates if this is the issuer's final year filing. | | diff --git a/docs/A1099/V2/IssuerResponse.md b/docs/A1099/V2/IssuerResponse.md index 56a73c3..20dc13a 100644 --- a/docs/A1099/V2/IssuerResponse.md +++ b/docs/A1099/V2/IssuerResponse.md @@ -7,24 +7,24 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**id** | **String** | Unique identifier set when the record is created | [optional] [readonly] | -|**name** | **String** | Legal name, not DBA | [optional] | -|**nameDba** | **String** | Optional DBA name or continuation of a long legal name | [optional] | -|**tin** | **String** | Tax identification number | [optional] | -|**referenceId** | **String** | Optional identifier for your reference, never shown to any agency or recipient. We will also prefix download filenames with this value, if present. Can only include letters, numbers, dashes, underscores and spaces. | [optional] | -|**telephone** | **String** | Telephone number | [optional] | -|**taxYear** | **Integer** | Tax year | [optional] | -|**countryCode** | **String** | If there is a transfer agent, use the address of the transfer agent. | [optional] | -|**email** | **String** | Email address | [optional] | -|**address** | **String** | Address | [optional] | -|**city** | **String** | City | [optional] | -|**state** | **String** | State | [optional] | -|**zip** | **String** | Zip code | [optional] | -|**foreignProvince** | **String** | Foreign province | [optional] | -|**transferAgentName** | **String** | Transfer Agent's Name | [optional] | -|**lastFiling** | **Boolean** | Last year of filing for this payer | [optional] | -|**createdAt** | **OffsetDateTime** | Date time when the issuer was created | [optional] [readonly] | -|**updatedAt** | **OffsetDateTime** | Date time when the issuer was updated | [optional] [readonly] | +|**id** | **String** | Unique identifier set when the record is created. | [optional] | +|**createdAt** | **OffsetDateTime** | Date time when the record was created. | [optional] | +|**updatedAt** | **OffsetDateTime** | Date time when the record was last updated. | [optional] | +|**name** | **String** | Legal name. Not the DBA name. | | +|**dbaName** | **String** | Doing Business As (DBA) name or continuation of a long legal name. Use either this or 'transferAgentName'. | [optional] | +|**tin** | **String** | Federal Tax Identification Number (TIN). | [optional] | +|**referenceId** | **String** | Internal reference ID. Never shown to any agency or recipient. If present, it will prefix download filenames. Allowed characters: letters, numbers, dashes, underscores, and spaces. | [optional] | +|**telephone** | **String** | Contact phone number (must contain at least 10 digits, max 15 characters). For recipient inquiries. | | +|**taxYear** | **Integer** | Tax year for which the forms are being filed (e.g., 2024). Must be within current tax year and current tax year - 4. | | +|**countryCode** | **String** | Two-letter IRS country code (e.g., 'US', 'CA'), as defined at https://www.irs.gov/e-file-providers/country-codes. If there is a transfer agent, use the transfer agent's shipping address. | [optional] | +|**email** | **String** | Contact email address. For recipient inquiries. | | +|**address** | **String** | Address. | | +|**city** | **String** | City. | | +|**state** | **String** | Two-letter US state or Canadian province code (required for US/CA addresses). | | +|**zip** | **String** | ZIP/postal code. | | +|**foreignProvince** | **String** | Province or region for non-US/CA addresses. | [optional] | +|**transferAgentName** | **String** | Name of the transfer agent, if applicable — optional; use either this or 'dbaName'. | [optional] | +|**lastFiling** | **Boolean** | Indicates if this is the issuer's final year filing. | | diff --git a/docs/A1099/V2/Issuers1099Api.md b/docs/A1099/V2/Issuers1099Api.md index 15366ad..44f55c1 100644 --- a/docs/A1099/V2/Issuers1099Api.md +++ b/docs/A1099/V2/Issuers1099Api.md @@ -1,6 +1,6 @@ # Issuers1099Api -All URIs are relative to *https://api-ava1099.eta.sbx.us-east-1.aws.avalara.io/avalara1099* +All URIs are relative to *https://api.sbx.avalara.com/avalara1099* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -14,7 +14,7 @@ Method | HTTP request | Description ## createIssuer -> IssuerResponse createIssuer(avalaraVersion, xCorrelationId, xAvalaraClient, issuerCommand) +> IssuerResponse createIssuer(avalaraVersion, xCorrelationId, xAvalaraClient, createIssuerRequest) Create an issuer @@ -49,11 +49,11 @@ public class Example { Issuers1099Api apiInstance = new Issuers1099Api(apiClient); String avalaraVersion = "2.0.0"; // String | API version - String xCorrelationId = "d2b38090-a4c9-4170-bc1d-6cc2778b0bd0"; // String | Unique correlation Id in a GUID format + String xCorrelationId = "c9fe2806-b469-4728-93f3-f60f31c6e515"; // String | Unique correlation Id in a GUID format String xAvalaraClient = "Swagger UI; 22.1.0"; // String | Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . - IssuerCommand issuerCommand = new IssuerCommand(); // IssuerCommand | The issuer to create + CreateIssuerRequest createIssuerRequest = new CreateIssuerRequest(); // CreateIssuerRequest | The issuer to create try { - IssuerResponse result = apiInstance.createIssuer(avalaraVersion, xCorrelationId, xAvalaraClient, issuerCommand); + IssuerResponse result = apiInstance.createIssuer(avalaraVersion, xCorrelationId, xAvalaraClient, createIssuerRequest); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling Issuers1099Api#createIssuer"); @@ -74,7 +74,7 @@ Name | Type | Description | Notes **avalaraVersion** | **String**| API version | **xCorrelationId** | **String**| Unique correlation Id in a GUID format | [optional] **xAvalaraClient** | **String**| Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . | [optional] - **issuerCommand** | [**IssuerCommand**](IssuerCommand.md)| The issuer to create | [optional] + **createIssuerRequest** | [**CreateIssuerRequest**](CreateIssuerRequest.md)| The issuer to create | [optional] ### Return type @@ -136,7 +136,7 @@ public class Example { Issuers1099Api apiInstance = new Issuers1099Api(apiClient); String id = "id_example"; // String | Id of the issuer to delete String avalaraVersion = "2.0.0"; // String | API version - String xCorrelationId = "22e9dc96-0041-4e27-ab37-038dc9d6c215"; // String | Unique correlation Id in a GUID format + String xCorrelationId = "081895ce-c445-430c-9769-dfade0e811da"; // String | Unique correlation Id in a GUID format String xAvalaraClient = "Swagger UI; 22.1.0"; // String | Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . try { apiInstance.deleteIssuer(id, avalaraVersion, xCorrelationId, xAvalaraClient); @@ -221,7 +221,7 @@ public class Example { Issuers1099Api apiInstance = new Issuers1099Api(apiClient); String id = "id_example"; // String | Id of the issuer to retrieve String avalaraVersion = "2.0.0"; // String | API version - String xCorrelationId = "86c9eff5-1ed3-49b1-be09-a117b235f3e2"; // String | Unique correlation Id in a GUID format + String xCorrelationId = "918a7b34-19fa-42ae-be7e-42f1f8717e7f"; // String | Unique correlation Id in a GUID format String xAvalaraClient = "Swagger UI; 22.1.0"; // String | Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . try { IssuerResponse result = apiInstance.getIssuer(id, avalaraVersion, xCorrelationId, xAvalaraClient); @@ -312,7 +312,7 @@ public class Example { String $orderBy = "$orderBy_example"; // String | A comma separated list of sort statements in the format (fieldname) [ASC|DESC], for example id ASC. Boolean count = true; // Boolean | If true, return the global count of elements in the collection. Boolean countOnly = true; // Boolean | If true, return ONLY the global count of elements in the collection. It only applies when count=true. - String xCorrelationId = "0983f292-e1e0-4415-9cdc-b70482da76b0"; // String | Unique correlation Id in a GUID format + String xCorrelationId = "da800a09-436c-4bca-8e7a-557741840192"; // String | Unique correlation Id in a GUID format String xAvalaraClient = "Swagger UI; 22.1.0"; // String | Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . try { PaginatedQueryResultModelIssuerResponse result = apiInstance.getIssuers(avalaraVersion, $filter, $top, $skip, $orderBy, count, countOnly, xCorrelationId, xAvalaraClient); @@ -369,7 +369,7 @@ Name | Type | Description | Notes ## updateIssuer -> updateIssuer(id, avalaraVersion, xCorrelationId, xAvalaraClient, issuerCommand) +> updateIssuer(id, avalaraVersion, xCorrelationId, xAvalaraClient, createIssuerRequest) Update an issuer @@ -405,11 +405,11 @@ public class Example { Issuers1099Api apiInstance = new Issuers1099Api(apiClient); String id = "id_example"; // String | Id of the issuer to update String avalaraVersion = "2.0.0"; // String | API version - String xCorrelationId = "f43f2c52-c35e-4e50-b1ad-2923b624e5a0"; // String | Unique correlation Id in a GUID format + String xCorrelationId = "cb4b1dbc-2041-4d63-878e-b528a67f2ffc"; // String | Unique correlation Id in a GUID format String xAvalaraClient = "Swagger UI; 22.1.0"; // String | Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . - IssuerCommand issuerCommand = new IssuerCommand(); // IssuerCommand | The issuer to update + CreateIssuerRequest createIssuerRequest = new CreateIssuerRequest(); // CreateIssuerRequest | The issuer to update try { - apiInstance.updateIssuer(id, avalaraVersion, xCorrelationId, xAvalaraClient, issuerCommand); + apiInstance.updateIssuer(id, avalaraVersion, xCorrelationId, xAvalaraClient, createIssuerRequest); } catch (ApiException e) { System.err.println("Exception when calling Issuers1099Api#updateIssuer"); System.err.println("Status code: " + e.getCode()); @@ -430,7 +430,7 @@ Name | Type | Description | Notes **avalaraVersion** | **String**| API version | **xCorrelationId** | **String**| Unique correlation Id in a GUID format | [optional] **xAvalaraClient** | **String**| Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . | [optional] - **issuerCommand** | [**IssuerCommand**](IssuerCommand.md)| The issuer to update | [optional] + **createIssuerRequest** | [**CreateIssuerRequest**](CreateIssuerRequest.md)| The issuer to update | [optional] ### Return type diff --git a/docs/A1099/V2/JobResponse.md b/docs/A1099/V2/JobResponse.md new file mode 100644 index 0000000..0e9e689 --- /dev/null +++ b/docs/A1099/V2/JobResponse.md @@ -0,0 +1,43 @@ + + +# JobResponse + +Response model for job operations + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | Unique identifier for the job | [optional] | +|**type** | **String** | Job type identifier. Will always be \"update_job\" for bulk upsert operations | [optional] | +|**status** | [**StatusEnum**](#StatusEnum) | Current status of the job (e.g., Success, Failed, InProgress) | [optional] | +|**errorMessage** | **String** | Error message if the job failed, null otherwise | [optional] | +|**totalProcessed** | **Integer** | Total number of forms processed. Value can be 0 or another value based on what the job has available | [optional] | +|**totalRows** | **Integer** | Total number of forms in the request. Value can be 0 or another value based on what the job has available | [optional] | +|**updatedValid** | **Integer** | Number of forms updated and valid for e-filing and e-delivery. Value can be 0 or another value based on what the job has available | [optional] | +|**updatedNoEmail** | **Integer** | Number of forms updated and valid for e-filing but missing email or email is undeliverable. Value can be 0 or another value based on what the job has available | [optional] | +|**updatedInvalid** | **Integer** | Number of forms updated but invalid for e-filing. Value can be 0 or another value based on what the job has available | [optional] | +|**skippedDuplicate** | **Integer** | Number of forms skipped because they would have updated a record already updated once in the request. Value can be 0 or another value based on what the job has available | [optional] | +|**skippedInvalid** | **Integer** | Number of forms skipped because they would have made a form invalid and the form is already e-filed or scheduled for e-filing. Value can be 0 or another value based on what the job has available | [optional] | +|**skippedMultipleMatches** | **Integer** | Number of forms skipped because they matched multiple forms. Value can be 0 or another value based on what the job has available | [optional] | +|**notFound** | **Integer** | Number of forms skipped because no matching form or issuer could be found. Value can be 0 or another value based on what the job has available | [optional] | +|**createdInvalid** | **Integer** | Number of new forms created because no matching form could be found (and `upsert` was true) - with errors. Value can be 0 or another value based on what the job has available | [optional] | +|**createdNoEmail** | **Integer** | Number of new forms created because no matching form could be found (and `upsert` was true) - valid for e-filing but missing email or email is undeliverable. Value can be 0 or another value based on what the job has available | [optional] | +|**createdValid** | **Integer** | Number of new forms created because no matching form could be found (and `upsert` was true) - valid for e-filing and e-delivery. Value can be 0 or another value based on what the job has available | [optional] | +|**dryRun** | **Boolean** | Dry run. If `true`, this job only simulates the changes but doesn't actually persist them. | [optional] | +|**upsert** | **Boolean** | Upsert. If `true`, this job will first attempt to update existing records if matches can be found. Matches are done in the following order: Form ID, Form Reference ID and tax year, Form TIN and tax year. | [optional] | +|**link** | **String** | Link to access the job details | [optional] | +|**processedForms** | [**List<Get1099Form200Response>**](Get1099Form200Response.md) | List of processed forms returned when bulk-upsert processes ≤1000 records. Same format as GET /1099/forms response. Only available in bulk-upsert endpoint responses. | [optional] | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| IN_PROGRESS | "InProgress" | +| SUCCESS | "Success" | +| FAILED | "Failed" | + + + diff --git a/docs/A1099/V2/Jobs1099Api.md b/docs/A1099/V2/Jobs1099Api.md index 2c466b7..a47af12 100644 --- a/docs/A1099/V2/Jobs1099Api.md +++ b/docs/A1099/V2/Jobs1099Api.md @@ -46,7 +46,7 @@ public class Example { Jobs1099Api apiInstance = new Jobs1099Api(apiClient); String id = "id_example"; // String | Job id obtained from other API responses, like `/1099/bulk-upsert`. String avalaraVersion = "2.0.0"; // String | API version - String xCorrelationId = "25f0c6ce-1d1a-45f6-b828-15789bccc55b"; // String | Unique correlation Id in a GUID format + String xCorrelationId = "c59a0ae4-16fd-483c-aa47-d6d8a8948c1a"; // String | Unique correlation Id in a GUID format String xAvalaraClient = "Swagger UI; 22.1.0"; // String | Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . try { JobResult result = apiInstance.getJob(id, avalaraVersion, xCorrelationId, xAvalaraClient); diff --git a/docs/A1099/V2/JobsApi.md b/docs/A1099/V2/JobsApi.md new file mode 100644 index 0000000..0ebb26a --- /dev/null +++ b/docs/A1099/V2/JobsApi.md @@ -0,0 +1,97 @@ +# JobsApi + +All URIs are relative to *https://api.sbx.avalara.com/avalara1099* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getJob**](JobsApi.md#getJob) | **GET** /jobs/{id} | Retrieves information about the job + + + +## getJob + +> JobResponse getJob(id, avalaraVersion, xCorrelationId, xAvalaraClient) + +Retrieves information about the job + +Retrieves information about the job + +### 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.A1099.V2.JobsApi; + +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); + + JobsApi apiInstance = new JobsApi(apiClient); + String id = "id_example"; // String | Job id obtained from other API responses, like `/1099/bulk-upsert`. + String avalaraVersion = "2.0.0"; // String | API version + String xCorrelationId = "b17e0df6-816d-45a2-8b6d-a2d79a90a02c"; // String | Unique correlation Id in a GUID format + String xAvalaraClient = "Swagger UI; 22.1.0"; // String | Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . + try { + JobResponse result = apiInstance.getJob(id, avalaraVersion, xCorrelationId, xAvalaraClient); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling JobsApi#getJob"); + 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 +------------- | ------------- | ------------- | ------------- + **id** | **String**| Job id obtained from other API responses, like `/1099/bulk-upsert`. | + **avalaraVersion** | **String**| API version | + **xCorrelationId** | **String**| Unique correlation Id in a GUID format | [optional] + **xAvalaraClient** | **String**| Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . | [optional] + +### Return type + +[**JobResponse**](JobResponse.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** | Success | - | +| **400** | Bad Request | - | +| **404** | Not Found | - | +| **500** | Server Error | - | +| **401** | Unauthorized | - | + diff --git a/docs/A1099/V2/OfferAndCoverage.md b/docs/A1099/V2/OfferAndCoverage.md new file mode 100644 index 0000000..b277d82 --- /dev/null +++ b/docs/A1099/V2/OfferAndCoverage.md @@ -0,0 +1,81 @@ + + +# OfferAndCoverage + +Offer and coverage information for health coverage forms + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Integer** | Id | [optional] [readonly] | +|**month** | [**MonthEnum**](#MonthEnum) | Month of coverage. Available values: - All: All months - January: January - February: February - March: March - April: April - May: May - June: June - July: July - August: August - September: September - October: October - November: November - December: December | [optional] | +|**offerCode** | [**OfferCodeEnum**](#OfferCodeEnum) | Offer of Coverage Code. Required if Share has a value, including zero. Available values: Pre-ICHRA Codes (available before 2020): - 1A: Qualifying offer: minimum essential coverage providing minimum value offered to full-time employee with employee required contribution ≤ 9.5% (as adjusted) of mainland single federal poverty line and at least minimum essential coverage offered to spouse and dependent(s) - 1B: Minimum essential coverage providing minimum value offered to employee only - 1C: Minimum essential coverage providing minimum value offered to employee and at least minimum essential coverage offered to dependent(s) (not spouse) - 1D: Minimum essential coverage providing minimum value offered to employee and at least minimum essential coverage offered to spouse (not dependent(s)) - 1E: Minimum essential coverage providing minimum value offered to employee and at least minimum essential coverage offered to dependent(s) and spouse - 1F: Minimum essential coverage NOT providing minimum value offered to employee; employee and spouse or dependent(s); or employee, spouse, and dependents - 1G: Offer of coverage to an individual who was not an employee or not a full-time employee and who enrolled in self-insured coverage - 1H: No offer of coverage (employee not offered any health coverage or employee offered coverage that is not minimum essential coverage) - 1J: Minimum essential coverage providing minimum value offered to employee and at least minimum essential coverage conditionally offered to spouse; minimum essential coverage not offered to dependent(s) - 1K: Minimum essential coverage providing minimum value offered to employee; at least minimum essential coverage offered to dependents; and at least minimum essential coverage conditionally offered to spouse ICHRA Codes (introduced 2020, require ZIP code): - 1L: Individual coverage HRA offered to employee only - 1M: Individual coverage HRA offered to employee and dependent(s) (not spouse) - 1N: Individual coverage HRA offered to employee, spouse, and dependent(s) - 1O: Individual coverage HRA offered to employee only using employment site ZIP code affordability safe harbor - 1P: Individual coverage HRA offered to employee and dependent(s) (not spouse) using employment site ZIP code affordability safe harbor - 1Q: Individual coverage HRA offered to employee, spouse, and dependent(s) using employment site ZIP code affordability safe harbor - 1R: Individual coverage HRA that is NOT affordable - 1S: Individual coverage HRA offered to an individual who was not a full-time employee - 1T: Individual coverage HRA offered to employee and spouse (not dependents) - 1U: Individual coverage HRA offered to employee and spouse (not dependents) using employment site ZIP code affordability safe harbor Note: Codes 1B, 1C, 1D, 1E, 1J, 1K, 1L, 1M, 1N, 1O, 1P, 1Q, 1T, 1U require employee share amount (0.00 is a valid value). | [optional] | +|**share** | **Double** | Employee required contribution share - Employee Share of Lowest Cost Monthly Premium, for Self-Only Minimum Value Coverage - May not exceed 3499.99 | [optional] | +|**safeHarborCode** | [**SafeHarborCodeEnum**](#SafeHarborCodeEnum) | Safe harbor code - Applicable Section 4980H Safe Harbor Code. Available values: - 2A: Form W-2 safe harbor - 2B: Federal poverty line safe harbor - 2C: Rate of pay safe harbor - 2D: Part-time employee safe harbor for employees who were not full-time for any month of the year - 2E: Multiemployer interim rule relief - 2F: Qualifying offer method - 2G: Qualifying offer transition relief - 2H: Other affordability safe harbor | [optional] | +|**zipCode** | **String** | ZIP/postal code. For coverage area (optional, unless codes 1L to 1U are used). | [optional] | + + + +## Enum: MonthEnum + +| Name | Value | +|---- | -----| +| ALL | "All" | +| _01 | "01" | +| _02 | "02" | +| _03 | "03" | +| _04 | "04" | +| _05 | "05" | +| _06 | "06" | +| _07 | "07" | +| _08 | "08" | +| _09 | "09" | +| _10 | "10" | +| _11 | "11" | +| _12 | "12" | + + + +## Enum: OfferCodeEnum + +| Name | Value | +|---- | -----| +| _1_A | "1A" | +| _1_B | "1B" | +| _1_C | "1C" | +| _1_D | "1D" | +| _1_E | "1E" | +| _1_F | "1F" | +| _1_G | "1G" | +| _1_H | "1H" | +| _1_J | "1J" | +| _1_K | "1K" | +| _1_L | "1L" | +| _1_M | "1M" | +| _1_N | "1N" | +| _1_O | "1O" | +| _1_P | "1P" | +| _1_Q | "1Q" | +| _1_R | "1R" | +| _1_S | "1S" | +| _1_T | "1T" | +| _1_U | "1U" | + + + +## Enum: SafeHarborCodeEnum + +| Name | Value | +|---- | -----| +| _2_A | "2A" | +| _2_B | "2B" | +| _2_C | "2C" | +| _2_D | "2D" | +| _2_E | "2E" | +| _2_F | "2F" | +| _2_G | "2G" | +| _2_H | "2H" | + + + diff --git a/docs/A1099/V2/PaginatedQueryResultModelForm1099Base.md b/docs/A1099/V2/PaginatedQueryResultModelForm1099Base.md new file mode 100644 index 0000000..293c58e --- /dev/null +++ b/docs/A1099/V2/PaginatedQueryResultModelForm1099Base.md @@ -0,0 +1,16 @@ + + +# PaginatedQueryResultModelForm1099Base + +Generic paginated model to wrap query response data + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**atRecordsetCount** | **Integer** | | [optional] | +|**value** | [**List<Get1099Form200Response>**](Get1099Form200Response.md) | | [optional] | +|**atNextLink** | **String** | | [optional] | + + + diff --git a/docs/A1099/V2/PrimaryWithholdingAgent.md b/docs/A1099/V2/PrimaryWithholdingAgent.md index 95d982b..55e44e0 100644 --- a/docs/A1099/V2/PrimaryWithholdingAgent.md +++ b/docs/A1099/V2/PrimaryWithholdingAgent.md @@ -2,13 +2,14 @@ # PrimaryWithholdingAgent +Primary withholding agent information for tax forms ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**primaryWithholdingAgentName** | **String** | | [optional] | -|**primaryWithholdingAgentEin** | **String** | | [optional] | +|**name** | **String** | Name of the primary withholding agent | | +|**ein** | **String** | EIN (Employer Identification Number) of the primary withholding agent. | | diff --git a/docs/A1099/V2/StateAndLocalWithholding.md b/docs/A1099/V2/StateAndLocalWithholding.md index 15a4737..dd341d4 100644 --- a/docs/A1099/V2/StateAndLocalWithholding.md +++ b/docs/A1099/V2/StateAndLocalWithholding.md @@ -7,14 +7,14 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**stateTaxWithheld** | **Double** | | [optional] | -|**state** | **String** | | [optional] | -|**stateIdNumber** | **String** | | [optional] | -|**stateIncome** | **Double** | | [optional] | -|**localTaxWithheld** | **Double** | | [optional] | -|**locality** | **String** | | [optional] | -|**localityIdNumber** | **String** | | [optional] | -|**localIncome** | **Double** | | [optional] | +|**stateTaxWithheld** | **Double** | Amount of state tax that was withheld | [optional] | +|**state** | **String** | US state | [optional] | +|**stateIdNumber** | **String** | State ID number of the entity issuing the form | [optional] | +|**stateIncome** | **Double** | Amount of state income | [optional] | +|**localTaxWithheld** | **Double** | Amount of local tax that was withheld | [optional] | +|**locality** | **String** | Locality name | [optional] | +|**localityIdNumber** | **String** | Locality ID number of the entity issuing the form | [optional] | +|**localIncome** | **Double** | Amount of local income | [optional] | diff --git a/docs/A1099/V2/ValidationError.md b/docs/A1099/V2/ValidationError.md index b9c10d2..554e0d5 100644 --- a/docs/A1099/V2/ValidationError.md +++ b/docs/A1099/V2/ValidationError.md @@ -7,8 +7,8 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**field** | **String** | | [optional] | -|**errors** | **List<String>** | | [optional] | +|**field** | **String** | The field containing the error | [optional] | +|**errors** | **List<String>** | The list of error messages | [optional] | diff --git a/docs/A1099/V2/W4FormMinimalRequest.md b/docs/A1099/V2/W4FormMinimalRequest.md new file mode 100644 index 0000000..53b4610 --- /dev/null +++ b/docs/A1099/V2/W4FormMinimalRequest.md @@ -0,0 +1,31 @@ + + +# W4FormMinimalRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | [**TypeEnum**](#TypeEnum) | The form type (always \"w4\" for this model). | [optional] [readonly] | +|**email** | **String** | The email address of the individual associated with the form. | | +|**employeeFirstName** | **String** | The first name of the employee. | | +|**employeeLastName** | **String** | The last name of the employee. | | +|**officeCode** | **String** | The office code associated with the form. | [optional] | +|**companyId** | **String** | The ID of the associated company. | | +|**referenceId** | **String** | A reference identifier for the form. | [optional] | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| W4 | "W4" | +| W8_BEN | "W8Ben" | +| W8_BEN_E | "W8BenE" | +| W8_IMY | "W8Imy" | +| W9 | "W9" | + + + diff --git a/docs/A1099/V2/W4FormRequest.md b/docs/A1099/V2/W4FormRequest.md index baa9e97..be7bb7a 100644 --- a/docs/A1099/V2/W4FormRequest.md +++ b/docs/A1099/V2/W4FormRequest.md @@ -27,11 +27,11 @@ |**additionalWithheld** | **Float** | The additional amount withheld. | [optional] | |**exemptFromWithholding** | **Boolean** | Indicates whether the employee is exempt from withholding. | [optional] | |**officeCode** | **String** | The office code associated with the form. | [optional] | -|**companyId** | **String** | The ID of the associated company. | [optional] | -|**referenceId** | **String** | A reference identifier for the form. | [optional] | -|**email** | **String** | The email address of the individual associated with the form. | [optional] | |**eDeliveryConsentedAt** | **OffsetDateTime** | The date when e-delivery was consented. | [optional] | |**signature** | **String** | The signature of the form. | [optional] | +|**companyId** | **String** | The ID of the associated company. | | +|**referenceId** | **String** | A reference identifier for the form. | [optional] | +|**email** | **String** | The email address of the individual associated with the form. | [optional] | diff --git a/docs/A1099/V2/W8BenEFormMinimalRequest.md b/docs/A1099/V2/W8BenEFormMinimalRequest.md new file mode 100644 index 0000000..8f066ac --- /dev/null +++ b/docs/A1099/V2/W8BenEFormMinimalRequest.md @@ -0,0 +1,30 @@ + + +# W8BenEFormMinimalRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | [**TypeEnum**](#TypeEnum) | The form type (always \"w8bene\" for this model). | [optional] [readonly] | +|**email** | **String** | The email address of the individual associated with the form. | | +|**name** | **String** | The name of the individual or entity associated with the form. | | +|**referenceNumber** | **String** | A reference number for the form. | [optional] | +|**companyId** | **String** | The ID of the associated company. | | +|**referenceId** | **String** | A reference identifier for the form. | [optional] | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| W4 | "W4" | +| W8_BEN | "W8Ben" | +| W8_BEN_E | "W8BenE" | +| W8_IMY | "W8Imy" | +| W9 | "W9" | + + + diff --git a/docs/A1099/V2/W8BenEFormRequest.md b/docs/A1099/V2/W8BenEFormRequest.md index 6c67959..1e34b83 100644 --- a/docs/A1099/V2/W8BenEFormRequest.md +++ b/docs/A1099/V2/W8BenEFormRequest.md @@ -103,11 +103,11 @@ |**substantialUsOwners** | [**List<SubstantialUsOwnerRequest>**](SubstantialUsOwnerRequest.md) | The list of substantial U.S. owners of passive NFFE. | [optional] | |**signerName** | **String** | The name of the signer. | [optional] | |**capacityToSignCertification** | **Boolean** | Certifies signer has the capacity to sign for the beneficial owner. | [optional] | -|**companyId** | **String** | The ID of the associated company. | [optional] | -|**referenceId** | **String** | A reference identifier for the form. | [optional] | -|**email** | **String** | The email address of the individual associated with the form. | [optional] | |**eDeliveryConsentedAt** | **OffsetDateTime** | The date when e-delivery was consented. | [optional] | |**signature** | **String** | The signature of the form. | [optional] | +|**companyId** | **String** | The ID of the associated company. | | +|**referenceId** | **String** | A reference identifier for the form. | [optional] | +|**email** | **String** | The email address of the individual associated with the form. | [optional] | diff --git a/docs/A1099/V2/W8BenFormMinimalRequest.md b/docs/A1099/V2/W8BenFormMinimalRequest.md new file mode 100644 index 0000000..3ae8335 --- /dev/null +++ b/docs/A1099/V2/W8BenFormMinimalRequest.md @@ -0,0 +1,30 @@ + + +# W8BenFormMinimalRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | [**TypeEnum**](#TypeEnum) | The form type (always \"w8ben\" for this model). | [optional] [readonly] | +|**email** | **String** | The email address of the individual associated with the form. | | +|**name** | **String** | The name of the individual or entity associated with the form. | | +|**referenceNumber** | **String** | A reference number for the form. | [optional] | +|**companyId** | **String** | The ID of the associated company. | | +|**referenceId** | **String** | A reference identifier for the form. | [optional] | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| W4 | "W4" | +| W8_BEN | "W8Ben" | +| W8_BEN_E | "W8BenE" | +| W8_IMY | "W8Imy" | +| W9 | "W9" | + + + diff --git a/docs/A1099/V2/W8BenFormRequest.md b/docs/A1099/V2/W8BenFormRequest.md index 893d197..9540390 100644 --- a/docs/A1099/V2/W8BenFormRequest.md +++ b/docs/A1099/V2/W8BenFormRequest.md @@ -32,11 +32,11 @@ |**withholdingRate** | **String** | The withholding rate applied as per the treaty. | [optional] | |**incomeType** | **String** | The type of income covered by the treaty. | [optional] | |**signerName** | **String** | The name of the signer of the form. | [optional] | -|**companyId** | **String** | The ID of the associated company. | [optional] | -|**referenceId** | **String** | A reference identifier for the form. | [optional] | -|**email** | **String** | The email address of the individual associated with the form. | [optional] | |**eDeliveryConsentedAt** | **OffsetDateTime** | The date when e-delivery was consented. | [optional] | |**signature** | **String** | The signature of the form. | [optional] | +|**companyId** | **String** | The ID of the associated company. | | +|**referenceId** | **String** | A reference identifier for the form. | [optional] | +|**email** | **String** | The email address of the individual associated with the form. | [optional] | diff --git a/docs/A1099/V2/W8ImyFormMinimalRequest.md b/docs/A1099/V2/W8ImyFormMinimalRequest.md new file mode 100644 index 0000000..e4ac22c --- /dev/null +++ b/docs/A1099/V2/W8ImyFormMinimalRequest.md @@ -0,0 +1,30 @@ + + +# W8ImyFormMinimalRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | [**TypeEnum**](#TypeEnum) | The form type (always \"w8imy\" for this model). | [optional] [readonly] | +|**email** | **String** | The email address of the individual associated with the form. | | +|**name** | **String** | The name of the individual or entity associated with the form. | | +|**referenceNumber** | **String** | A reference number for the form. | [optional] | +|**companyId** | **String** | The ID of the associated company. | | +|**referenceId** | **String** | A reference identifier for the form. | [optional] | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| W4 | "W4" | +| W8_BEN | "W8Ben" | +| W8_BEN_E | "W8BenE" | +| W8_IMY | "W8Imy" | +| W9 | "W9" | + + + diff --git a/docs/A1099/V2/W8ImyFormRequest.md b/docs/A1099/V2/W8ImyFormRequest.md index 0f6000d..8dfefa8 100644 --- a/docs/A1099/V2/W8ImyFormRequest.md +++ b/docs/A1099/V2/W8ImyFormRequest.md @@ -119,11 +119,11 @@ |**sponsoredDirectReportingNffeCertification** | **Boolean** | Certifies that the entity is a sponsored direct reporting NFFE. | [optional] | |**directReportingNffeSponsoringEntity** | **String** | The name of the entity that sponsors the direct reporting NFFE. | [optional] | |**signerName** | **String** | The name of the signer. | [optional] | -|**companyId** | **String** | The ID of the associated company. | [optional] | -|**referenceId** | **String** | A reference identifier for the form. | [optional] | -|**email** | **String** | The email address of the individual associated with the form. | [optional] | |**eDeliveryConsentedAt** | **OffsetDateTime** | The date when e-delivery was consented. | [optional] | |**signature** | **String** | The signature of the form. | [optional] | +|**companyId** | **String** | The ID of the associated company. | | +|**referenceId** | **String** | A reference identifier for the form. | [optional] | +|**email** | **String** | The email address of the individual associated with the form. | [optional] | diff --git a/docs/A1099/V2/W9FormBaseMinimalRequest.md b/docs/A1099/V2/W9FormBaseMinimalRequest.md new file mode 100644 index 0000000..22794d4 --- /dev/null +++ b/docs/A1099/V2/W9FormBaseMinimalRequest.md @@ -0,0 +1,28 @@ + + +# W9FormBaseMinimalRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | [**TypeEnum**](#TypeEnum) | The form type. | [optional] [readonly] | +|**companyId** | **String** | The ID of the associated company. | | +|**referenceId** | **String** | A reference identifier for the form. | [optional] | +|**email** | **String** | The email address of the individual associated with the form. | [optional] | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| W4 | "W4" | +| W8_BEN | "W8Ben" | +| W8_BEN_E | "W8BenE" | +| W8_IMY | "W8Imy" | +| W9 | "W9" | + + + diff --git a/docs/A1099/V2/W9FormBaseRequest.md b/docs/A1099/V2/W9FormBaseRequest.md index 8ce3737..df5103a 100644 --- a/docs/A1099/V2/W9FormBaseRequest.md +++ b/docs/A1099/V2/W9FormBaseRequest.md @@ -7,12 +7,12 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| +|**eDeliveryConsentedAt** | **OffsetDateTime** | The date when e-delivery was consented. | [optional] | +|**signature** | **String** | The signature of the form. | [optional] | |**type** | [**TypeEnum**](#TypeEnum) | The form type. | [optional] [readonly] | -|**companyId** | **String** | The ID of the associated company. | [optional] | +|**companyId** | **String** | The ID of the associated company. | | |**referenceId** | **String** | A reference identifier for the form. | [optional] | |**email** | **String** | The email address of the individual associated with the form. | [optional] | -|**eDeliveryConsentedAt** | **OffsetDateTime** | The date when e-delivery was consented. | [optional] | -|**signature** | **String** | The signature of the form. | [optional] | diff --git a/docs/A1099/V2/W9FormBaseResponse.md b/docs/A1099/V2/W9FormBaseResponse.md index fa56e08..f190691 100644 --- a/docs/A1099/V2/W9FormBaseResponse.md +++ b/docs/A1099/V2/W9FormBaseResponse.md @@ -8,13 +8,13 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**id** | **String** | The unique identifier for the form. | [optional] | -|**entryStatus** | **String** | The form status. | [optional] | -|**entryStatusDate** | **OffsetDateTime** | The timestamp for the latest status update. | [optional] | +|**entryStatus** | [**EntryStatusResponse**](EntryStatusResponse.md) | The entry status information for the form. | [optional] | |**referenceId** | **String** | A reference identifier for the form. | [optional] | |**companyId** | **String** | The ID of the associated company. | [optional] | |**displayName** | **String** | The display name associated with the form. | [optional] | |**email** | **String** | The email address of the individual associated with the form. | [optional] | |**archived** | **Boolean** | Indicates whether the form is archived. | [optional] | +|**ancestorId** | **String** | Form ID of previous version. | [optional] | |**signature** | **String** | The signature of the form. | [optional] | |**signedDate** | **OffsetDateTime** | The date the form was signed. | [optional] | |**eDeliveryConsentedAt** | **OffsetDateTime** | The date when e-delivery was consented. | [optional] | diff --git a/docs/A1099/V2/W9FormMinimalRequest.md b/docs/A1099/V2/W9FormMinimalRequest.md new file mode 100644 index 0000000..b264334 --- /dev/null +++ b/docs/A1099/V2/W9FormMinimalRequest.md @@ -0,0 +1,30 @@ + + +# W9FormMinimalRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | [**TypeEnum**](#TypeEnum) | The form type (always \"w9\" for this model). | [optional] [readonly] | +|**email** | **String** | The email address of the individual associated with the form. | | +|**name** | **String** | The name of the individual or entity associated with the form. | | +|**accountNumber** | **String** | The account number associated with the form. | [optional] | +|**companyId** | **String** | The ID of the associated company. | | +|**referenceId** | **String** | A reference identifier for the form. | [optional] | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| W4 | "W4" | +| W8_BEN | "W8Ben" | +| W8_BEN_E | "W8BenE" | +| W8_IMY | "W8Imy" | +| W9 | "W9" | + + + diff --git a/docs/A1099/V2/W9FormRequest.md b/docs/A1099/V2/W9FormRequest.md index 720e980..e09ed1a 100644 --- a/docs/A1099/V2/W9FormRequest.md +++ b/docs/A1099/V2/W9FormRequest.md @@ -26,11 +26,11 @@ |**tin** | **String** | The taxpayer identification number (TIN). | [optional] | |**backupWithholding** | **Boolean** | Indicates whether backup withholding applies. | [optional] | |**is1099able** | **Boolean** | Indicates whether the individual or entity should be issued a 1099 form. | [optional] | -|**companyId** | **String** | The ID of the associated company. | [optional] | -|**referenceId** | **String** | A reference identifier for the form. | [optional] | -|**email** | **String** | The email address of the individual associated with the form. | [optional] | |**eDeliveryConsentedAt** | **OffsetDateTime** | The date when e-delivery was consented. | [optional] | |**signature** | **String** | The signature of the form. | [optional] | +|**companyId** | **String** | The ID of the associated company. | | +|**referenceId** | **String** | A reference identifier for the form. | [optional] | +|**email** | **String** | The email address of the individual associated with the form. | [optional] | diff --git a/pom.xml b/pom.xml index 664d9cf..d5c0d01 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ avalara-sdk jar avalara-sdk - 25.8.2 + 25.8.3 https://github.com/avadev/Avalara-SDK-Java OpenAPI Java diff --git a/src/main/java/Avalara/SDK/api/A1099/V2/CompaniesW9Api.java b/src/main/java/Avalara/SDK/api/A1099/V2/CompaniesW9Api.java index 51d3992..8648727 100644 --- a/src/main/java/Avalara/SDK/api/A1099/V2/CompaniesW9Api.java +++ b/src/main/java/Avalara/SDK/api/A1099/V2/CompaniesW9Api.java @@ -36,9 +36,8 @@ import java.util.*; -import Avalara.SDK.model.A1099.V2.CompanyCreateUpdateRequestModel; import Avalara.SDK.model.A1099.V2.CompanyResponse; -import Avalara.SDK.model.A1099.V2.CompanyResponseModel; +import Avalara.SDK.model.A1099.V2.CreateCompanyRequest; import Avalara.SDK.model.A1099.V2.ErrorModel; import Avalara.SDK.model.A1099.V2.ErrorResponse; import Avalara.SDK.model.A1099.V2.PaginatedQueryResultModelCompanyResponse; @@ -111,7 +110,7 @@ public okhttp3.Call createCompanyCall(CreateCompanyRequest requestParameters, fi basePath = null; } - Object localVarPostBody = requestParameters.getCompanyCreateUpdateRequestModel(); + Object localVarPostBody = requestParameters.getCreateCompanyRequest(); // create path and map variables String localVarPath = "/w9/companies"; @@ -138,7 +137,7 @@ public okhttp3.Call createCompanyCall(CreateCompanyRequest requestParameters, fi "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -171,7 +170,7 @@ private okhttp3.Call createCompanyValidateBeforeCall(CreateCompanyRequest reques * Create a company * Create a company. * @param requestOptions Object which represents the options available for a given API/request - * @return CompanyResponseModel + * @return CompanyResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -181,8 +180,8 @@ private okhttp3.Call createCompanyValidateBeforeCall(CreateCompanyRequest reques
401 Authentication failed -
*/ - public CompanyResponseModel createCompany(CreateCompanyRequest requestParameters) throws ApiException { - ApiResponse localVarResp = createCompanyWithHttpInfo(requestParameters); + public CompanyResponse createCompany(CreateCompanyRequest requestParameters) throws ApiException { + ApiResponse localVarResp = createCompanyWithHttpInfo(requestParameters); return localVarResp.getData(); } @@ -190,7 +189,7 @@ public CompanyResponseModel createCompany(CreateCompanyRequest requestParameters * Create a company * Create a company. * @param requestOptions Object which represents the options available for a given API/request - * @return ApiResponse<CompanyResponseModel> + * @return ApiResponse<CompanyResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -200,9 +199,9 @@ public CompanyResponseModel createCompany(CreateCompanyRequest requestParameters
401 Authentication failed -
*/ - public ApiResponse createCompanyWithHttpInfo(CreateCompanyRequest requestParameters) throws ApiException { + public ApiResponse createCompanyWithHttpInfo(CreateCompanyRequest requestParameters) throws ApiException { okhttp3.Call localVarCall = createCompanyValidateBeforeCall(requestParameters, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -221,10 +220,10 @@ public ApiResponse createCompanyWithHttpInfo(CreateCompany 401 Authentication failed - */ - public okhttp3.Call createCompanyAsync(CreateCompanyRequest requestParameters, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createCompanyAsync(CreateCompanyRequest requestParameters, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = createCompanyValidateBeforeCall(requestParameters, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } @@ -234,13 +233,13 @@ public okhttp3.Call createCompanyAsync(CreateCompanyRequest requestParameters, f * @param avalaraVersion API version * @param xCorrelationId Unique correlation Id in a GUID format (optional) * @param xAvalaraClient Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . (optional) - * @param companyCreateUpdateRequestModel The company to create (optional) + * @param createCompanyRequest The company to create (optional) */ public class CreateCompanyRequest { private String avalaraVersion; private String xCorrelationId; private String xAvalaraClient; - private CompanyCreateUpdateRequestModel companyCreateUpdateRequestModel; + private CreateCompanyRequest createCompanyRequest; public CreateCompanyRequest () { } @@ -251,8 +250,8 @@ public CreateCompanyRequest () { public void setXCorrelationId(String xCorrelationId) { this.xCorrelationId = xCorrelationId; } public String getXAvalaraClient() { return xAvalaraClient; } public void setXAvalaraClient(String xAvalaraClient) { this.xAvalaraClient = xAvalaraClient; } - public CompanyCreateUpdateRequestModel getCompanyCreateUpdateRequestModel() { return companyCreateUpdateRequestModel; } - public void setCompanyCreateUpdateRequestModel(CompanyCreateUpdateRequestModel companyCreateUpdateRequestModel) { this.companyCreateUpdateRequestModel = companyCreateUpdateRequestModel; } + public CreateCompanyRequest getCreateCompanyRequest() { return createCompanyRequest; } + public void setCreateCompanyRequest(CreateCompanyRequest createCompanyRequest) { this.createCompanyRequest = createCompanyRequest; } } /** @@ -325,7 +324,7 @@ public okhttp3.Call deleteCompanyCall(DeleteCompanyRequest requestParameters, fi "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -542,7 +541,7 @@ public okhttp3.Call getCompaniesCall(GetCompaniesRequest requestParameters, fina "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -755,7 +754,7 @@ public okhttp3.Call getCompanyCall(GetCompanyRequest requestParameters, final Ap "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -924,7 +923,7 @@ public okhttp3.Call updateCompanyCall(UpdateCompanyRequest requestParameters, fi basePath = null; } - Object localVarPostBody = requestParameters.getCompanyCreateUpdateRequestModel(); + Object localVarPostBody = requestParameters.getCreateCompanyRequest(); // create path and map variables String localVarPath = "/w9/companies/{id}" @@ -952,7 +951,7 @@ public okhttp3.Call updateCompanyCall(UpdateCompanyRequest requestParameters, fi "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -990,7 +989,7 @@ private okhttp3.Call updateCompanyValidateBeforeCall(UpdateCompanyRequest reques * Update a company * Update a company. * @param requestOptions Object which represents the options available for a given API/request - * @return CompanyResponseModel + * @return CompanyResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -1001,8 +1000,8 @@ private okhttp3.Call updateCompanyValidateBeforeCall(UpdateCompanyRequest reques
404 Company not found -
*/ - public CompanyResponseModel updateCompany(UpdateCompanyRequest requestParameters) throws ApiException { - ApiResponse localVarResp = updateCompanyWithHttpInfo(requestParameters); + public CompanyResponse updateCompany(UpdateCompanyRequest requestParameters) throws ApiException { + ApiResponse localVarResp = updateCompanyWithHttpInfo(requestParameters); return localVarResp.getData(); } @@ -1010,7 +1009,7 @@ public CompanyResponseModel updateCompany(UpdateCompanyRequest requestParameters * Update a company * Update a company. * @param requestOptions Object which represents the options available for a given API/request - * @return ApiResponse<CompanyResponseModel> + * @return ApiResponse<CompanyResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -1021,9 +1020,9 @@ public CompanyResponseModel updateCompany(UpdateCompanyRequest requestParameters
404 Company not found -
*/ - public ApiResponse updateCompanyWithHttpInfo(UpdateCompanyRequest requestParameters) throws ApiException { + public ApiResponse updateCompanyWithHttpInfo(UpdateCompanyRequest requestParameters) throws ApiException { okhttp3.Call localVarCall = updateCompanyValidateBeforeCall(requestParameters, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -1043,10 +1042,10 @@ public ApiResponse updateCompanyWithHttpInfo(UpdateCompany 404 Company not found - */ - public okhttp3.Call updateCompanyAsync(UpdateCompanyRequest requestParameters, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateCompanyAsync(UpdateCompanyRequest requestParameters, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = updateCompanyValidateBeforeCall(requestParameters, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } @@ -1057,14 +1056,14 @@ public okhttp3.Call updateCompanyAsync(UpdateCompanyRequest requestParameters, f * @param avalaraVersion API version * @param xCorrelationId Unique correlation Id in a GUID format (optional) * @param xAvalaraClient Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . (optional) - * @param companyCreateUpdateRequestModel The updated company data (optional) + * @param createCompanyRequest The updated company data (optional) */ public class UpdateCompanyRequest { private String id; private String avalaraVersion; private String xCorrelationId; private String xAvalaraClient; - private CompanyCreateUpdateRequestModel companyCreateUpdateRequestModel; + private CreateCompanyRequest createCompanyRequest; public UpdateCompanyRequest () { } @@ -1077,8 +1076,8 @@ public UpdateCompanyRequest () { public void setXCorrelationId(String xCorrelationId) { this.xCorrelationId = xCorrelationId; } public String getXAvalaraClient() { return xAvalaraClient; } public void setXAvalaraClient(String xAvalaraClient) { this.xAvalaraClient = xAvalaraClient; } - public CompanyCreateUpdateRequestModel getCompanyCreateUpdateRequestModel() { return companyCreateUpdateRequestModel; } - public void setCompanyCreateUpdateRequestModel(CompanyCreateUpdateRequestModel companyCreateUpdateRequestModel) { this.companyCreateUpdateRequestModel = companyCreateUpdateRequestModel; } + public CreateCompanyRequest getCreateCompanyRequest() { return createCompanyRequest; } + public void setCreateCompanyRequest(CreateCompanyRequest createCompanyRequest) { this.createCompanyRequest = createCompanyRequest; } } /** @@ -1091,7 +1090,7 @@ public UpdateCompanyRequest getUpdateCompanyRequest() { private void SetConfiguration(ApiClient client) { if (client == null) throw new MissingFormatArgumentException("client"); - this.localVarApiClient.setSdkVersion("25.8.2"); + this.localVarApiClient.setSdkVersion("25.8.3"); } } diff --git a/src/main/java/Avalara/SDK/api/A1099/V2/Forms1099Api.java b/src/main/java/Avalara/SDK/api/A1099/V2/Forms1099Api.java index 45840c4..f0e0990 100644 --- a/src/main/java/Avalara/SDK/api/A1099/V2/Forms1099Api.java +++ b/src/main/java/Avalara/SDK/api/A1099/V2/Forms1099Api.java @@ -36,16 +36,12 @@ import java.util.*; -import Avalara.SDK.model.A1099.V2.BulkUpsert1099FormsRequest; -import Avalara.SDK.model.A1099.V2.Create1099Form201Response; import Avalara.SDK.model.A1099.V2.ErrorResponse; import java.io.File; -import Avalara.SDK.model.A1099.V2.Form1099ListResponse; -import Avalara.SDK.model.A1099.V2.Form1099ProccessResult; +import Avalara.SDK.model.A1099.V2.Form1099ListRequest; import Avalara.SDK.model.A1099.V2.Get1099Form200Response; -import Avalara.SDK.model.A1099.V2.ICreateForm1099Request; -import Avalara.SDK.model.A1099.V2.IUpdateForm1099Request; -import Avalara.SDK.model.A1099.V2.Update1099Form200Response; +import Avalara.SDK.model.A1099.V2.JobResponse; +import Avalara.SDK.model.A1099.V2.PaginatedQueryResultModelForm1099Base; import java.lang.reflect.Type; import java.util.ArrayList; @@ -117,7 +113,7 @@ public okhttp3.Call bulkUpsert1099FormsCall(BulkUpsert1099FormsRequest requestPa basePath = null; } - Object localVarPostBody = requestParameters.getBulkUpsert1099FormsRequest(); + Object localVarPostBody = requestParameters.getForm1099ListRequest(); // create path and map variables String localVarPath = "/1099/forms/$bulk-upsert"; @@ -148,7 +144,7 @@ public okhttp3.Call bulkUpsert1099FormsCall(BulkUpsert1099FormsRequest requestPa "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -179,9 +175,9 @@ private okhttp3.Call bulkUpsert1099FormsValidateBeforeCall(BulkUpsert1099FormsRe /** * Create or update multiple 1099/1095/W2/1042S forms - * This endpoint allows you to create or update multiple 1099/1095/W2/1042S forms. You can use one of the following payload structures: **Form 1099-MISC:** ```json { \"formType\": \"1099-MISC\", \"forms\": [ { \"IssuerId\": \"123456\", \"IssuerReferenceId\": \"REF123\", \"IssuerTin\": \"12-3456789\", \"TaxYear\": 2023, \"ReferenceId\": \"FORM123456\", \"RecipientName\": \"John Doe\", \"RecipientTin\": \"587-65-4321\", \"TinType\": \"SSN\", \"RecipientSecondName\": \"Jane Doe\", \"Address\": \"123 Main Street\", \"Address2\": \"Apt 4B\", \"City\": \"New York\", \"State\": \"NY\", \"Zip\": \"10001\", \"Email\": \"john.doe@email.com\", \"AccountNumber\": \"ACC123456\", \"OfficeCode\": \"NYC01\", \"SecondTinNotice\": false, \"NonUsProvince\": \"\", \"CountryCode\": \"US\", \"Rents\": 12000.00, \"Royalties\": 5000.00, \"OtherIncome\": 3000.00, \"FishingBoatProceeds\": 0.00, \"MedicalAndHealthCarePayments\": 15000.00, \"SubstitutePayments\": 1000.00, \"CropInsuranceProceeds\": 0.00, \"GrossProceedsPaidToAttorney\": 7500.00, \"FishPurchasedForResale\": 0.00, \"FedIncomeTaxWithheld\": 5000.00, \"Section409ADeferrals\": 0.00, \"ExcessGoldenParachutePayments\": 0.00, \"NonqualifiedDeferredCompensation\": 0.00, \"DirectSalesIndicator\": false, \"FatcaFilingRequirement\": false, \"StateAndLocalWithholding\": { \"StateTaxWithheld\": 2500.00, \"LocalTaxWithheld\": 1000.00, \"State\": \"NY\", \"StateIdNumber\": \"NY123456\", \"Locality\": \"New York City\", \"StateIncome\": 35000.00, \"LocalIncome\": 35000.00 } } ] } ``` **Form 1099-NEC:** ```json { \"formType\": \"1099-NEC\", \"forms\": [ { \"issuerID\": \"180337282\", \"issuerReferenceId\": \"ISS123\", \"issuerTin\": \"12-3000000\", \"taxYear\": 2024, \"referenceID\": \"REF-002\", \"recipientName\": \"Jane Smith\", \"recipientSecondName\": \"\", \"recipientTin\": \"587-65-4321\", \"tinType\": \"SSN\", \"address\": \"123 Center St\", \"address2\": \"\", \"city\": \"Santa Monica\", \"state\": \"CA\", \"zip\": \"90401\", \"countryCode\": \"US\", \"nonUsProvince\": \"\", \"email\": \"\", \"accountNumber\": \"\", \"officeCode\": \"\", \"secondTinNotice\": false, \"nonemployeeCompensation\": 123.45, \"directSalesIndicator\": false, \"federalIncomeTaxWithheld\": 12.34, \"stateAndLocalWithholding\": { \"state\": \"CA\", \"stateIdNumber\": \"123123123\", \"stateIncome\": 123.45, \"stateTaxWithheld\": 12.34, \"locality\": \"Santa Monica\", \"localityIdNumber\": \"456456\", \"localTaxWithheld\": 12.34, \"localIncome\": 50000.00 }, \"federalEFile\": true, \"postalMail\": true, \"stateEFile\": true, \"tinMatch\": true, \"addressVerification\": true } ] } ``` For the full version of the payload and its schema details, refer to the Swagger schemas section. + * This endpoint allows you to create or update multiple 1099/1095/W2/1042S forms. Maximum of 5000 forms can be processed in a single bulk request. * @param requestOptions Object which represents the options available for a given API/request - * @return Form1099ProccessResult + * @return JobResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -193,16 +189,16 @@ private okhttp3.Call bulkUpsert1099FormsValidateBeforeCall(BulkUpsert1099FormsRe
401 Unauthorized -
*/ - public Form1099ProccessResult bulkUpsert1099Forms(BulkUpsert1099FormsRequest requestParameters) throws ApiException { - ApiResponse localVarResp = bulkUpsert1099FormsWithHttpInfo(requestParameters); + public JobResponse bulkUpsert1099Forms(BulkUpsert1099FormsRequest requestParameters) throws ApiException { + ApiResponse localVarResp = bulkUpsert1099FormsWithHttpInfo(requestParameters); return localVarResp.getData(); } /** * Create or update multiple 1099/1095/W2/1042S forms - * This endpoint allows you to create or update multiple 1099/1095/W2/1042S forms. You can use one of the following payload structures: **Form 1099-MISC:** ```json { \"formType\": \"1099-MISC\", \"forms\": [ { \"IssuerId\": \"123456\", \"IssuerReferenceId\": \"REF123\", \"IssuerTin\": \"12-3456789\", \"TaxYear\": 2023, \"ReferenceId\": \"FORM123456\", \"RecipientName\": \"John Doe\", \"RecipientTin\": \"587-65-4321\", \"TinType\": \"SSN\", \"RecipientSecondName\": \"Jane Doe\", \"Address\": \"123 Main Street\", \"Address2\": \"Apt 4B\", \"City\": \"New York\", \"State\": \"NY\", \"Zip\": \"10001\", \"Email\": \"john.doe@email.com\", \"AccountNumber\": \"ACC123456\", \"OfficeCode\": \"NYC01\", \"SecondTinNotice\": false, \"NonUsProvince\": \"\", \"CountryCode\": \"US\", \"Rents\": 12000.00, \"Royalties\": 5000.00, \"OtherIncome\": 3000.00, \"FishingBoatProceeds\": 0.00, \"MedicalAndHealthCarePayments\": 15000.00, \"SubstitutePayments\": 1000.00, \"CropInsuranceProceeds\": 0.00, \"GrossProceedsPaidToAttorney\": 7500.00, \"FishPurchasedForResale\": 0.00, \"FedIncomeTaxWithheld\": 5000.00, \"Section409ADeferrals\": 0.00, \"ExcessGoldenParachutePayments\": 0.00, \"NonqualifiedDeferredCompensation\": 0.00, \"DirectSalesIndicator\": false, \"FatcaFilingRequirement\": false, \"StateAndLocalWithholding\": { \"StateTaxWithheld\": 2500.00, \"LocalTaxWithheld\": 1000.00, \"State\": \"NY\", \"StateIdNumber\": \"NY123456\", \"Locality\": \"New York City\", \"StateIncome\": 35000.00, \"LocalIncome\": 35000.00 } } ] } ``` **Form 1099-NEC:** ```json { \"formType\": \"1099-NEC\", \"forms\": [ { \"issuerID\": \"180337282\", \"issuerReferenceId\": \"ISS123\", \"issuerTin\": \"12-3000000\", \"taxYear\": 2024, \"referenceID\": \"REF-002\", \"recipientName\": \"Jane Smith\", \"recipientSecondName\": \"\", \"recipientTin\": \"587-65-4321\", \"tinType\": \"SSN\", \"address\": \"123 Center St\", \"address2\": \"\", \"city\": \"Santa Monica\", \"state\": \"CA\", \"zip\": \"90401\", \"countryCode\": \"US\", \"nonUsProvince\": \"\", \"email\": \"\", \"accountNumber\": \"\", \"officeCode\": \"\", \"secondTinNotice\": false, \"nonemployeeCompensation\": 123.45, \"directSalesIndicator\": false, \"federalIncomeTaxWithheld\": 12.34, \"stateAndLocalWithholding\": { \"state\": \"CA\", \"stateIdNumber\": \"123123123\", \"stateIncome\": 123.45, \"stateTaxWithheld\": 12.34, \"locality\": \"Santa Monica\", \"localityIdNumber\": \"456456\", \"localTaxWithheld\": 12.34, \"localIncome\": 50000.00 }, \"federalEFile\": true, \"postalMail\": true, \"stateEFile\": true, \"tinMatch\": true, \"addressVerification\": true } ] } ``` For the full version of the payload and its schema details, refer to the Swagger schemas section. + * This endpoint allows you to create or update multiple 1099/1095/W2/1042S forms. Maximum of 5000 forms can be processed in a single bulk request. * @param requestOptions Object which represents the options available for a given API/request - * @return ApiResponse<Form1099ProccessResult> + * @return ApiResponse<JobResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -214,15 +210,15 @@ public Form1099ProccessResult bulkUpsert1099Forms(BulkUpsert1099FormsRequest req
401 Unauthorized -
*/ - public ApiResponse bulkUpsert1099FormsWithHttpInfo(BulkUpsert1099FormsRequest requestParameters) throws ApiException { + public ApiResponse bulkUpsert1099FormsWithHttpInfo(BulkUpsert1099FormsRequest requestParameters) throws ApiException { okhttp3.Call localVarCall = bulkUpsert1099FormsValidateBeforeCall(requestParameters, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Create or update multiple 1099/1095/W2/1042S forms (asynchronously) - * This endpoint allows you to create or update multiple 1099/1095/W2/1042S forms. You can use one of the following payload structures: **Form 1099-MISC:** ```json { \"formType\": \"1099-MISC\", \"forms\": [ { \"IssuerId\": \"123456\", \"IssuerReferenceId\": \"REF123\", \"IssuerTin\": \"12-3456789\", \"TaxYear\": 2023, \"ReferenceId\": \"FORM123456\", \"RecipientName\": \"John Doe\", \"RecipientTin\": \"587-65-4321\", \"TinType\": \"SSN\", \"RecipientSecondName\": \"Jane Doe\", \"Address\": \"123 Main Street\", \"Address2\": \"Apt 4B\", \"City\": \"New York\", \"State\": \"NY\", \"Zip\": \"10001\", \"Email\": \"john.doe@email.com\", \"AccountNumber\": \"ACC123456\", \"OfficeCode\": \"NYC01\", \"SecondTinNotice\": false, \"NonUsProvince\": \"\", \"CountryCode\": \"US\", \"Rents\": 12000.00, \"Royalties\": 5000.00, \"OtherIncome\": 3000.00, \"FishingBoatProceeds\": 0.00, \"MedicalAndHealthCarePayments\": 15000.00, \"SubstitutePayments\": 1000.00, \"CropInsuranceProceeds\": 0.00, \"GrossProceedsPaidToAttorney\": 7500.00, \"FishPurchasedForResale\": 0.00, \"FedIncomeTaxWithheld\": 5000.00, \"Section409ADeferrals\": 0.00, \"ExcessGoldenParachutePayments\": 0.00, \"NonqualifiedDeferredCompensation\": 0.00, \"DirectSalesIndicator\": false, \"FatcaFilingRequirement\": false, \"StateAndLocalWithholding\": { \"StateTaxWithheld\": 2500.00, \"LocalTaxWithheld\": 1000.00, \"State\": \"NY\", \"StateIdNumber\": \"NY123456\", \"Locality\": \"New York City\", \"StateIncome\": 35000.00, \"LocalIncome\": 35000.00 } } ] } ``` **Form 1099-NEC:** ```json { \"formType\": \"1099-NEC\", \"forms\": [ { \"issuerID\": \"180337282\", \"issuerReferenceId\": \"ISS123\", \"issuerTin\": \"12-3000000\", \"taxYear\": 2024, \"referenceID\": \"REF-002\", \"recipientName\": \"Jane Smith\", \"recipientSecondName\": \"\", \"recipientTin\": \"587-65-4321\", \"tinType\": \"SSN\", \"address\": \"123 Center St\", \"address2\": \"\", \"city\": \"Santa Monica\", \"state\": \"CA\", \"zip\": \"90401\", \"countryCode\": \"US\", \"nonUsProvince\": \"\", \"email\": \"\", \"accountNumber\": \"\", \"officeCode\": \"\", \"secondTinNotice\": false, \"nonemployeeCompensation\": 123.45, \"directSalesIndicator\": false, \"federalIncomeTaxWithheld\": 12.34, \"stateAndLocalWithholding\": { \"state\": \"CA\", \"stateIdNumber\": \"123123123\", \"stateIncome\": 123.45, \"stateTaxWithheld\": 12.34, \"locality\": \"Santa Monica\", \"localityIdNumber\": \"456456\", \"localTaxWithheld\": 12.34, \"localIncome\": 50000.00 }, \"federalEFile\": true, \"postalMail\": true, \"stateEFile\": true, \"tinMatch\": true, \"addressVerification\": true } ] } ``` For the full version of the payload and its schema details, refer to the Swagger schemas section. + * This endpoint allows you to create or update multiple 1099/1095/W2/1042S forms. Maximum of 5000 forms can be processed in a single bulk request. * @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 @@ -237,10 +233,10 @@ public ApiResponse bulkUpsert1099FormsWithHttpInfo(BulkU 401 Unauthorized - */ - public okhttp3.Call bulkUpsert1099FormsAsync(BulkUpsert1099FormsRequest requestParameters, final ApiCallback _callback) throws ApiException { + public okhttp3.Call bulkUpsert1099FormsAsync(BulkUpsert1099FormsRequest requestParameters, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = bulkUpsert1099FormsValidateBeforeCall(requestParameters, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } @@ -248,17 +244,17 @@ public okhttp3.Call bulkUpsert1099FormsAsync(BulkUpsert1099FormsRequest requestP * Represents the Request object for the BulkUpsert1099Forms API * * @param avalaraVersion API version - * @param dryRun (optional, default to false) + * @param dryRun defaults to false. If true, it will NOT change the DB. It will just return a report of what would've have been changed in the DB (optional, default to false) * @param xCorrelationId Unique correlation Id in a GUID format (optional) * @param xAvalaraClient Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . (optional) - * @param bulkUpsert1099FormsRequest (optional) + * @param form1099ListRequest (optional) */ public class BulkUpsert1099FormsRequest { private String avalaraVersion; private Boolean dryRun; private String xCorrelationId; private String xAvalaraClient; - private BulkUpsert1099FormsRequest bulkUpsert1099FormsRequest; + private Form1099ListRequest form1099ListRequest; public BulkUpsert1099FormsRequest () { } @@ -271,8 +267,8 @@ public BulkUpsert1099FormsRequest () { public void setXCorrelationId(String xCorrelationId) { this.xCorrelationId = xCorrelationId; } public String getXAvalaraClient() { return xAvalaraClient; } public void setXAvalaraClient(String xAvalaraClient) { this.xAvalaraClient = xAvalaraClient; } - public BulkUpsert1099FormsRequest getBulkUpsert1099FormsRequest() { return bulkUpsert1099FormsRequest; } - public void setBulkUpsert1099FormsRequest(BulkUpsert1099FormsRequest bulkUpsert1099FormsRequest) { this.bulkUpsert1099FormsRequest = bulkUpsert1099FormsRequest; } + public Form1099ListRequest getForm1099ListRequest() { return form1099ListRequest; } + public void setForm1099ListRequest(Form1099ListRequest form1099ListRequest) { this.form1099ListRequest = form1099ListRequest; } } /** @@ -316,7 +312,7 @@ public okhttp3.Call create1099FormCall(Create1099FormRequest requestParameters, basePath = null; } - Object localVarPostBody = requestParameters.getIcreateForm1099Request(); + Object localVarPostBody = requestParameters.getGet1099Form200Response(); // create path and map variables String localVarPath = "/1099/forms"; @@ -343,7 +339,7 @@ public okhttp3.Call create1099FormCall(Create1099FormRequest requestParameters, "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -376,7 +372,7 @@ private okhttp3.Call create1099FormValidateBeforeCall(Create1099FormRequest requ * Create a 1099/1095/W2/1042S form * Create a 1099/1095/W2/1042S form. * @param requestOptions Object which represents the options available for a given API/request - * @return Create1099Form201Response + * @return Get1099Form200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -387,8 +383,8 @@ private okhttp3.Call create1099FormValidateBeforeCall(Create1099FormRequest requ
401 Unauthorized -
*/ - public Create1099Form201Response create1099Form(Create1099FormRequest requestParameters) throws ApiException { - ApiResponse localVarResp = create1099FormWithHttpInfo(requestParameters); + public Get1099Form200Response create1099Form(Create1099FormRequest requestParameters) throws ApiException { + ApiResponse localVarResp = create1099FormWithHttpInfo(requestParameters); return localVarResp.getData(); } @@ -396,7 +392,7 @@ public Create1099Form201Response create1099Form(Create1099FormRequest requestPar * Create a 1099/1095/W2/1042S form * Create a 1099/1095/W2/1042S form. * @param requestOptions Object which represents the options available for a given API/request - * @return ApiResponse<Create1099Form201Response> + * @return ApiResponse<Get1099Form200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -407,9 +403,9 @@ public Create1099Form201Response create1099Form(Create1099FormRequest requestPar
401 Unauthorized -
*/ - public ApiResponse create1099FormWithHttpInfo(Create1099FormRequest requestParameters) throws ApiException { + public ApiResponse create1099FormWithHttpInfo(Create1099FormRequest requestParameters) throws ApiException { okhttp3.Call localVarCall = create1099FormValidateBeforeCall(requestParameters, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -429,10 +425,10 @@ public ApiResponse create1099FormWithHttpInfo(Create1 401 Unauthorized - */ - public okhttp3.Call create1099FormAsync(Create1099FormRequest requestParameters, final ApiCallback _callback) throws ApiException { + public okhttp3.Call create1099FormAsync(Create1099FormRequest requestParameters, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = create1099FormValidateBeforeCall(requestParameters, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } @@ -442,13 +438,13 @@ public okhttp3.Call create1099FormAsync(Create1099FormRequest requestParameters, * @param avalaraVersion API version * @param xCorrelationId Unique correlation Id in a GUID format (optional) * @param xAvalaraClient Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . (optional) - * @param icreateForm1099Request (optional) + * @param get1099Form200Response (optional) */ public class Create1099FormRequest { private String avalaraVersion; private String xCorrelationId; private String xAvalaraClient; - private ICreateForm1099Request icreateForm1099Request; + private Get1099Form200Response get1099Form200Response; public Create1099FormRequest () { } @@ -459,8 +455,8 @@ public Create1099FormRequest () { public void setXCorrelationId(String xCorrelationId) { this.xCorrelationId = xCorrelationId; } public String getXAvalaraClient() { return xAvalaraClient; } public void setXAvalaraClient(String xAvalaraClient) { this.xAvalaraClient = xAvalaraClient; } - public ICreateForm1099Request getIcreateForm1099Request() { return icreateForm1099Request; } - public void setIcreateForm1099Request(ICreateForm1099Request icreateForm1099Request) { this.icreateForm1099Request = icreateForm1099Request; } + public Get1099Form200Response getGet1099Form200Response() { return get1099Form200Response; } + public void setGet1099Form200Response(Get1099Form200Response get1099Form200Response) { this.get1099Form200Response = get1099Form200Response; } } /** @@ -534,7 +530,7 @@ public okhttp3.Call delete1099FormCall(Delete1099FormRequest requestParameters, "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -731,7 +727,7 @@ public okhttp3.Call get1099FormCall(Get1099FormRequest requestParameters, final "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -933,7 +929,7 @@ public okhttp3.Call get1099FormPdfCall(Get1099FormPdfRequest requestParameters, "application/pdf", "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -1134,6 +1130,14 @@ public okhttp3.Call list1099FormsCall(List1099FormsRequest requestParameters, fi localVarQueryParams.addAll(localVarApiClient.parameterToPair("$orderBy", requestParameters.get$orderBy())); } + if (requestParameters.getCount() != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("count", requestParameters.getCount())); + } + + if (requestParameters.getCountOnly() != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("countOnly", requestParameters.getCountOnly())); + } + if (requestParameters.getAvalaraVersion() != null) { localVarHeaderParams.put("avalara-version", localVarApiClient.parameterToString(requestParameters.getAvalaraVersion())); } @@ -1150,7 +1154,7 @@ public okhttp3.Call list1099FormsCall(List1099FormsRequest requestParameters, fi "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -1181,9 +1185,9 @@ private okhttp3.Call list1099FormsValidateBeforeCall(List1099FormsRequest reques /** * List 1099/1095/W2/1042S forms - * List 1099/1095/W2/1042S forms. Filterable fields are name, referenceId and taxYear. + * List 1099/1095/W2/1042S forms. Collections support filtering only on certain fields. An attempt to filter on an unsupported field will receive a 400 Bad Request response. Supported filtering fields are as follows: - issuerId - issuerReferenceId - taxYear - addressVerificationStatus - possible values are: unknown, pending, failed, incomplete, unchanged, verified - createdAt - edeliveryStatus - possible values are: sent, unscheduled, bad_verify, bad_verify_limit, scheduled, bounced, accepted - email - federalEfileStatus - possible values are: unscheduled, scheduled, sent, corrected_scheduled, accepted, corrected, corrected_accepted, held - recipientName - mailStatus - possible values are: sent, unscheduled, pending, delivered - referenceId - tinMatchStatus - possible values are: none, pending, matched, failed - type - possible values are: 940, 941, 943, 944, 945, 1042, 1042-S, 1095-B, 1095-C, 1097-BTC, 1098, 1098-C, 1098-E, 1098-Q, 1098-T, 3921, 3922, 5498, 5498-ESA, 5498-SA, 1099-MISC, 1099-A, 1099-B, 1099-C, 1099-CAP, 1099-DIV, 1099-G, 1099-INT, 1099-K, 1099-LS, 1099-LTC, 1099-NEC, 1099-OID, 1099-PATR, 1099-Q, 1099-R, 1099-S, 1099-SA, T4A, W-2, W-2G, 1099-HC - updatedAt - validity - possible values are: true, false For more information on filtering, see <see href=\"https://developer.avalara.com/avatax/filtering-in-rest/\">Filtering in REST</see>. * @param requestOptions Object which represents the options available for a given API/request - * @return Form1099ListResponse + * @return PaginatedQueryResultModelForm1099Base * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -1195,16 +1199,16 @@ private okhttp3.Call list1099FormsValidateBeforeCall(List1099FormsRequest reques
401 Unauthorized -
*/ - public Form1099ListResponse list1099Forms(List1099FormsRequest requestParameters) throws ApiException { - ApiResponse localVarResp = list1099FormsWithHttpInfo(requestParameters); + public PaginatedQueryResultModelForm1099Base list1099Forms(List1099FormsRequest requestParameters) throws ApiException { + ApiResponse localVarResp = list1099FormsWithHttpInfo(requestParameters); return localVarResp.getData(); } /** * List 1099/1095/W2/1042S forms - * List 1099/1095/W2/1042S forms. Filterable fields are name, referenceId and taxYear. + * List 1099/1095/W2/1042S forms. Collections support filtering only on certain fields. An attempt to filter on an unsupported field will receive a 400 Bad Request response. Supported filtering fields are as follows: - issuerId - issuerReferenceId - taxYear - addressVerificationStatus - possible values are: unknown, pending, failed, incomplete, unchanged, verified - createdAt - edeliveryStatus - possible values are: sent, unscheduled, bad_verify, bad_verify_limit, scheduled, bounced, accepted - email - federalEfileStatus - possible values are: unscheduled, scheduled, sent, corrected_scheduled, accepted, corrected, corrected_accepted, held - recipientName - mailStatus - possible values are: sent, unscheduled, pending, delivered - referenceId - tinMatchStatus - possible values are: none, pending, matched, failed - type - possible values are: 940, 941, 943, 944, 945, 1042, 1042-S, 1095-B, 1095-C, 1097-BTC, 1098, 1098-C, 1098-E, 1098-Q, 1098-T, 3921, 3922, 5498, 5498-ESA, 5498-SA, 1099-MISC, 1099-A, 1099-B, 1099-C, 1099-CAP, 1099-DIV, 1099-G, 1099-INT, 1099-K, 1099-LS, 1099-LTC, 1099-NEC, 1099-OID, 1099-PATR, 1099-Q, 1099-R, 1099-S, 1099-SA, T4A, W-2, W-2G, 1099-HC - updatedAt - validity - possible values are: true, false For more information on filtering, see <see href=\"https://developer.avalara.com/avatax/filtering-in-rest/\">Filtering in REST</see>. * @param requestOptions Object which represents the options available for a given API/request - * @return ApiResponse<Form1099ListResponse> + * @return ApiResponse<PaginatedQueryResultModelForm1099Base> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -1216,15 +1220,15 @@ public Form1099ListResponse list1099Forms(List1099FormsRequest requestParameters
401 Unauthorized -
*/ - public ApiResponse list1099FormsWithHttpInfo(List1099FormsRequest requestParameters) throws ApiException { + public ApiResponse list1099FormsWithHttpInfo(List1099FormsRequest requestParameters) throws ApiException { okhttp3.Call localVarCall = list1099FormsValidateBeforeCall(requestParameters, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * List 1099/1095/W2/1042S forms (asynchronously) - * List 1099/1095/W2/1042S forms. Filterable fields are name, referenceId and taxYear. + * List 1099/1095/W2/1042S forms. Collections support filtering only on certain fields. An attempt to filter on an unsupported field will receive a 400 Bad Request response. Supported filtering fields are as follows: - issuerId - issuerReferenceId - taxYear - addressVerificationStatus - possible values are: unknown, pending, failed, incomplete, unchanged, verified - createdAt - edeliveryStatus - possible values are: sent, unscheduled, bad_verify, bad_verify_limit, scheduled, bounced, accepted - email - federalEfileStatus - possible values are: unscheduled, scheduled, sent, corrected_scheduled, accepted, corrected, corrected_accepted, held - recipientName - mailStatus - possible values are: sent, unscheduled, pending, delivered - referenceId - tinMatchStatus - possible values are: none, pending, matched, failed - type - possible values are: 940, 941, 943, 944, 945, 1042, 1042-S, 1095-B, 1095-C, 1097-BTC, 1098, 1098-C, 1098-E, 1098-Q, 1098-T, 3921, 3922, 5498, 5498-ESA, 5498-SA, 1099-MISC, 1099-A, 1099-B, 1099-C, 1099-CAP, 1099-DIV, 1099-G, 1099-INT, 1099-K, 1099-LS, 1099-LTC, 1099-NEC, 1099-OID, 1099-PATR, 1099-Q, 1099-R, 1099-S, 1099-SA, T4A, W-2, W-2G, 1099-HC - updatedAt - validity - possible values are: true, false For more information on filtering, see <see href=\"https://developer.avalara.com/avatax/filtering-in-rest/\">Filtering in REST</see>. * @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 @@ -1239,10 +1243,10 @@ public ApiResponse list1099FormsWithHttpInfo(List1099Forms 401 Unauthorized - */ - public okhttp3.Call list1099FormsAsync(List1099FormsRequest requestParameters, final ApiCallback _callback) throws ApiException { + public okhttp3.Call list1099FormsAsync(List1099FormsRequest requestParameters, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = list1099FormsValidateBeforeCall(requestParameters, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } @@ -1250,10 +1254,12 @@ public okhttp3.Call list1099FormsAsync(List1099FormsRequest requestParameters, f * Represents the Request object for the List1099Forms API * * @param avalaraVersion API version - * @param $filter A filter statement to identify specific records to retrieve. For more information on filtering, see Filtering in REST. Collections support filtering only on certain fields. An attempt to filter on an unsupported field will receive a 400 Bad Request response. Supported filtering fields are as follows: issuerId issuerReferenceId taxYear addressVerificationStatus - possible values are: unknown, pending, failed, incomplete, unchanged, verified createdAt edeliveryStatus - possible values are: sent, unscheduled, bad_verify, bad_verify_limit, scheduled, bounced, accepted email federalEfileStatus - possible values are: unscheduled, scheduled, sent, corrected_scheduled, accepted, corrected, corrected_accepted, held recipientName mailStatus - possible values are: sent, unscheduled, pending, delivered referenceId tinMatchStatus - possible values are: none, pending, matched, failed type - possible values are: 940, 941, 943, 944, 945, 1042, 1042-S, 1095-B, 1095-C, 1097-BTC, 1098, 1098-C, 1098-E, 1098-Q, 1098-T, 3921, 3922, 5498, 5498-ESA, 5498-SA, 1099-MISC, 1099-A, 1099-B, 1099-C, 1099-CAP, 1099-DIV, 1099-G, 1099-INT, 1099-K, 1099-LS, 1099-LTC, 1099-NEC, 1099-OID, 1099-PATR, 1099-Q, 1099-R, 1099-S, 1099-SA, T4A, W-2, W-2G, 1099-HC updatedAt validity - possible values are: true, false (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, default to 10) - * @param $skip If nonzero, skip this number of results before returning data. Used with top to provide pagination for large datasets. (optional, default to 0) - * @param $orderBy A comma separated list of sort statements in the format (fieldname) [ASC|DESC], for example issuerReferenceId ASC. Supported sorting fields are: issuerReferenceId taxYear createdAt recipientName updatedAt (optional) + * @param $filter A filter statement to identify specific records to retrieve. For more information on filtering, see Filtering in REST. (optional) + * @param $top If zero or greater than 1000, return at most 1000 results. Otherwise, return this number of results. Used with skip to provide pagination for large datasets. (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 A comma separated list of sort statements in the format (fieldname) [ASC|DESC], for example id ASC. (optional) + * @param count If true, return the global count of elements in the collection. (optional) + * @param countOnly If true, return ONLY the global count of elements in the collection. It only applies when count=true. (optional) * @param xCorrelationId Unique correlation Id in a GUID format (optional) * @param xAvalaraClient Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . (optional) */ @@ -1263,6 +1269,8 @@ public class List1099FormsRequest { private Integer $top; private Integer $skip; private String $orderBy; + private Boolean count; + private Boolean countOnly; private String xCorrelationId; private String xAvalaraClient; @@ -1279,6 +1287,10 @@ public List1099FormsRequest () { public void set$skip(Integer $skip) { this.$skip = $skip; } public String get$orderBy() { return $orderBy; } public void set$orderBy(String $orderBy) { this.$orderBy = $orderBy; } + public Boolean getCount() { return count; } + public void setCount(Boolean count) { this.count = count; } + public Boolean getCountOnly() { return countOnly; } + public void setCountOnly(Boolean countOnly) { this.countOnly = countOnly; } public String getXCorrelationId() { return xCorrelationId; } public void setXCorrelationId(String xCorrelationId) { this.xCorrelationId = xCorrelationId; } public String getXAvalaraClient() { return xAvalaraClient; } @@ -1327,7 +1339,7 @@ public okhttp3.Call update1099FormCall(Update1099FormRequest requestParameters, basePath = null; } - Object localVarPostBody = requestParameters.getIupdateForm1099Request(); + Object localVarPostBody = requestParameters.getGet1099Form200Response(); // create path and map variables String localVarPath = "/1099/forms/{id}" @@ -1355,7 +1367,7 @@ public okhttp3.Call update1099FormCall(Update1099FormRequest requestParameters, "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -1393,7 +1405,7 @@ private okhttp3.Call update1099FormValidateBeforeCall(Update1099FormRequest requ * Update a 1099/1095/W2/1042S form * Update a 1099/1095/W2/1042S form. * @param requestOptions Object which represents the options available for a given API/request - * @return Update1099Form200Response + * @return Get1099Form200Response * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -1405,8 +1417,8 @@ private okhttp3.Call update1099FormValidateBeforeCall(Update1099FormRequest requ
401 Unauthorized -
*/ - public Update1099Form200Response update1099Form(Update1099FormRequest requestParameters) throws ApiException { - ApiResponse localVarResp = update1099FormWithHttpInfo(requestParameters); + public Get1099Form200Response update1099Form(Update1099FormRequest requestParameters) throws ApiException { + ApiResponse localVarResp = update1099FormWithHttpInfo(requestParameters); return localVarResp.getData(); } @@ -1414,7 +1426,7 @@ public Update1099Form200Response update1099Form(Update1099FormRequest requestPar * Update a 1099/1095/W2/1042S form * Update a 1099/1095/W2/1042S form. * @param requestOptions Object which represents the options available for a given API/request - * @return ApiResponse<Update1099Form200Response> + * @return ApiResponse<Get1099Form200Response> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -1426,9 +1438,9 @@ public Update1099Form200Response update1099Form(Update1099FormRequest requestPar
401 Unauthorized -
*/ - public ApiResponse update1099FormWithHttpInfo(Update1099FormRequest requestParameters) throws ApiException { + public ApiResponse update1099FormWithHttpInfo(Update1099FormRequest requestParameters) throws ApiException { okhttp3.Call localVarCall = update1099FormValidateBeforeCall(requestParameters, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -1449,10 +1461,10 @@ public ApiResponse update1099FormWithHttpInfo(Update1 401 Unauthorized - */ - public okhttp3.Call update1099FormAsync(Update1099FormRequest requestParameters, final ApiCallback _callback) throws ApiException { + public okhttp3.Call update1099FormAsync(Update1099FormRequest requestParameters, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = update1099FormValidateBeforeCall(requestParameters, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } @@ -1463,14 +1475,14 @@ public okhttp3.Call update1099FormAsync(Update1099FormRequest requestParameters, * @param avalaraVersion API version * @param xCorrelationId Unique correlation Id in a GUID format (optional) * @param xAvalaraClient Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . (optional) - * @param iupdateForm1099Request (optional) + * @param get1099Form200Response (optional) */ public class Update1099FormRequest { private String id; private String avalaraVersion; private String xCorrelationId; private String xAvalaraClient; - private IUpdateForm1099Request iupdateForm1099Request; + private Get1099Form200Response get1099Form200Response; public Update1099FormRequest () { } @@ -1483,8 +1495,8 @@ public Update1099FormRequest () { public void setXCorrelationId(String xCorrelationId) { this.xCorrelationId = xCorrelationId; } public String getXAvalaraClient() { return xAvalaraClient; } public void setXAvalaraClient(String xAvalaraClient) { this.xAvalaraClient = xAvalaraClient; } - public IUpdateForm1099Request getIupdateForm1099Request() { return iupdateForm1099Request; } - public void setIupdateForm1099Request(IUpdateForm1099Request iupdateForm1099Request) { this.iupdateForm1099Request = iupdateForm1099Request; } + public Get1099Form200Response getGet1099Form200Response() { return get1099Form200Response; } + public void setGet1099Form200Response(Get1099Form200Response get1099Form200Response) { this.get1099Form200Response = get1099Form200Response; } } /** @@ -1497,7 +1509,7 @@ public Update1099FormRequest getUpdate1099FormRequest() { private void SetConfiguration(ApiClient client) { if (client == null) throw new MissingFormatArgumentException("client"); - this.localVarApiClient.setSdkVersion("25.8.2"); + this.localVarApiClient.setSdkVersion("25.8.3"); } } diff --git a/src/main/java/Avalara/SDK/api/A1099/V2/FormsW9Api.java b/src/main/java/Avalara/SDK/api/A1099/V2/FormsW9Api.java index f845ec3..59b3181 100644 --- a/src/main/java/Avalara/SDK/api/A1099/V2/FormsW9Api.java +++ b/src/main/java/Avalara/SDK/api/A1099/V2/FormsW9Api.java @@ -36,6 +36,7 @@ import java.util.*; +import Avalara.SDK.model.A1099.V2.CreateAndSendW9FormEmailRequest; import Avalara.SDK.model.A1099.V2.CreateW9Form201Response; import Avalara.SDK.model.A1099.V2.CreateW9FormRequest; import Avalara.SDK.model.A1099.V2.ErrorModel; @@ -80,6 +81,190 @@ public void setCustomBaseUrl(String customBaseUrl) { this.localCustomBaseUrl = customBaseUrl; } + /** + * Build call for createAndSendW9FormEmail + * @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
201 The created W9/W4/W8 form -
400 Bad request (e.g. Unknown form type: W10\") -
401 Authentication failed -
+ */ + public okhttp3.Call createAndSendW9FormEmailCall(CreateAndSendW9FormEmailRequest 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.getCreateAndSendW9FormEmailRequest(); + + // create path and map variables + String localVarPath = "/w9/forms/$create-and-send-email"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (requestParameters.getAvalaraVersion() != null) { + localVarHeaderParams.put("avalara-version", localVarApiClient.parameterToString(requestParameters.getAvalaraVersion())); + } + + if (requestParameters.getXCorrelationId() != null) { + localVarHeaderParams.put("X-Correlation-Id", localVarApiClient.parameterToString(requestParameters.getXCorrelationId())); + } + + 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.containsKey("Accept")) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", "text/json", "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, AvalaraMicroservice.A1099); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createAndSendW9FormEmailValidateBeforeCall(CreateAndSendW9FormEmailRequest 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 createAndSendW9FormEmail(Async)"); + } + + + okhttp3.Call localVarCall = createAndSendW9FormEmailCall(requestParameters, _callback); + return localVarCall; + + } + + /** + * Create a minimal W9/W4/W8 form and sends the e-mail request + * Create a minimal W9/W4/W8 form and sends the e-mail request. + * @param requestOptions Object which represents the options available for a given API/request + * @return CreateW9Form201Response + * @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
201 The created W9/W4/W8 form -
400 Bad request (e.g. Unknown form type: W10\") -
401 Authentication failed -
+ */ + public CreateW9Form201Response createAndSendW9FormEmail(CreateAndSendW9FormEmailRequest requestParameters) throws ApiException { + ApiResponse localVarResp = createAndSendW9FormEmailWithHttpInfo(requestParameters); + return localVarResp.getData(); + } + + /** + * Create a minimal W9/W4/W8 form and sends the e-mail request + * Create a minimal W9/W4/W8 form and sends the e-mail request. + * @param requestOptions Object which represents the options available for a given API/request + * @return ApiResponse<CreateW9Form201Response> + * @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
201 The created W9/W4/W8 form -
400 Bad request (e.g. Unknown form type: W10\") -
401 Authentication failed -
+ */ + public ApiResponse createAndSendW9FormEmailWithHttpInfo(CreateAndSendW9FormEmailRequest requestParameters) throws ApiException { + okhttp3.Call localVarCall = createAndSendW9FormEmailValidateBeforeCall(requestParameters, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create a minimal W9/W4/W8 form and sends the e-mail request (asynchronously) + * Create a minimal W9/W4/W8 form and sends the e-mail request. + * @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
201 The created W9/W4/W8 form -
400 Bad request (e.g. Unknown form type: W10\") -
401 Authentication failed -
+ */ + public okhttp3.Call createAndSendW9FormEmailAsync(CreateAndSendW9FormEmailRequest requestParameters, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createAndSendW9FormEmailValidateBeforeCall(requestParameters, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Represents the Request object for the CreateAndSendW9FormEmail API + * + * @param avalaraVersion API version + * @param xCorrelationId Unique correlation Id in a GUID format (optional) + * @param xAvalaraClient Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . (optional) + * @param createAndSendW9FormEmailRequest Form to be created (optional) + */ + public class CreateAndSendW9FormEmailRequest { + private String avalaraVersion; + private String xCorrelationId; + private String xAvalaraClient; + private CreateAndSendW9FormEmailRequest createAndSendW9FormEmailRequest; + + public CreateAndSendW9FormEmailRequest () { + } + + public String getAvalaraVersion() { return (avalaraVersion != null) ? avalaraVersion : "2.0"; } + public void setAvalaraVersion(String avalaraVersion) { this.avalaraVersion = avalaraVersion; } + public String getXCorrelationId() { return xCorrelationId; } + public void setXCorrelationId(String xCorrelationId) { this.xCorrelationId = xCorrelationId; } + public String getXAvalaraClient() { return xAvalaraClient; } + public void setXAvalaraClient(String xAvalaraClient) { this.xAvalaraClient = xAvalaraClient; } + public CreateAndSendW9FormEmailRequest getCreateAndSendW9FormEmailRequest() { return createAndSendW9FormEmailRequest; } + public void setCreateAndSendW9FormEmailRequest(CreateAndSendW9FormEmailRequest createAndSendW9FormEmailRequest) { this.createAndSendW9FormEmailRequest = createAndSendW9FormEmailRequest; } + } + + /** + * Getter function to instantiate Request class + * @returns CreateAndSendW9FormEmailRequest + */ + public CreateAndSendW9FormEmailRequest getCreateAndSendW9FormEmailRequest() { + return this.new CreateAndSendW9FormEmailRequest(); + } + /** * Build call for createW9Form * @param requestOptions Object which represents the options available for a given API/request @@ -139,7 +324,7 @@ public okhttp3.Call createW9FormCall(CreateW9FormRequest requestParameters, fina "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -324,7 +509,7 @@ public okhttp3.Call deleteW9FormCall(DeleteW9FormRequest requestParameters, fina "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -510,7 +695,7 @@ public okhttp3.Call getW9FormCall(GetW9FormRequest requestParameters, final ApiC "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -651,7 +836,7 @@ public GetW9FormRequest getGetW9FormRequest() { Status Code Description Response Headers 400 Bad request (e.g., invalid sort key) - 401 Authentication failed - - 200 List of forms - + 200 list - */ public okhttp3.Call listW9FormsCall(ListW9FormsRequest requestParameters, final ApiCallback _callback) throws ApiException { @@ -723,7 +908,7 @@ public okhttp3.Call listW9FormsCall(ListW9FormsRequest requestParameters, final "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -763,7 +948,7 @@ private okhttp3.Call listW9FormsValidateBeforeCall(ListW9FormsRequest requestPar Status Code Description Response Headers 400 Bad request (e.g., invalid sort key) - 401 Authentication failed - - 200 List of forms - + 200 list - */ public PaginatedQueryResultModelW9FormBaseResponse listW9Forms(ListW9FormsRequest requestParameters) throws ApiException { @@ -782,7 +967,7 @@ public PaginatedQueryResultModelW9FormBaseResponse listW9Forms(ListW9FormsReques Status Code Description Response Headers 400 Bad request (e.g., invalid sort key) - 401 Authentication failed - - 200 List of forms - + 200 list - */ public ApiResponse listW9FormsWithHttpInfo(ListW9FormsRequest requestParameters) throws ApiException { @@ -803,7 +988,7 @@ public ApiResponse listW9FormsWithH Status Code Description Response Headers 400 Bad request (e.g., invalid sort key) - 401 Authentication failed - - 200 List of forms - + 200 list - */ public okhttp3.Call listW9FormsAsync(ListW9FormsRequest requestParameters, final ApiCallback _callback) throws ApiException { @@ -877,7 +1062,8 @@ public ListW9FormsRequest getListW9FormsRequest() { * @http.response.details - + +
Status Code Description Response Headers
200 The updated W9/W4/W8 form -
200 Email sent using existing form (form was already in 'Requested' status or descendant found) -
201 Email sent using newly created minimal form -
400 Bad request (e.g., invalid sort key) -
401 Authentication failed -
@@ -928,7 +1114,7 @@ public okhttp3.Call sendW9FormEmailCall(SendW9FormEmailRequest requestParameters "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -964,46 +1150,48 @@ private okhttp3.Call sendW9FormEmailValidateBeforeCall(SendW9FormEmailRequest re /** * Send an email to the vendor/payee requesting they fill out a W9/W4/W8 form - * Send an email to the vendor/payee requesting they fill out a W9/W4/W8 form. + * Send an email to the vendor/payee requesting they fill out a W9/W4/W8 form. If the form is not in 'Requested' status, it will either use an existing descendant form in 'Requested' status or create a new minimal form and send the email request. * @param requestOptions Object which represents the options available for a given API/request - * @return IW9FormDataModelsOneOf + * @return CreateW9Form201Response * @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 The updated W9/W4/W8 form -
200 Email sent using existing form (form was already in 'Requested' status or descendant found) -
201 Email sent using newly created minimal form -
400 Bad request (e.g., invalid sort key) -
401 Authentication failed -
*/ - public IW9FormDataModelsOneOf sendW9FormEmail(SendW9FormEmailRequest requestParameters) throws ApiException { - ApiResponse localVarResp = sendW9FormEmailWithHttpInfo(requestParameters); + public CreateW9Form201Response sendW9FormEmail(SendW9FormEmailRequest requestParameters) throws ApiException { + ApiResponse localVarResp = sendW9FormEmailWithHttpInfo(requestParameters); return localVarResp.getData(); } /** * Send an email to the vendor/payee requesting they fill out a W9/W4/W8 form - * Send an email to the vendor/payee requesting they fill out a W9/W4/W8 form. + * Send an email to the vendor/payee requesting they fill out a W9/W4/W8 form. If the form is not in 'Requested' status, it will either use an existing descendant form in 'Requested' status or create a new minimal form and send the email request. * @param requestOptions Object which represents the options available for a given API/request - * @return ApiResponse<IW9FormDataModelsOneOf> + * @return ApiResponse<CreateW9Form201Response> * @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 The updated W9/W4/W8 form -
200 Email sent using existing form (form was already in 'Requested' status or descendant found) -
201 Email sent using newly created minimal form -
400 Bad request (e.g., invalid sort key) -
401 Authentication failed -
*/ - public ApiResponse sendW9FormEmailWithHttpInfo(SendW9FormEmailRequest requestParameters) throws ApiException { + public ApiResponse sendW9FormEmailWithHttpInfo(SendW9FormEmailRequest requestParameters) throws ApiException { okhttp3.Call localVarCall = sendW9FormEmailValidateBeforeCall(requestParameters, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Send an email to the vendor/payee requesting they fill out a W9/W4/W8 form (asynchronously) - * Send an email to the vendor/payee requesting they fill out a W9/W4/W8 form. + * Send an email to the vendor/payee requesting they fill out a W9/W4/W8 form. If the form is not in 'Requested' status, it will either use an existing descendant form in 'Requested' status or create a new minimal form and send the email request. * @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 @@ -1011,15 +1199,16 @@ public ApiResponse sendW9FormEmailWithHttpInfo(SendW9For * @http.response.details - + +
Status Code Description Response Headers
200 The updated W9/W4/W8 form -
200 Email sent using existing form (form was already in 'Requested' status or descendant found) -
201 Email sent using newly created minimal form -
400 Bad request (e.g., invalid sort key) -
401 Authentication failed -
*/ - public okhttp3.Call sendW9FormEmailAsync(SendW9FormEmailRequest requestParameters, final ApiCallback _callback) throws ApiException { + public okhttp3.Call sendW9FormEmailAsync(SendW9FormEmailRequest requestParameters, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = sendW9FormEmailValidateBeforeCall(requestParameters, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } @@ -1070,6 +1259,7 @@ public SendW9FormEmailRequest getSendW9FormEmailRequest() { 200 The updated W9/W4/W8 form - 400 Bad request (e.g., invalid sort key) - 401 Authentication failed - + 404 W9/W4/W8 form not found - */ public okhttp3.Call updateW9FormCall(UpdateW9FormRequest requestParameters, final ApiCallback _callback) throws ApiException { @@ -1118,7 +1308,7 @@ public okhttp3.Call updateW9FormCall(UpdateW9FormRequest requestParameters, fina "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -1164,6 +1354,7 @@ private okhttp3.Call updateW9FormValidateBeforeCall(UpdateW9FormRequest requestP 200 The updated W9/W4/W8 form - 400 Bad request (e.g., invalid sort key) - 401 Authentication failed - + 404 W9/W4/W8 form not found - */ public IW9FormDataModelsOneOf updateW9Form(UpdateW9FormRequest requestParameters) throws ApiException { @@ -1183,6 +1374,7 @@ public IW9FormDataModelsOneOf updateW9Form(UpdateW9FormRequest requestParameters 200 The updated W9/W4/W8 form - 400 Bad request (e.g., invalid sort key) - 401 Authentication failed - + 404 W9/W4/W8 form not found - */ public ApiResponse updateW9FormWithHttpInfo(UpdateW9FormRequest requestParameters) throws ApiException { @@ -1204,6 +1396,7 @@ public ApiResponse updateW9FormWithHttpInfo(UpdateW9Form 200 The updated W9/W4/W8 form - 400 Bad request (e.g., invalid sort key) - 401 Authentication failed - + 404 W9/W4/W8 form not found - */ public okhttp3.Call updateW9FormAsync(UpdateW9FormRequest requestParameters, final ApiCallback _callback) throws ApiException { @@ -1317,7 +1510,7 @@ public okhttp3.Call uploadW9FilesCall(UploadW9FilesRequest requestParameters, fi "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -1452,7 +1645,7 @@ public UploadW9FilesRequest getUploadW9FilesRequest() { private void SetConfiguration(ApiClient client) { if (client == null) throw new MissingFormatArgumentException("client"); - this.localVarApiClient.setSdkVersion("25.8.2"); + this.localVarApiClient.setSdkVersion("25.8.3"); } } diff --git a/src/main/java/Avalara/SDK/api/A1099/V2/Issuers1099Api.java b/src/main/java/Avalara/SDK/api/A1099/V2/Issuers1099Api.java index d96c3b6..0f84317 100644 --- a/src/main/java/Avalara/SDK/api/A1099/V2/Issuers1099Api.java +++ b/src/main/java/Avalara/SDK/api/A1099/V2/Issuers1099Api.java @@ -36,8 +36,8 @@ import java.util.*; +import Avalara.SDK.model.A1099.V2.CreateIssuerRequest; import Avalara.SDK.model.A1099.V2.ErrorResponse; -import Avalara.SDK.model.A1099.V2.IssuerCommand; import Avalara.SDK.model.A1099.V2.IssuerResponse; import Avalara.SDK.model.A1099.V2.PaginatedQueryResultModelIssuerResponse; @@ -109,7 +109,7 @@ public okhttp3.Call createIssuerCall(CreateIssuerRequest requestParameters, fina basePath = null; } - Object localVarPostBody = requestParameters.getIssuerCommand(); + Object localVarPostBody = requestParameters.getCreateIssuerRequest(); // create path and map variables String localVarPath = "/1099/issuers"; @@ -136,7 +136,7 @@ public okhttp3.Call createIssuerCall(CreateIssuerRequest requestParameters, fina "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -232,13 +232,13 @@ public okhttp3.Call createIssuerAsync(CreateIssuerRequest requestParameters, fin * @param avalaraVersion API version * @param xCorrelationId Unique correlation Id in a GUID format (optional) * @param xAvalaraClient Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . (optional) - * @param issuerCommand The issuer to create (optional) + * @param createIssuerRequest The issuer to create (optional) */ public class CreateIssuerRequest { private String avalaraVersion; private String xCorrelationId; private String xAvalaraClient; - private IssuerCommand issuerCommand; + private CreateIssuerRequest createIssuerRequest; public CreateIssuerRequest () { } @@ -249,8 +249,8 @@ public CreateIssuerRequest () { public void setXCorrelationId(String xCorrelationId) { this.xCorrelationId = xCorrelationId; } public String getXAvalaraClient() { return xAvalaraClient; } public void setXAvalaraClient(String xAvalaraClient) { this.xAvalaraClient = xAvalaraClient; } - public IssuerCommand getIssuerCommand() { return issuerCommand; } - public void setIssuerCommand(IssuerCommand issuerCommand) { this.issuerCommand = issuerCommand; } + public CreateIssuerRequest getCreateIssuerRequest() { return createIssuerRequest; } + public void setCreateIssuerRequest(CreateIssuerRequest createIssuerRequest) { this.createIssuerRequest = createIssuerRequest; } } /** @@ -321,7 +321,7 @@ public okhttp3.Call deleteIssuerCall(DeleteIssuerRequest requestParameters, fina "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -507,7 +507,7 @@ public okhttp3.Call getIssuerCall(GetIssuerRequest requestParameters, final ApiC "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -722,7 +722,7 @@ public okhttp3.Call getIssuersCall(GetIssuersRequest requestParameters, final Ap "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -906,7 +906,7 @@ public okhttp3.Call updateIssuerCall(UpdateIssuerRequest requestParameters, fina basePath = null; } - Object localVarPostBody = requestParameters.getIssuerCommand(); + Object localVarPostBody = requestParameters.getCreateIssuerRequest(); // create path and map variables String localVarPath = "/1099/issuers/{id}" @@ -934,7 +934,7 @@ public okhttp3.Call updateIssuerCall(UpdateIssuerRequest requestParameters, fina "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -1035,14 +1035,14 @@ public okhttp3.Call updateIssuerAsync(UpdateIssuerRequest requestParameters, fin * @param avalaraVersion API version * @param xCorrelationId Unique correlation Id in a GUID format (optional) * @param xAvalaraClient Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . (optional) - * @param issuerCommand The issuer to update (optional) + * @param createIssuerRequest The issuer to update (optional) */ public class UpdateIssuerRequest { private String id; private String avalaraVersion; private String xCorrelationId; private String xAvalaraClient; - private IssuerCommand issuerCommand; + private CreateIssuerRequest createIssuerRequest; public UpdateIssuerRequest () { } @@ -1055,8 +1055,8 @@ public UpdateIssuerRequest () { public void setXCorrelationId(String xCorrelationId) { this.xCorrelationId = xCorrelationId; } public String getXAvalaraClient() { return xAvalaraClient; } public void setXAvalaraClient(String xAvalaraClient) { this.xAvalaraClient = xAvalaraClient; } - public IssuerCommand getIssuerCommand() { return issuerCommand; } - public void setIssuerCommand(IssuerCommand issuerCommand) { this.issuerCommand = issuerCommand; } + public CreateIssuerRequest getCreateIssuerRequest() { return createIssuerRequest; } + public void setCreateIssuerRequest(CreateIssuerRequest createIssuerRequest) { this.createIssuerRequest = createIssuerRequest; } } /** @@ -1069,7 +1069,7 @@ public UpdateIssuerRequest getUpdateIssuerRequest() { private void SetConfiguration(ApiClient client) { if (client == null) throw new MissingFormatArgumentException("client"); - this.localVarApiClient.setSdkVersion("25.8.2"); + this.localVarApiClient.setSdkVersion("25.8.3"); } } diff --git a/src/main/java/Avalara/SDK/api/A1099/V2/Jobs1099Api.java b/src/main/java/Avalara/SDK/api/A1099/V2/Jobs1099Api.java index 2d09c2a..1504b07 100644 --- a/src/main/java/Avalara/SDK/api/A1099/V2/Jobs1099Api.java +++ b/src/main/java/Avalara/SDK/api/A1099/V2/Jobs1099Api.java @@ -137,7 +137,7 @@ public okhttp3.Call getJobCall(GetJobRequest requestParameters, final ApiCallbac "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -275,7 +275,7 @@ public GetJobRequest getGetJobRequest() { private void SetConfiguration(ApiClient client) { if (client == null) throw new MissingFormatArgumentException("client"); - this.localVarApiClient.setSdkVersion("25.8.2"); + this.localVarApiClient.setSdkVersion(""); } } diff --git a/src/main/java/Avalara/SDK/api/A1099/V2/JobsApi.java b/src/main/java/Avalara/SDK/api/A1099/V2/JobsApi.java new file mode 100644 index 0000000..063d99d --- /dev/null +++ b/src/main/java/Avalara/SDK/api/A1099/V2/JobsApi.java @@ -0,0 +1,281 @@ +/* + * AvaTax Software Development Kit for Java (JRE) + * + * (c) 2004-2025 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * Avalara 1099 & W-9 API Definition + * + * ## 🔐 Authentication Generate a **license key** from: *[Avalara Portal](https://www.avalara.com/us/en/signin.html) → Settings → License and API Keys*. [More on authentication methods](https://developer.avalara.com/avatax-dm-combined-erp/common-setup/authentication/authentication-methods/) [Test your credentials](https://developer.avalara.com/avatax/test-credentials/) ## 📘 API & SDK Documentation [Avalara SDK (.NET) on GitHub](https://github.com/avadev/Avalara-SDK-DotNet#avalarasdk--the-unified-c-library-for-next-gen-avalara-services) [Code Examples – 1099 API](https://github.com/avadev/Avalara-SDK-DotNet/blob/main/docs/A1099/V2/Class1099IssuersApi.md#call1099issuersget) + * + * @author Sachin Baijal + * @author Jonathan Wenger + * @copyright 2004-2025 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @link https://github.com/avadev/Avalara-SDK-Java + */ + +package Avalara.SDK.api.A1099.V2; + +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.A1099.V2.ErrorResponse; +import Avalara.SDK.model.A1099.V2.JobResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class JobsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public JobsApi(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 getJob + * @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 Success -
400 Bad Request -
404 Not Found -
500 Server Error -
401 Unauthorized -
+ */ + public okhttp3.Call getJobCall(GetJobRequest 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 = "/jobs/{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(); + + if (requestParameters.getAvalaraVersion() != null) { + localVarHeaderParams.put("avalara-version", localVarApiClient.parameterToString(requestParameters.getAvalaraVersion())); + } + + if (requestParameters.getXCorrelationId() != null) { + localVarHeaderParams.put("X-Correlation-Id", localVarApiClient.parameterToString(requestParameters.getXCorrelationId())); + } + + 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.containsKey("Accept")) { + 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, AvalaraMicroservice.A1099); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getJobValidateBeforeCall(GetJobRequest requestParameters, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'requestParameters.id' is set + if (requestParameters.getId() == null) { + throw new ApiException("Missing the required parameter 'requestParameters.id' when calling getJob(Async)"); + } + + // verify the required parameter 'requestParameters.avalaraVersion' is set + if (requestParameters.getAvalaraVersion() == null) { + throw new ApiException("Missing the required parameter 'requestParameters.avalaraVersion' when calling getJob(Async)"); + } + + + okhttp3.Call localVarCall = getJobCall(requestParameters, _callback); + return localVarCall; + + } + + /** + * Retrieves information about the job + * Retrieves information about the job + * @param requestOptions Object which represents the options available for a given API/request + * @return JobResponse + * @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 Success -
400 Bad Request -
404 Not Found -
500 Server Error -
401 Unauthorized -
+ */ + public JobResponse getJob(GetJobRequest requestParameters) throws ApiException { + ApiResponse localVarResp = getJobWithHttpInfo(requestParameters); + return localVarResp.getData(); + } + + /** + * Retrieves information about the job + * Retrieves information about the job + * @param requestOptions Object which represents the options available for a given API/request + * @return ApiResponse<JobResponse> + * @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 Success -
400 Bad Request -
404 Not Found -
500 Server Error -
401 Unauthorized -
+ */ + public ApiResponse getJobWithHttpInfo(GetJobRequest requestParameters) throws ApiException { + okhttp3.Call localVarCall = getJobValidateBeforeCall(requestParameters, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieves information about the job (asynchronously) + * Retrieves information about the job + * @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 Success -
400 Bad Request -
404 Not Found -
500 Server Error -
401 Unauthorized -
+ */ + public okhttp3.Call getJobAsync(GetJobRequest requestParameters, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getJobValidateBeforeCall(requestParameters, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Represents the Request object for the GetJob API + * + * @param id Job id obtained from other API responses, like `/1099/bulk-upsert`. + * @param avalaraVersion API version + * @param xCorrelationId Unique correlation Id in a GUID format (optional) + * @param xAvalaraClient Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . (optional) + */ + public class GetJobRequest { + private String id; + private String avalaraVersion; + private String xCorrelationId; + private String xAvalaraClient; + + public GetJobRequest () { + } + + public String getId() { return id; } + public void setId(String id) { this.id = id; } + public String getAvalaraVersion() { return (avalaraVersion != null) ? avalaraVersion : "2.0"; } + public void setAvalaraVersion(String avalaraVersion) { this.avalaraVersion = avalaraVersion; } + public String getXCorrelationId() { return xCorrelationId; } + public void setXCorrelationId(String xCorrelationId) { this.xCorrelationId = xCorrelationId; } + public String getXAvalaraClient() { return xAvalaraClient; } + public void setXAvalaraClient(String xAvalaraClient) { this.xAvalaraClient = xAvalaraClient; } + } + + /** + * Getter function to instantiate Request class + * @returns GetJobRequest + */ + public GetJobRequest getGetJobRequest() { + return this.new GetJobRequest(); + } + + private void SetConfiguration(ApiClient client) { + if (client == null) throw new MissingFormatArgumentException("client"); + this.localVarApiClient.setSdkVersion("25.8.3"); + } +} + 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 73a00e4..bf1883f 100644 --- a/src/main/java/Avalara/SDK/api/EInvoicing/V1/DataInputFieldsApi.java +++ b/src/main/java/Avalara/SDK/api/EInvoicing/V1/DataInputFieldsApi.java @@ -152,7 +152,7 @@ public okhttp3.Call getDataInputFieldsCall(GetDataInputFieldsRequest requestPara "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -294,7 +294,7 @@ public GetDataInputFieldsRequest getGetDataInputFieldsRequest() { private void SetConfiguration(ApiClient client) { if (client == null) throw new MissingFormatArgumentException("client"); - this.localVarApiClient.setSdkVersion("25.8.2"); + this.localVarApiClient.setSdkVersion("25.8.3"); } } 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 531d0e6..2100ede 100644 --- a/src/main/java/Avalara/SDK/api/EInvoicing/V1/DocumentsApi.java +++ b/src/main/java/Avalara/SDK/api/EInvoicing/V1/DocumentsApi.java @@ -149,7 +149,7 @@ public okhttp3.Call downloadDocumentCall(DownloadDocumentRequest requestParamete "application/pdf", "application/xml", "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -346,7 +346,7 @@ public okhttp3.Call fetchDocumentsCall(FetchDocumentsRequest requestParameters, "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -563,7 +563,7 @@ public okhttp3.Call getDocumentListCall(GetDocumentListRequest requestParameters "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -772,7 +772,7 @@ public okhttp3.Call getDocumentStatusCall(GetDocumentStatusRequest requestParame "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -965,7 +965,7 @@ public okhttp3.Call submitDocumentCall(SubmitDocumentRequest requestParameters, "application/json", "text/xml" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -1105,7 +1105,7 @@ public SubmitDocumentRequest getSubmitDocumentRequest() { private void SetConfiguration(ApiClient client) { if (client == null) throw new MissingFormatArgumentException("client"); - this.localVarApiClient.setSdkVersion("25.8.2"); + this.localVarApiClient.setSdkVersion("25.8.3"); } } diff --git a/src/main/java/Avalara/SDK/api/EInvoicing/V1/InteropApi.java b/src/main/java/Avalara/SDK/api/EInvoicing/V1/InteropApi.java index d133bde..1e8659e 100644 --- a/src/main/java/Avalara/SDK/api/EInvoicing/V1/InteropApi.java +++ b/src/main/java/Avalara/SDK/api/EInvoicing/V1/InteropApi.java @@ -149,7 +149,7 @@ public okhttp3.Call submitInteropDocumentCall(SubmitInteropDocumentRequest reque "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -300,7 +300,7 @@ public SubmitInteropDocumentRequest getSubmitInteropDocumentRequest() { private void SetConfiguration(ApiClient client) { if (client == null) throw new MissingFormatArgumentException("client"); - this.localVarApiClient.setSdkVersion("25.8.2"); + this.localVarApiClient.setSdkVersion("25.8.3"); } } 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 ead2247..4672dfd 100644 --- a/src/main/java/Avalara/SDK/api/EInvoicing/V1/MandatesApi.java +++ b/src/main/java/Avalara/SDK/api/EInvoicing/V1/MandatesApi.java @@ -146,7 +146,7 @@ public okhttp3.Call getMandateDataInputFieldsCall(GetMandateDataInputFieldsReque "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -376,7 +376,7 @@ public okhttp3.Call getMandatesCall(GetMandatesRequest requestParameters, final "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -521,7 +521,7 @@ public GetMandatesRequest getGetMandatesRequest() { private void SetConfiguration(ApiClient client) { if (client == null) throw new MissingFormatArgumentException("client"); - this.localVarApiClient.setSdkVersion("25.8.2"); + this.localVarApiClient.setSdkVersion("25.8.3"); } } diff --git a/src/main/java/Avalara/SDK/api/EInvoicing/V1/SubscriptionsApi.java b/src/main/java/Avalara/SDK/api/EInvoicing/V1/SubscriptionsApi.java index af363c5..25a1e9c 100644 --- a/src/main/java/Avalara/SDK/api/EInvoicing/V1/SubscriptionsApi.java +++ b/src/main/java/Avalara/SDK/api/EInvoicing/V1/SubscriptionsApi.java @@ -138,7 +138,7 @@ public okhttp3.Call createWebhookSubscriptionCall(CreateWebhookSubscriptionReque "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -332,7 +332,7 @@ public okhttp3.Call deleteWebhookSubscriptionCall(DeleteWebhookSubscriptionReque "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -522,7 +522,7 @@ public okhttp3.Call getWebhookSubscriptionCall(GetWebhookSubscriptionRequest req "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -731,7 +731,7 @@ public okhttp3.Call listWebhookSubscriptionsCall(ListWebhookSubscriptionsRequest "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -873,7 +873,7 @@ public ListWebhookSubscriptionsRequest getListWebhookSubscriptionsRequest() { private void SetConfiguration(ApiClient client) { if (client == null) throw new MissingFormatArgumentException("client"); - this.localVarApiClient.setSdkVersion("25.8.2"); + this.localVarApiClient.setSdkVersion("25.8.3"); } } diff --git a/src/main/java/Avalara/SDK/api/EInvoicing/V1/TaxIdentifiersApi.java b/src/main/java/Avalara/SDK/api/EInvoicing/V1/TaxIdentifiersApi.java index 984fd9c..b5e2c83 100644 --- a/src/main/java/Avalara/SDK/api/EInvoicing/V1/TaxIdentifiersApi.java +++ b/src/main/java/Avalara/SDK/api/EInvoicing/V1/TaxIdentifiersApi.java @@ -146,7 +146,7 @@ public okhttp3.Call taxIdentifierSchemaByCountryCall(TaxIdentifierSchemaByCountr "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -348,7 +348,7 @@ public okhttp3.Call validateTaxIdentifierCall(ValidateTaxIdentifierRequest reque "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -489,7 +489,7 @@ public ValidateTaxIdentifierRequest getValidateTaxIdentifierRequest() { private void SetConfiguration(ApiClient client) { if (client == null) throw new MissingFormatArgumentException("client"); - this.localVarApiClient.setSdkVersion("25.8.2"); + this.localVarApiClient.setSdkVersion("25.8.3"); } } diff --git a/src/main/java/Avalara/SDK/api/EInvoicing/V1/TradingPartnersApi.java b/src/main/java/Avalara/SDK/api/EInvoicing/V1/TradingPartnersApi.java index 4074d60..1609bdd 100644 --- a/src/main/java/Avalara/SDK/api/EInvoicing/V1/TradingPartnersApi.java +++ b/src/main/java/Avalara/SDK/api/EInvoicing/V1/TradingPartnersApi.java @@ -157,7 +157,7 @@ public okhttp3.Call batchSearchParticipantsCall(BatchSearchParticipantsRequest r "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -373,7 +373,7 @@ public okhttp3.Call createTradingPartnerCall(CreateTradingPartnerRequest request "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -575,7 +575,7 @@ public okhttp3.Call createTradingPartnersBatchCall(CreateTradingPartnersBatchReq "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -779,7 +779,7 @@ public okhttp3.Call deleteTradingPartnerCall(DeleteTradingPartnerRequest request "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -973,7 +973,7 @@ public okhttp3.Call downloadBatchSearchReportCall(DownloadBatchSearchReportReque "text/csv", "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -1171,7 +1171,7 @@ public okhttp3.Call getBatchSearchDetailCall(GetBatchSearchDetailRequest request "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -1388,7 +1388,7 @@ public okhttp3.Call listBatchSearchesCall(ListBatchSearchesRequest requestParame "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -1620,7 +1620,7 @@ public okhttp3.Call searchParticipantsCall(SearchParticipantsRequest requestPara "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -1840,7 +1840,7 @@ public okhttp3.Call updateTradingPartnerCall(UpdateTradingPartnerRequest request "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { + if (localVarAccept != null && !localVarHeaderParams.containsKey("Accept")) { localVarHeaderParams.put("Accept", localVarAccept); } @@ -1993,7 +1993,7 @@ public UpdateTradingPartnerRequest getUpdateTradingPartnerRequest() { private void SetConfiguration(ApiClient client) { if (client == null) throw new MissingFormatArgumentException("client"); - this.localVarApiClient.setSdkVersion("25.8.2"); + this.localVarApiClient.setSdkVersion("25.8.3"); } } diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/CompanyCreateUpdateRequestModel.java b/src/main/java/Avalara/SDK/model/A1099/V2/CompanyCreateUpdateRequestModel.java index 2f28f64..686ea5f 100644 --- a/src/main/java/Avalara/SDK/model/A1099/V2/CompanyCreateUpdateRequestModel.java +++ b/src/main/java/Avalara/SDK/model/A1099/V2/CompanyCreateUpdateRequestModel.java @@ -62,6 +62,10 @@ public class CompanyCreateUpdateRequestModel { @SerializedName(SERIALIZED_NAME_NAME) private String name; + public static final String SERIALIZED_NAME_DBA_NAME = "dbaName"; + @SerializedName(SERIALIZED_NAME_DBA_NAME) + private String dbaName; + public static final String SERIALIZED_NAME_EMAIL = "email"; @SerializedName(SERIALIZED_NAME_EMAIL) private String email; @@ -90,10 +94,6 @@ public class CompanyCreateUpdateRequestModel { @SerializedName(SERIALIZED_NAME_TIN) private String tin; - public static final String SERIALIZED_NAME_DBA_NAME = "dbaName"; - @SerializedName(SERIALIZED_NAME_DBA_NAME) - private String dbaName; - public static final String SERIALIZED_NAME_REFERENCE_ID = "referenceId"; @SerializedName(SERIALIZED_NAME_REFERENCE_ID) private String referenceId; @@ -135,7 +135,7 @@ public CompanyCreateUpdateRequestModel name(String name) { } /** - * Get name + * Legal name. Not the DBA name. * @return name */ @javax.annotation.Nullable @@ -148,13 +148,32 @@ public void setName(String name) { } + public CompanyCreateUpdateRequestModel dbaName(String dbaName) { + this.dbaName = dbaName; + return this; + } + + /** + * Doing Business As (DBA) name or continuation of a long legal name. + * @return dbaName + */ + @javax.annotation.Nullable + public String getDbaName() { + return dbaName; + } + + public void setDbaName(String dbaName) { + this.dbaName = dbaName; + } + + public CompanyCreateUpdateRequestModel email(String email) { this.email = email; return this; } /** - * Get email + * Contact email address. For inquiries by vendors/employees. * @return email */ @javax.annotation.Nullable @@ -173,7 +192,7 @@ public CompanyCreateUpdateRequestModel address(String address) { } /** - * Get address + * Address. * @return address */ @javax.annotation.Nullable @@ -192,7 +211,7 @@ public CompanyCreateUpdateRequestModel city(String city) { } /** - * Get city + * City. * @return city */ @javax.annotation.Nullable @@ -211,7 +230,7 @@ public CompanyCreateUpdateRequestModel state(String state) { } /** - * Get state + * Two-letter US state or Canadian province code (required for US/CA addresses). * @return state */ @javax.annotation.Nullable @@ -230,7 +249,7 @@ public CompanyCreateUpdateRequestModel zip(String zip) { } /** - * Get zip + * ZIP/postal code. * @return zip */ @javax.annotation.Nullable @@ -249,7 +268,7 @@ public CompanyCreateUpdateRequestModel telephone(String telephone) { } /** - * Get telephone + * Contact phone number (must contain at least 10 digits, max 15 characters). * @return telephone */ @javax.annotation.Nullable @@ -268,7 +287,7 @@ public CompanyCreateUpdateRequestModel tin(String tin) { } /** - * Get tin + * Federal Tax Identification Number (TIN). EIN/Tax ID (required for US companies). * @return tin */ @javax.annotation.Nullable @@ -281,32 +300,13 @@ public void setTin(String tin) { } - public CompanyCreateUpdateRequestModel dbaName(String dbaName) { - this.dbaName = dbaName; - return this; - } - - /** - * Get dbaName - * @return dbaName - */ - @javax.annotation.Nullable - public String getDbaName() { - return dbaName; - } - - public void setDbaName(String dbaName) { - this.dbaName = dbaName; - } - - public CompanyCreateUpdateRequestModel referenceId(String referenceId) { this.referenceId = referenceId; return this; } /** - * Get referenceId + * Internal reference ID. Never shown to any agency or recipient. * @return referenceId */ @javax.annotation.Nullable @@ -325,7 +325,7 @@ public CompanyCreateUpdateRequestModel doTinMatch(Boolean doTinMatch) { } /** - * Get doTinMatch + * Indicates whether the company authorizes IRS TIN matching. * @return doTinMatch */ @javax.annotation.Nullable @@ -344,7 +344,7 @@ public CompanyCreateUpdateRequestModel groupName(String groupName) { } /** - * Get groupName + * Group name for organizing companies (creates or finds group by name). * @return groupName */ @javax.annotation.Nullable @@ -363,7 +363,7 @@ public CompanyCreateUpdateRequestModel foreignProvince(String foreignProvince) { } /** - * Get foreignProvince + * Province or region for non-US/CA addresses. * @return foreignProvince */ @javax.annotation.Nullable @@ -382,7 +382,7 @@ public CompanyCreateUpdateRequestModel countryCode(String countryCode) { } /** - * Get countryCode + * Two-letter IRS country code (e.g., 'US', 'CA'), as defined at https://www.irs.gov/e-file-providers/country-codes. * @return countryCode */ @javax.annotation.Nullable @@ -401,7 +401,7 @@ public CompanyCreateUpdateRequestModel resendRequests(Boolean resendRequests) { } /** - * Get resendRequests + * Boolean to enable automatic reminder emails (default: false). * @return resendRequests */ @javax.annotation.Nullable @@ -420,7 +420,7 @@ public CompanyCreateUpdateRequestModel resendIntervalDays(Integer resendInterval } /** - * Get resendIntervalDays + * Days between reminder emails (7-365, required if resendRequests is true). * @return resendIntervalDays */ @javax.annotation.Nullable @@ -439,7 +439,7 @@ public CompanyCreateUpdateRequestModel maxReminderAttempts(Integer maxReminderAt } /** - * Get maxReminderAttempts + * Maximum number of reminder attempts (1-52, required if resendRequests is true). * @return maxReminderAttempts */ @javax.annotation.Nullable @@ -463,6 +463,7 @@ public boolean equals(Object o) { } CompanyCreateUpdateRequestModel companyCreateUpdateRequestModel = (CompanyCreateUpdateRequestModel) o; return Objects.equals(this.name, companyCreateUpdateRequestModel.name) && + Objects.equals(this.dbaName, companyCreateUpdateRequestModel.dbaName) && Objects.equals(this.email, companyCreateUpdateRequestModel.email) && Objects.equals(this.address, companyCreateUpdateRequestModel.address) && Objects.equals(this.city, companyCreateUpdateRequestModel.city) && @@ -470,7 +471,6 @@ public boolean equals(Object o) { Objects.equals(this.zip, companyCreateUpdateRequestModel.zip) && Objects.equals(this.telephone, companyCreateUpdateRequestModel.telephone) && Objects.equals(this.tin, companyCreateUpdateRequestModel.tin) && - Objects.equals(this.dbaName, companyCreateUpdateRequestModel.dbaName) && Objects.equals(this.referenceId, companyCreateUpdateRequestModel.referenceId) && Objects.equals(this.doTinMatch, companyCreateUpdateRequestModel.doTinMatch) && Objects.equals(this.groupName, companyCreateUpdateRequestModel.groupName) && @@ -487,7 +487,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(name, email, address, city, state, zip, telephone, tin, dbaName, referenceId, doTinMatch, groupName, foreignProvince, countryCode, resendRequests, resendIntervalDays, maxReminderAttempts); + return Objects.hash(name, dbaName, email, address, city, state, zip, telephone, tin, referenceId, doTinMatch, groupName, foreignProvince, countryCode, resendRequests, resendIntervalDays, maxReminderAttempts); } private static int hashCodeNullable(JsonNullable a) { @@ -502,6 +502,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CompanyCreateUpdateRequestModel {\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" dbaName: ").append(toIndentedString(dbaName)).append("\n"); sb.append(" email: ").append(toIndentedString(email)).append("\n"); sb.append(" address: ").append(toIndentedString(address)).append("\n"); sb.append(" city: ").append(toIndentedString(city)).append("\n"); @@ -509,7 +510,6 @@ public String toString() { sb.append(" zip: ").append(toIndentedString(zip)).append("\n"); sb.append(" telephone: ").append(toIndentedString(telephone)).append("\n"); sb.append(" tin: ").append(toIndentedString(tin)).append("\n"); - sb.append(" dbaName: ").append(toIndentedString(dbaName)).append("\n"); sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); sb.append(" doTinMatch: ").append(toIndentedString(doTinMatch)).append("\n"); sb.append(" groupName: ").append(toIndentedString(groupName)).append("\n"); @@ -541,6 +541,7 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("name"); + openapiFields.add("dbaName"); openapiFields.add("email"); openapiFields.add("address"); openapiFields.add("city"); @@ -548,7 +549,6 @@ private String toIndentedString(Object o) { openapiFields.add("zip"); openapiFields.add("telephone"); openapiFields.add("tin"); - openapiFields.add("dbaName"); openapiFields.add("referenceId"); openapiFields.add("doTinMatch"); openapiFields.add("groupName"); @@ -560,6 +560,14 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("email"); + openapiRequiredFields.add("address"); + openapiRequiredFields.add("city"); + openapiRequiredFields.add("zip"); + openapiRequiredFields.add("telephone"); + openapiRequiredFields.add("tin"); + openapiRequiredFields.add("countryCode"); } /** @@ -582,10 +590,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CompanyCreateUpdateRequestModel` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CompanyCreateUpdateRequestModel.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("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("dbaName") != null && !jsonObj.get("dbaName").isJsonNull()) && !jsonObj.get("dbaName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `dbaName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dbaName").toString())); + } if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); } @@ -607,9 +625,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("tin") != null && !jsonObj.get("tin").isJsonNull()) && !jsonObj.get("tin").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `tin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tin").toString())); } - if ((jsonObj.get("dbaName") != null && !jsonObj.get("dbaName").isJsonNull()) && !jsonObj.get("dbaName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `dbaName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dbaName").toString())); - } if ((jsonObj.get("referenceId") != null && !jsonObj.get("referenceId").isJsonNull()) && !jsonObj.get("referenceId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `referenceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("referenceId").toString())); } diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/CompanyResponse.java b/src/main/java/Avalara/SDK/model/A1099/V2/CompanyResponse.java index fe54e4e..6d5c0ca 100644 --- a/src/main/java/Avalara/SDK/model/A1099/V2/CompanyResponse.java +++ b/src/main/java/Avalara/SDK/model/A1099/V2/CompanyResponse.java @@ -63,13 +63,13 @@ public class CompanyResponse { @SerializedName(SERIALIZED_NAME_ID) private String id; - public static final String SERIALIZED_NAME_REFERENCE_ID = "referenceId"; - @SerializedName(SERIALIZED_NAME_REFERENCE_ID) - private String referenceId; + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private OffsetDateTime createdAt; - public static final String SERIALIZED_NAME_GROUP_NAME = "groupName"; - @SerializedName(SERIALIZED_NAME_GROUP_NAME) - private String groupName; + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private OffsetDateTime updatedAt; public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) @@ -79,6 +79,10 @@ public class CompanyResponse { @SerializedName(SERIALIZED_NAME_DBA_NAME) private String dbaName; + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + public static final String SERIALIZED_NAME_ADDRESS = "address"; @SerializedName(SERIALIZED_NAME_ADDRESS) private String address; @@ -91,22 +95,10 @@ public class CompanyResponse { @SerializedName(SERIALIZED_NAME_STATE) private String state; - public static final String SERIALIZED_NAME_FOREIGN_PROVINCE = "foreignProvince"; - @SerializedName(SERIALIZED_NAME_FOREIGN_PROVINCE) - private String foreignProvince; - public static final String SERIALIZED_NAME_ZIP = "zip"; @SerializedName(SERIALIZED_NAME_ZIP) private String zip; - public static final String SERIALIZED_NAME_COUNTRY_CODE = "countryCode"; - @SerializedName(SERIALIZED_NAME_COUNTRY_CODE) - private String countryCode; - - public static final String SERIALIZED_NAME_EMAIL = "email"; - @SerializedName(SERIALIZED_NAME_EMAIL) - private String email; - public static final String SERIALIZED_NAME_TELEPHONE = "telephone"; @SerializedName(SERIALIZED_NAME_TELEPHONE) private String telephone; @@ -115,10 +107,26 @@ public class CompanyResponse { @SerializedName(SERIALIZED_NAME_TIN) private String tin; + public static final String SERIALIZED_NAME_REFERENCE_ID = "referenceId"; + @SerializedName(SERIALIZED_NAME_REFERENCE_ID) + private String referenceId; + public static final String SERIALIZED_NAME_DO_TIN_MATCH = "doTinMatch"; @SerializedName(SERIALIZED_NAME_DO_TIN_MATCH) private Boolean doTinMatch; + public static final String SERIALIZED_NAME_GROUP_NAME = "groupName"; + @SerializedName(SERIALIZED_NAME_GROUP_NAME) + private String groupName; + + public static final String SERIALIZED_NAME_FOREIGN_PROVINCE = "foreignProvince"; + @SerializedName(SERIALIZED_NAME_FOREIGN_PROVINCE) + private String foreignProvince; + + public static final String SERIALIZED_NAME_COUNTRY_CODE = "countryCode"; + @SerializedName(SERIALIZED_NAME_COUNTRY_CODE) + private String countryCode; + public static final String SERIALIZED_NAME_RESEND_REQUESTS = "resendRequests"; @SerializedName(SERIALIZED_NAME_RESEND_REQUESTS) private Boolean resendRequests; @@ -131,14 +139,6 @@ public class CompanyResponse { @SerializedName(SERIALIZED_NAME_MAX_REMINDER_ATTEMPTS) private Integer maxReminderAttempts; - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private OffsetDateTime createdAt; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - private OffsetDateTime updatedAt; - public CompanyResponse() { } @@ -148,7 +148,7 @@ public CompanyResponse id(String id) { } /** - * Get id + * Unique identifier set when the record is created. * @return id */ @javax.annotation.Nullable @@ -161,41 +161,41 @@ public void setId(String id) { } - public CompanyResponse referenceId(String referenceId) { - this.referenceId = referenceId; + public CompanyResponse createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; return this; } /** - * Get referenceId - * @return referenceId + * Date time when the record was created. + * @return createdAt */ @javax.annotation.Nullable - public String getReferenceId() { - return referenceId; + public OffsetDateTime getCreatedAt() { + return createdAt; } - public void setReferenceId(String referenceId) { - this.referenceId = referenceId; + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; } - public CompanyResponse groupName(String groupName) { - this.groupName = groupName; + public CompanyResponse updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; return this; } /** - * Get groupName - * @return groupName + * Date time when the record was last updated. + * @return updatedAt */ @javax.annotation.Nullable - public String getGroupName() { - return groupName; + public OffsetDateTime getUpdatedAt() { + return updatedAt; } - public void setGroupName(String groupName) { - this.groupName = groupName; + public void setUpdatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; } @@ -205,7 +205,7 @@ public CompanyResponse name(String name) { } /** - * Get name + * Legal name. Not the DBA name. * @return name */ @javax.annotation.Nullable @@ -224,7 +224,7 @@ public CompanyResponse dbaName(String dbaName) { } /** - * Get dbaName + * Doing Business As (DBA) name or continuation of a long legal name. * @return dbaName */ @javax.annotation.Nullable @@ -237,13 +237,32 @@ public void setDbaName(String dbaName) { } + public CompanyResponse email(String email) { + this.email = email; + return this; + } + + /** + * Contact email address. For inquiries by vendors/employees. + * @return email + */ + @javax.annotation.Nullable + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public CompanyResponse address(String address) { this.address = address; return this; } /** - * Get address + * Address. * @return address */ @javax.annotation.Nullable @@ -262,7 +281,7 @@ public CompanyResponse city(String city) { } /** - * Get city + * City. * @return city */ @javax.annotation.Nullable @@ -281,7 +300,7 @@ public CompanyResponse state(String state) { } /** - * Get state + * Two-letter US state or Canadian province code (required for US/CA addresses). * @return state */ @javax.annotation.Nullable @@ -294,136 +313,155 @@ public void setState(String state) { } - public CompanyResponse foreignProvince(String foreignProvince) { - this.foreignProvince = foreignProvince; + public CompanyResponse zip(String zip) { + this.zip = zip; return this; } /** - * Get foreignProvince - * @return foreignProvince + * ZIP/postal code. + * @return zip */ @javax.annotation.Nullable - public String getForeignProvince() { - return foreignProvince; + public String getZip() { + return zip; } - public void setForeignProvince(String foreignProvince) { - this.foreignProvince = foreignProvince; + public void setZip(String zip) { + this.zip = zip; } - public CompanyResponse zip(String zip) { - this.zip = zip; + public CompanyResponse telephone(String telephone) { + this.telephone = telephone; return this; } /** - * Get zip - * @return zip + * Contact phone number (must contain at least 10 digits, max 15 characters). + * @return telephone */ @javax.annotation.Nullable - public String getZip() { - return zip; + public String getTelephone() { + return telephone; } - public void setZip(String zip) { - this.zip = zip; + public void setTelephone(String telephone) { + this.telephone = telephone; } - public CompanyResponse countryCode(String countryCode) { - this.countryCode = countryCode; + public CompanyResponse tin(String tin) { + this.tin = tin; return this; } /** - * Get countryCode - * @return countryCode + * Federal Tax Identification Number (TIN). EIN/Tax ID (required for US companies). + * @return tin */ @javax.annotation.Nullable - public String getCountryCode() { - return countryCode; + public String getTin() { + return tin; } - public void setCountryCode(String countryCode) { - this.countryCode = countryCode; + public void setTin(String tin) { + this.tin = tin; } - public CompanyResponse email(String email) { - this.email = email; + public CompanyResponse referenceId(String referenceId) { + this.referenceId = referenceId; return this; } /** - * Get email - * @return email + * Internal reference ID. Never shown to any agency or recipient. + * @return referenceId */ @javax.annotation.Nullable - public String getEmail() { - return email; + public String getReferenceId() { + return referenceId; } - public void setEmail(String email) { - this.email = email; + public void setReferenceId(String referenceId) { + this.referenceId = referenceId; } - public CompanyResponse telephone(String telephone) { - this.telephone = telephone; + public CompanyResponse doTinMatch(Boolean doTinMatch) { + this.doTinMatch = doTinMatch; return this; } /** - * Get telephone - * @return telephone + * Indicates whether the company authorizes IRS TIN matching. + * @return doTinMatch */ @javax.annotation.Nullable - public String getTelephone() { - return telephone; + public Boolean getDoTinMatch() { + return doTinMatch; } - public void setTelephone(String telephone) { - this.telephone = telephone; + public void setDoTinMatch(Boolean doTinMatch) { + this.doTinMatch = doTinMatch; } - public CompanyResponse tin(String tin) { - this.tin = tin; + public CompanyResponse groupName(String groupName) { + this.groupName = groupName; return this; } /** - * Get tin - * @return tin + * Group name for organizing companies (creates or finds group by name). + * @return groupName */ @javax.annotation.Nullable - public String getTin() { - return tin; + public String getGroupName() { + return groupName; } - public void setTin(String tin) { - this.tin = tin; + public void setGroupName(String groupName) { + this.groupName = groupName; } - public CompanyResponse doTinMatch(Boolean doTinMatch) { - this.doTinMatch = doTinMatch; + public CompanyResponse foreignProvince(String foreignProvince) { + this.foreignProvince = foreignProvince; return this; } /** - * Get doTinMatch - * @return doTinMatch + * Province or region for non-US/CA addresses. + * @return foreignProvince */ @javax.annotation.Nullable - public Boolean getDoTinMatch() { - return doTinMatch; + public String getForeignProvince() { + return foreignProvince; } - public void setDoTinMatch(Boolean doTinMatch) { - this.doTinMatch = doTinMatch; + public void setForeignProvince(String foreignProvince) { + this.foreignProvince = foreignProvince; + } + + + public CompanyResponse countryCode(String countryCode) { + this.countryCode = countryCode; + return this; + } + + /** + * Two-letter IRS country code (e.g., 'US', 'CA'), as defined at https://www.irs.gov/e-file-providers/country-codes. + * @return countryCode + */ + @javax.annotation.Nullable + public String getCountryCode() { + return countryCode; + } + + public void setCountryCode(String countryCode) { + this.countryCode = countryCode; } @@ -433,7 +471,7 @@ public CompanyResponse resendRequests(Boolean resendRequests) { } /** - * Get resendRequests + * Boolean to enable automatic reminder emails (default: false). * @return resendRequests */ @javax.annotation.Nullable @@ -452,7 +490,7 @@ public CompanyResponse resendIntervalDays(Integer resendIntervalDays) { } /** - * Get resendIntervalDays + * Days between reminder emails (7-365, required if resendRequests is true). * @return resendIntervalDays */ @javax.annotation.Nullable @@ -471,7 +509,7 @@ public CompanyResponse maxReminderAttempts(Integer maxReminderAttempts) { } /** - * Get maxReminderAttempts + * Maximum number of reminder attempts (1-52, required if resendRequests is true). * @return maxReminderAttempts */ @javax.annotation.Nullable @@ -484,44 +522,6 @@ public void setMaxReminderAttempts(Integer maxReminderAttempts) { } - public CompanyResponse createdAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * Get createdAt - * @return createdAt - */ - @javax.annotation.Nullable - public OffsetDateTime getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - } - - - public CompanyResponse updatedAt(OffsetDateTime updatedAt) { - this.updatedAt = updatedAt; - return this; - } - - /** - * Get updatedAt - * @return updatedAt - */ - @javax.annotation.Nullable - public OffsetDateTime getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(OffsetDateTime updatedAt) { - this.updatedAt = updatedAt; - } - - @Override public boolean equals(Object o) { @@ -533,25 +533,25 @@ public boolean equals(Object o) { } CompanyResponse companyResponse = (CompanyResponse) o; return Objects.equals(this.id, companyResponse.id) && - Objects.equals(this.referenceId, companyResponse.referenceId) && - Objects.equals(this.groupName, companyResponse.groupName) && + Objects.equals(this.createdAt, companyResponse.createdAt) && + Objects.equals(this.updatedAt, companyResponse.updatedAt) && Objects.equals(this.name, companyResponse.name) && Objects.equals(this.dbaName, companyResponse.dbaName) && + Objects.equals(this.email, companyResponse.email) && Objects.equals(this.address, companyResponse.address) && Objects.equals(this.city, companyResponse.city) && Objects.equals(this.state, companyResponse.state) && - Objects.equals(this.foreignProvince, companyResponse.foreignProvince) && Objects.equals(this.zip, companyResponse.zip) && - Objects.equals(this.countryCode, companyResponse.countryCode) && - Objects.equals(this.email, companyResponse.email) && Objects.equals(this.telephone, companyResponse.telephone) && Objects.equals(this.tin, companyResponse.tin) && + Objects.equals(this.referenceId, companyResponse.referenceId) && Objects.equals(this.doTinMatch, companyResponse.doTinMatch) && + Objects.equals(this.groupName, companyResponse.groupName) && + Objects.equals(this.foreignProvince, companyResponse.foreignProvince) && + Objects.equals(this.countryCode, companyResponse.countryCode) && Objects.equals(this.resendRequests, companyResponse.resendRequests) && Objects.equals(this.resendIntervalDays, companyResponse.resendIntervalDays) && - Objects.equals(this.maxReminderAttempts, companyResponse.maxReminderAttempts) && - Objects.equals(this.createdAt, companyResponse.createdAt) && - Objects.equals(this.updatedAt, companyResponse.updatedAt); + Objects.equals(this.maxReminderAttempts, companyResponse.maxReminderAttempts); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -560,7 +560,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(id, referenceId, groupName, name, dbaName, address, city, state, foreignProvince, zip, countryCode, email, telephone, tin, doTinMatch, resendRequests, resendIntervalDays, maxReminderAttempts, createdAt, updatedAt); + return Objects.hash(id, createdAt, updatedAt, name, dbaName, email, address, city, state, zip, telephone, tin, referenceId, doTinMatch, groupName, foreignProvince, countryCode, resendRequests, resendIntervalDays, maxReminderAttempts); } private static int hashCodeNullable(JsonNullable a) { @@ -575,25 +575,25 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CompanyResponse {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); - sb.append(" groupName: ").append(toIndentedString(groupName)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" dbaName: ").append(toIndentedString(dbaName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); sb.append(" address: ").append(toIndentedString(address)).append("\n"); sb.append(" city: ").append(toIndentedString(city)).append("\n"); sb.append(" state: ").append(toIndentedString(state)).append("\n"); - sb.append(" foreignProvince: ").append(toIndentedString(foreignProvince)).append("\n"); sb.append(" zip: ").append(toIndentedString(zip)).append("\n"); - sb.append(" countryCode: ").append(toIndentedString(countryCode)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); sb.append(" telephone: ").append(toIndentedString(telephone)).append("\n"); sb.append(" tin: ").append(toIndentedString(tin)).append("\n"); + sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); sb.append(" doTinMatch: ").append(toIndentedString(doTinMatch)).append("\n"); + sb.append(" groupName: ").append(toIndentedString(groupName)).append("\n"); + sb.append(" foreignProvince: ").append(toIndentedString(foreignProvince)).append("\n"); + sb.append(" countryCode: ").append(toIndentedString(countryCode)).append("\n"); sb.append(" resendRequests: ").append(toIndentedString(resendRequests)).append("\n"); sb.append(" resendIntervalDays: ").append(toIndentedString(resendIntervalDays)).append("\n"); sb.append(" maxReminderAttempts: ").append(toIndentedString(maxReminderAttempts)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append("}"); return sb.toString(); } @@ -616,9 +616,34 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("dbaName"); + openapiFields.add("email"); + openapiFields.add("address"); + openapiFields.add("city"); + openapiFields.add("state"); + openapiFields.add("zip"); + openapiFields.add("telephone"); + openapiFields.add("tin"); + openapiFields.add("referenceId"); + openapiFields.add("doTinMatch"); + openapiFields.add("groupName"); + openapiFields.add("foreignProvince"); + openapiFields.add("countryCode"); + openapiFields.add("resendRequests"); + openapiFields.add("resendIntervalDays"); + openapiFields.add("maxReminderAttempts"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("email"); + openapiRequiredFields.add("address"); + openapiRequiredFields.add("city"); + openapiRequiredFields.add("zip"); + openapiRequiredFields.add("telephone"); + openapiRequiredFields.add("tin"); + openapiRequiredFields.add("countryCode"); } /** @@ -641,22 +666,26 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CompanyResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CompanyResponse.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("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("referenceId") != null && !jsonObj.get("referenceId").isJsonNull()) && !jsonObj.get("referenceId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `referenceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("referenceId").toString())); - } - if ((jsonObj.get("groupName") != null && !jsonObj.get("groupName").isJsonNull()) && !jsonObj.get("groupName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `groupName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("groupName").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("dbaName") != null && !jsonObj.get("dbaName").isJsonNull()) && !jsonObj.get("dbaName").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `dbaName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dbaName").toString())); } + if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } if ((jsonObj.get("address") != null && !jsonObj.get("address").isJsonNull()) && !jsonObj.get("address").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address").toString())); } @@ -666,24 +695,27 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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("foreignProvince") != null && !jsonObj.get("foreignProvince").isJsonNull()) && !jsonObj.get("foreignProvince").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `foreignProvince` to be a primitive type in the JSON string but got `%s`", jsonObj.get("foreignProvince").toString())); - } if ((jsonObj.get("zip") != null && !jsonObj.get("zip").isJsonNull()) && !jsonObj.get("zip").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `zip` to be a primitive type in the JSON string but got `%s`", jsonObj.get("zip").toString())); } - if ((jsonObj.get("countryCode") != null && !jsonObj.get("countryCode").isJsonNull()) && !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("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); - } if ((jsonObj.get("telephone") != null && !jsonObj.get("telephone").isJsonNull()) && !jsonObj.get("telephone").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `telephone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telephone").toString())); } if ((jsonObj.get("tin") != null && !jsonObj.get("tin").isJsonNull()) && !jsonObj.get("tin").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `tin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tin").toString())); } + if ((jsonObj.get("referenceId") != null && !jsonObj.get("referenceId").isJsonNull()) && !jsonObj.get("referenceId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `referenceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("referenceId").toString())); + } + if ((jsonObj.get("groupName") != null && !jsonObj.get("groupName").isJsonNull()) && !jsonObj.get("groupName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `groupName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("groupName").toString())); + } + if ((jsonObj.get("foreignProvince") != null && !jsonObj.get("foreignProvince").isJsonNull()) && !jsonObj.get("foreignProvince").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `foreignProvince` to be a primitive type in the JSON string but got `%s`", jsonObj.get("foreignProvince").toString())); + } + if ((jsonObj.get("countryCode") != null && !jsonObj.get("countryCode").isJsonNull()) && !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())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/CoveredIndividual.java b/src/main/java/Avalara/SDK/model/A1099/V2/CoveredIndividual.java new file mode 100644 index 0000000..c645bf3 --- /dev/null +++ b/src/main/java/Avalara/SDK/model/A1099/V2/CoveredIndividual.java @@ -0,0 +1,742 @@ +/* + * AvaTax Software Development Kit for Java (JRE) + * + * (c) 2004-2025 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * Avalara 1099 & W-9 API Definition + * + * ## 🔐 Authentication Generate a **license key** from: *[Avalara Portal](https://www.avalara.com/us/en/signin.html) → Settings → License and API Keys*. [More on authentication methods](https://developer.avalara.com/avatax-dm-combined-erp/common-setup/authentication/authentication-methods/) [Test your credentials](https://developer.avalara.com/avatax/test-credentials/) ## 📘 API & SDK Documentation [Avalara SDK (.NET) on GitHub](https://github.com/avadev/Avalara-SDK-DotNet#avalarasdk--the-unified-c-library-for-next-gen-avalara-services) [Code Examples – 1099 API](https://github.com/avadev/Avalara-SDK-DotNet/blob/main/docs/A1099/V2/Class1099IssuersApi.md#call1099issuersget) + * + * @author Sachin Baijal + * @author Jonathan Wenger + * @copyright 2004-2025 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @link https://github.com/avadev/Avalara-SDK-Java + */ + +package Avalara.SDK.model.A1099.V2; + +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.time.LocalDate; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +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; + +/** + * Covered individual information for health coverage forms + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") +public class CoveredIndividual { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_FIRST_NAME = "firstName"; + @SerializedName(SERIALIZED_NAME_FIRST_NAME) + private String firstName; + + public static final String SERIALIZED_NAME_MIDDLE_NAME = "middleName"; + @SerializedName(SERIALIZED_NAME_MIDDLE_NAME) + private String middleName; + + public static final String SERIALIZED_NAME_LAST_NAME = "lastName"; + @SerializedName(SERIALIZED_NAME_LAST_NAME) + private String lastName; + + public static final String SERIALIZED_NAME_NAME_SUFFIX = "nameSuffix"; + @SerializedName(SERIALIZED_NAME_NAME_SUFFIX) + private String nameSuffix; + + public static final String SERIALIZED_NAME_TIN = "tin"; + @SerializedName(SERIALIZED_NAME_TIN) + private String tin; + + public static final String SERIALIZED_NAME_BIRTH_DATE = "birthDate"; + @SerializedName(SERIALIZED_NAME_BIRTH_DATE) + private LocalDate birthDate; + + public static final String SERIALIZED_NAME_COVERED_ALL_MONTHS = "coveredAllMonths"; + @SerializedName(SERIALIZED_NAME_COVERED_ALL_MONTHS) + private Boolean coveredAllMonths; + + public static final String SERIALIZED_NAME_COVERED_JANUARY = "coveredJanuary"; + @SerializedName(SERIALIZED_NAME_COVERED_JANUARY) + private Boolean coveredJanuary; + + public static final String SERIALIZED_NAME_COVERED_FEBRUARY = "coveredFebruary"; + @SerializedName(SERIALIZED_NAME_COVERED_FEBRUARY) + private Boolean coveredFebruary; + + public static final String SERIALIZED_NAME_COVERED_MARCH = "coveredMarch"; + @SerializedName(SERIALIZED_NAME_COVERED_MARCH) + private Boolean coveredMarch; + + public static final String SERIALIZED_NAME_COVERED_APRIL = "coveredApril"; + @SerializedName(SERIALIZED_NAME_COVERED_APRIL) + private Boolean coveredApril; + + public static final String SERIALIZED_NAME_COVERED_MAY = "coveredMay"; + @SerializedName(SERIALIZED_NAME_COVERED_MAY) + private Boolean coveredMay; + + public static final String SERIALIZED_NAME_COVERED_JUNE = "coveredJune"; + @SerializedName(SERIALIZED_NAME_COVERED_JUNE) + private Boolean coveredJune; + + public static final String SERIALIZED_NAME_COVERED_JULY = "coveredJuly"; + @SerializedName(SERIALIZED_NAME_COVERED_JULY) + private Boolean coveredJuly; + + public static final String SERIALIZED_NAME_COVERED_AUGUST = "coveredAugust"; + @SerializedName(SERIALIZED_NAME_COVERED_AUGUST) + private Boolean coveredAugust; + + public static final String SERIALIZED_NAME_COVERED_SEPTEMBER = "coveredSeptember"; + @SerializedName(SERIALIZED_NAME_COVERED_SEPTEMBER) + private Boolean coveredSeptember; + + public static final String SERIALIZED_NAME_COVERED_OCTOBER = "coveredOctober"; + @SerializedName(SERIALIZED_NAME_COVERED_OCTOBER) + private Boolean coveredOctober; + + public static final String SERIALIZED_NAME_COVERED_NOVEMBER = "coveredNovember"; + @SerializedName(SERIALIZED_NAME_COVERED_NOVEMBER) + private Boolean coveredNovember; + + public static final String SERIALIZED_NAME_COVERED_DECEMBER = "coveredDecember"; + @SerializedName(SERIALIZED_NAME_COVERED_DECEMBER) + private Boolean coveredDecember; + + public CoveredIndividual() { + } + + public CoveredIndividual( + String id + ) { + this(); + this.id = id; + } + + /** + * Covered individual's ID + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + + + public CoveredIndividual firstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Covered individual's first name + * @return firstName + */ + @javax.annotation.Nullable + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + + public CoveredIndividual middleName(String middleName) { + this.middleName = middleName; + return this; + } + + /** + * Covered individual's middle name + * @return middleName + */ + @javax.annotation.Nullable + public String getMiddleName() { + return middleName; + } + + public void setMiddleName(String middleName) { + this.middleName = middleName; + } + + + public CoveredIndividual lastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Covered individual's last name + * @return lastName + */ + @javax.annotation.Nullable + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + + public CoveredIndividual nameSuffix(String nameSuffix) { + this.nameSuffix = nameSuffix; + return this; + } + + /** + * Covered individual's name suffix + * @return nameSuffix + */ + @javax.annotation.Nullable + public String getNameSuffix() { + return nameSuffix; + } + + public void setNameSuffix(String nameSuffix) { + this.nameSuffix = nameSuffix; + } + + + public CoveredIndividual tin(String tin) { + this.tin = tin; + return this; + } + + /** + * Covered individual's Federal Tax Identification Number (TIN).. SSN or ITIN. Required unless unavailable. + * @return tin + */ + @javax.annotation.Nullable + public String getTin() { + return tin; + } + + public void setTin(String tin) { + this.tin = tin; + } + + + public CoveredIndividual birthDate(LocalDate birthDate) { + this.birthDate = birthDate; + return this; + } + + /** + * Covered individual's date of birth - Required when SSN is missing. + * @return birthDate + */ + @javax.annotation.Nullable + public LocalDate getBirthDate() { + return birthDate; + } + + public void setBirthDate(LocalDate birthDate) { + this.birthDate = birthDate; + } + + + public CoveredIndividual coveredAllMonths(Boolean coveredAllMonths) { + this.coveredAllMonths = coveredAllMonths; + return this; + } + + /** + * Coverage indicator for all 12 months + * @return coveredAllMonths + */ + @javax.annotation.Nullable + public Boolean getCoveredAllMonths() { + return coveredAllMonths; + } + + public void setCoveredAllMonths(Boolean coveredAllMonths) { + this.coveredAllMonths = coveredAllMonths; + } + + + public CoveredIndividual coveredJanuary(Boolean coveredJanuary) { + this.coveredJanuary = coveredJanuary; + return this; + } + + /** + * Coverage indicator for January + * @return coveredJanuary + */ + @javax.annotation.Nullable + public Boolean getCoveredJanuary() { + return coveredJanuary; + } + + public void setCoveredJanuary(Boolean coveredJanuary) { + this.coveredJanuary = coveredJanuary; + } + + + public CoveredIndividual coveredFebruary(Boolean coveredFebruary) { + this.coveredFebruary = coveredFebruary; + return this; + } + + /** + * Coverage indicator for February + * @return coveredFebruary + */ + @javax.annotation.Nullable + public Boolean getCoveredFebruary() { + return coveredFebruary; + } + + public void setCoveredFebruary(Boolean coveredFebruary) { + this.coveredFebruary = coveredFebruary; + } + + + public CoveredIndividual coveredMarch(Boolean coveredMarch) { + this.coveredMarch = coveredMarch; + return this; + } + + /** + * Coverage indicator for March + * @return coveredMarch + */ + @javax.annotation.Nullable + public Boolean getCoveredMarch() { + return coveredMarch; + } + + public void setCoveredMarch(Boolean coveredMarch) { + this.coveredMarch = coveredMarch; + } + + + public CoveredIndividual coveredApril(Boolean coveredApril) { + this.coveredApril = coveredApril; + return this; + } + + /** + * Coverage indicator for April + * @return coveredApril + */ + @javax.annotation.Nullable + public Boolean getCoveredApril() { + return coveredApril; + } + + public void setCoveredApril(Boolean coveredApril) { + this.coveredApril = coveredApril; + } + + + public CoveredIndividual coveredMay(Boolean coveredMay) { + this.coveredMay = coveredMay; + return this; + } + + /** + * Coverage indicator for May + * @return coveredMay + */ + @javax.annotation.Nullable + public Boolean getCoveredMay() { + return coveredMay; + } + + public void setCoveredMay(Boolean coveredMay) { + this.coveredMay = coveredMay; + } + + + public CoveredIndividual coveredJune(Boolean coveredJune) { + this.coveredJune = coveredJune; + return this; + } + + /** + * Coverage indicator for June + * @return coveredJune + */ + @javax.annotation.Nullable + public Boolean getCoveredJune() { + return coveredJune; + } + + public void setCoveredJune(Boolean coveredJune) { + this.coveredJune = coveredJune; + } + + + public CoveredIndividual coveredJuly(Boolean coveredJuly) { + this.coveredJuly = coveredJuly; + return this; + } + + /** + * Coverage indicator for July + * @return coveredJuly + */ + @javax.annotation.Nullable + public Boolean getCoveredJuly() { + return coveredJuly; + } + + public void setCoveredJuly(Boolean coveredJuly) { + this.coveredJuly = coveredJuly; + } + + + public CoveredIndividual coveredAugust(Boolean coveredAugust) { + this.coveredAugust = coveredAugust; + return this; + } + + /** + * Coverage indicator for August + * @return coveredAugust + */ + @javax.annotation.Nullable + public Boolean getCoveredAugust() { + return coveredAugust; + } + + public void setCoveredAugust(Boolean coveredAugust) { + this.coveredAugust = coveredAugust; + } + + + public CoveredIndividual coveredSeptember(Boolean coveredSeptember) { + this.coveredSeptember = coveredSeptember; + return this; + } + + /** + * Coverage indicator for September + * @return coveredSeptember + */ + @javax.annotation.Nullable + public Boolean getCoveredSeptember() { + return coveredSeptember; + } + + public void setCoveredSeptember(Boolean coveredSeptember) { + this.coveredSeptember = coveredSeptember; + } + + + public CoveredIndividual coveredOctober(Boolean coveredOctober) { + this.coveredOctober = coveredOctober; + return this; + } + + /** + * Coverage indicator for October + * @return coveredOctober + */ + @javax.annotation.Nullable + public Boolean getCoveredOctober() { + return coveredOctober; + } + + public void setCoveredOctober(Boolean coveredOctober) { + this.coveredOctober = coveredOctober; + } + + + public CoveredIndividual coveredNovember(Boolean coveredNovember) { + this.coveredNovember = coveredNovember; + return this; + } + + /** + * Coverage indicator for November + * @return coveredNovember + */ + @javax.annotation.Nullable + public Boolean getCoveredNovember() { + return coveredNovember; + } + + public void setCoveredNovember(Boolean coveredNovember) { + this.coveredNovember = coveredNovember; + } + + + public CoveredIndividual coveredDecember(Boolean coveredDecember) { + this.coveredDecember = coveredDecember; + return this; + } + + /** + * Coverage indicator for December + * @return coveredDecember + */ + @javax.annotation.Nullable + public Boolean getCoveredDecember() { + return coveredDecember; + } + + public void setCoveredDecember(Boolean coveredDecember) { + this.coveredDecember = coveredDecember; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CoveredIndividual coveredIndividual = (CoveredIndividual) o; + return Objects.equals(this.id, coveredIndividual.id) && + Objects.equals(this.firstName, coveredIndividual.firstName) && + Objects.equals(this.middleName, coveredIndividual.middleName) && + Objects.equals(this.lastName, coveredIndividual.lastName) && + Objects.equals(this.nameSuffix, coveredIndividual.nameSuffix) && + Objects.equals(this.tin, coveredIndividual.tin) && + Objects.equals(this.birthDate, coveredIndividual.birthDate) && + Objects.equals(this.coveredAllMonths, coveredIndividual.coveredAllMonths) && + Objects.equals(this.coveredJanuary, coveredIndividual.coveredJanuary) && + Objects.equals(this.coveredFebruary, coveredIndividual.coveredFebruary) && + Objects.equals(this.coveredMarch, coveredIndividual.coveredMarch) && + Objects.equals(this.coveredApril, coveredIndividual.coveredApril) && + Objects.equals(this.coveredMay, coveredIndividual.coveredMay) && + Objects.equals(this.coveredJune, coveredIndividual.coveredJune) && + Objects.equals(this.coveredJuly, coveredIndividual.coveredJuly) && + Objects.equals(this.coveredAugust, coveredIndividual.coveredAugust) && + Objects.equals(this.coveredSeptember, coveredIndividual.coveredSeptember) && + Objects.equals(this.coveredOctober, coveredIndividual.coveredOctober) && + Objects.equals(this.coveredNovember, coveredIndividual.coveredNovember) && + Objects.equals(this.coveredDecember, coveredIndividual.coveredDecember); + } + + 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(id, firstName, middleName, lastName, nameSuffix, tin, birthDate, coveredAllMonths, coveredJanuary, coveredFebruary, coveredMarch, coveredApril, coveredMay, coveredJune, coveredJuly, coveredAugust, coveredSeptember, coveredOctober, coveredNovember, coveredDecember); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CoveredIndividual {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" middleName: ").append(toIndentedString(middleName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" nameSuffix: ").append(toIndentedString(nameSuffix)).append("\n"); + sb.append(" tin: ").append(toIndentedString(tin)).append("\n"); + sb.append(" birthDate: ").append(toIndentedString(birthDate)).append("\n"); + sb.append(" coveredAllMonths: ").append(toIndentedString(coveredAllMonths)).append("\n"); + sb.append(" coveredJanuary: ").append(toIndentedString(coveredJanuary)).append("\n"); + sb.append(" coveredFebruary: ").append(toIndentedString(coveredFebruary)).append("\n"); + sb.append(" coveredMarch: ").append(toIndentedString(coveredMarch)).append("\n"); + sb.append(" coveredApril: ").append(toIndentedString(coveredApril)).append("\n"); + sb.append(" coveredMay: ").append(toIndentedString(coveredMay)).append("\n"); + sb.append(" coveredJune: ").append(toIndentedString(coveredJune)).append("\n"); + sb.append(" coveredJuly: ").append(toIndentedString(coveredJuly)).append("\n"); + sb.append(" coveredAugust: ").append(toIndentedString(coveredAugust)).append("\n"); + sb.append(" coveredSeptember: ").append(toIndentedString(coveredSeptember)).append("\n"); + sb.append(" coveredOctober: ").append(toIndentedString(coveredOctober)).append("\n"); + sb.append(" coveredNovember: ").append(toIndentedString(coveredNovember)).append("\n"); + sb.append(" coveredDecember: ").append(toIndentedString(coveredDecember)).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("firstName"); + openapiFields.add("middleName"); + openapiFields.add("lastName"); + openapiFields.add("nameSuffix"); + openapiFields.add("tin"); + openapiFields.add("birthDate"); + openapiFields.add("coveredAllMonths"); + openapiFields.add("coveredJanuary"); + openapiFields.add("coveredFebruary"); + openapiFields.add("coveredMarch"); + openapiFields.add("coveredApril"); + openapiFields.add("coveredMay"); + openapiFields.add("coveredJune"); + openapiFields.add("coveredJuly"); + openapiFields.add("coveredAugust"); + openapiFields.add("coveredSeptember"); + openapiFields.add("coveredOctober"); + openapiFields.add("coveredNovember"); + openapiFields.add("coveredDecember"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("firstName"); + openapiRequiredFields.add("lastName"); + } + + /** + * 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 CoveredIndividual + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CoveredIndividual.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CoveredIndividual is not found in the empty JSON string", CoveredIndividual.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CoveredIndividual.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CoveredIndividual` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CoveredIndividual.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("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("firstName") != null && !jsonObj.get("firstName").isJsonNull()) && !jsonObj.get("firstName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `firstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("firstName").toString())); + } + if ((jsonObj.get("middleName") != null && !jsonObj.get("middleName").isJsonNull()) && !jsonObj.get("middleName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `middleName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("middleName").toString())); + } + if ((jsonObj.get("lastName") != null && !jsonObj.get("lastName").isJsonNull()) && !jsonObj.get("lastName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastName").toString())); + } + if ((jsonObj.get("nameSuffix") != null && !jsonObj.get("nameSuffix").isJsonNull()) && !jsonObj.get("nameSuffix").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `nameSuffix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nameSuffix").toString())); + } + if ((jsonObj.get("tin") != null && !jsonObj.get("tin").isJsonNull()) && !jsonObj.get("tin").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `tin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tin").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CoveredIndividual.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CoveredIndividual' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CoveredIndividual.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CoveredIndividual value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CoveredIndividual read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CoveredIndividual given an JSON string + * + * @param jsonString JSON string + * @return An instance of CoveredIndividual + * @throws IOException if the JSON string is invalid with respect to CoveredIndividual + */ + public static CoveredIndividual fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CoveredIndividual.class); + } + + /** + * Convert an instance of CoveredIndividual to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/CreateAndSendW9FormEmailRequest.java b/src/main/java/Avalara/SDK/model/A1099/V2/CreateAndSendW9FormEmailRequest.java new file mode 100644 index 0000000..116b349 --- /dev/null +++ b/src/main/java/Avalara/SDK/model/A1099/V2/CreateAndSendW9FormEmailRequest.java @@ -0,0 +1,413 @@ +/* + * AvaTax Software Development Kit for Java (JRE) + * + * (c) 2004-2025 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * Avalara 1099 & W-9 API Definition + * + * ## 🔐 Authentication Generate a **license key** from: *[Avalara Portal](https://www.avalara.com/us/en/signin.html) → Settings → License and API Keys*. [More on authentication methods](https://developer.avalara.com/avatax-dm-combined-erp/common-setup/authentication/authentication-methods/) [Test your credentials](https://developer.avalara.com/avatax/test-credentials/) ## 📘 API & SDK Documentation [Avalara SDK (.NET) on GitHub](https://github.com/avadev/Avalara-SDK-DotNet#avalarasdk--the-unified-c-library-for-next-gen-avalara-services) [Code Examples – 1099 API](https://github.com/avadev/Avalara-SDK-DotNet/blob/main/docs/A1099/V2/Class1099IssuersApi.md#call1099issuersget) + * + * @author Sachin Baijal + * @author Jonathan Wenger + * @copyright 2004-2025 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @link https://github.com/avadev/Avalara-SDK-Java + */ + +package Avalara.SDK.model.A1099.V2; + +import java.util.Objects; +import Avalara.SDK.model.A1099.V2.W4FormMinimalRequest; +import Avalara.SDK.model.A1099.V2.W8BenEFormMinimalRequest; +import Avalara.SDK.model.A1099.V2.W8BenFormMinimalRequest; +import Avalara.SDK.model.A1099.V2.W8ImyFormMinimalRequest; +import Avalara.SDK.model.A1099.V2.W9FormMinimalRequest; +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 org.openapitools.jackson.nullable.JsonNullable; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import Avalara.SDK.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") +public class CreateAndSendW9FormEmailRequest extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(CreateAndSendW9FormEmailRequest.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateAndSendW9FormEmailRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateAndSendW9FormEmailRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterW4FormMinimalRequest = gson.getDelegateAdapter(this, TypeToken.get(W4FormMinimalRequest.class)); + final TypeAdapter adapterW8BenEFormMinimalRequest = gson.getDelegateAdapter(this, TypeToken.get(W8BenEFormMinimalRequest.class)); + final TypeAdapter adapterW8BenFormMinimalRequest = gson.getDelegateAdapter(this, TypeToken.get(W8BenFormMinimalRequest.class)); + final TypeAdapter adapterW8ImyFormMinimalRequest = gson.getDelegateAdapter(this, TypeToken.get(W8ImyFormMinimalRequest.class)); + final TypeAdapter adapterW9FormMinimalRequest = gson.getDelegateAdapter(this, TypeToken.get(W9FormMinimalRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateAndSendW9FormEmailRequest value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `W4FormMinimalRequest` + if (value.getActualInstance() instanceof W4FormMinimalRequest) { + JsonElement element = adapterW4FormMinimalRequest.toJsonTree((W4FormMinimalRequest)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `W8BenEFormMinimalRequest` + if (value.getActualInstance() instanceof W8BenEFormMinimalRequest) { + JsonElement element = adapterW8BenEFormMinimalRequest.toJsonTree((W8BenEFormMinimalRequest)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `W8BenFormMinimalRequest` + if (value.getActualInstance() instanceof W8BenFormMinimalRequest) { + JsonElement element = adapterW8BenFormMinimalRequest.toJsonTree((W8BenFormMinimalRequest)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `W8ImyFormMinimalRequest` + if (value.getActualInstance() instanceof W8ImyFormMinimalRequest) { + JsonElement element = adapterW8ImyFormMinimalRequest.toJsonTree((W8ImyFormMinimalRequest)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `W9FormMinimalRequest` + if (value.getActualInstance() instanceof W9FormMinimalRequest) { + JsonElement element = adapterW9FormMinimalRequest.toJsonTree((W9FormMinimalRequest)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: W4FormMinimalRequest, W8BenEFormMinimalRequest, W8BenFormMinimalRequest, W8ImyFormMinimalRequest, W9FormMinimalRequest"); + } + + @Override + public CreateAndSendW9FormEmailRequest read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize W4FormMinimalRequest + try { + // validate the JSON object to see if any exception is thrown + W4FormMinimalRequest.validateJsonElement(jsonElement); + actualAdapter = adapterW4FormMinimalRequest; + match++; + log.log(Level.FINER, "Input data matches schema 'W4FormMinimalRequest'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for W4FormMinimalRequest failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'W4FormMinimalRequest'", e); + } + // deserialize W8BenEFormMinimalRequest + try { + // validate the JSON object to see if any exception is thrown + W8BenEFormMinimalRequest.validateJsonElement(jsonElement); + actualAdapter = adapterW8BenEFormMinimalRequest; + match++; + log.log(Level.FINER, "Input data matches schema 'W8BenEFormMinimalRequest'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for W8BenEFormMinimalRequest failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'W8BenEFormMinimalRequest'", e); + } + // deserialize W8BenFormMinimalRequest + try { + // validate the JSON object to see if any exception is thrown + W8BenFormMinimalRequest.validateJsonElement(jsonElement); + actualAdapter = adapterW8BenFormMinimalRequest; + match++; + log.log(Level.FINER, "Input data matches schema 'W8BenFormMinimalRequest'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for W8BenFormMinimalRequest failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'W8BenFormMinimalRequest'", e); + } + // deserialize W8ImyFormMinimalRequest + try { + // validate the JSON object to see if any exception is thrown + W8ImyFormMinimalRequest.validateJsonElement(jsonElement); + actualAdapter = adapterW8ImyFormMinimalRequest; + match++; + log.log(Level.FINER, "Input data matches schema 'W8ImyFormMinimalRequest'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for W8ImyFormMinimalRequest failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'W8ImyFormMinimalRequest'", e); + } + // deserialize W9FormMinimalRequest + try { + // validate the JSON object to see if any exception is thrown + W9FormMinimalRequest.validateJsonElement(jsonElement); + actualAdapter = adapterW9FormMinimalRequest; + match++; + log.log(Level.FINER, "Input data matches schema 'W9FormMinimalRequest'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for W9FormMinimalRequest failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'W9FormMinimalRequest'", e); + } + + if (match == 1) { + CreateAndSendW9FormEmailRequest ret = new CreateAndSendW9FormEmailRequest(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for CreateAndSendW9FormEmailRequest: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap>(); + + public CreateAndSendW9FormEmailRequest() { + super("oneOf", Boolean.FALSE); + } + + public CreateAndSendW9FormEmailRequest(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("W4FormMinimalRequest", W4FormMinimalRequest.class); + schemas.put("W8BenEFormMinimalRequest", W8BenEFormMinimalRequest.class); + schemas.put("W8BenFormMinimalRequest", W8BenFormMinimalRequest.class); + schemas.put("W8ImyFormMinimalRequest", W8ImyFormMinimalRequest.class); + schemas.put("W9FormMinimalRequest", W9FormMinimalRequest.class); + } + + @Override + public Map> getSchemas() { + return CreateAndSendW9FormEmailRequest.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * W4FormMinimalRequest, W8BenEFormMinimalRequest, W8BenFormMinimalRequest, W8ImyFormMinimalRequest, W9FormMinimalRequest + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof W4FormMinimalRequest) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof W8BenEFormMinimalRequest) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof W8BenFormMinimalRequest) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof W8ImyFormMinimalRequest) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof W9FormMinimalRequest) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be W4FormMinimalRequest, W8BenEFormMinimalRequest, W8BenFormMinimalRequest, W8ImyFormMinimalRequest, W9FormMinimalRequest"); + } + + /** + * Get the actual instance, which can be the following: + * W4FormMinimalRequest, W8BenEFormMinimalRequest, W8BenFormMinimalRequest, W8ImyFormMinimalRequest, W9FormMinimalRequest + * + * @return The actual instance (W4FormMinimalRequest, W8BenEFormMinimalRequest, W8BenFormMinimalRequest, W8ImyFormMinimalRequest, W9FormMinimalRequest) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `W4FormMinimalRequest`. If the actual instance is not `W4FormMinimalRequest`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `W4FormMinimalRequest` + * @throws ClassCastException if the instance is not `W4FormMinimalRequest` + */ + public W4FormMinimalRequest getW4FormMinimalRequest() throws ClassCastException { + return (W4FormMinimalRequest)super.getActualInstance(); + } + /** + * Get the actual instance of `W8BenEFormMinimalRequest`. If the actual instance is not `W8BenEFormMinimalRequest`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `W8BenEFormMinimalRequest` + * @throws ClassCastException if the instance is not `W8BenEFormMinimalRequest` + */ + public W8BenEFormMinimalRequest getW8BenEFormMinimalRequest() throws ClassCastException { + return (W8BenEFormMinimalRequest)super.getActualInstance(); + } + /** + * Get the actual instance of `W8BenFormMinimalRequest`. If the actual instance is not `W8BenFormMinimalRequest`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `W8BenFormMinimalRequest` + * @throws ClassCastException if the instance is not `W8BenFormMinimalRequest` + */ + public W8BenFormMinimalRequest getW8BenFormMinimalRequest() throws ClassCastException { + return (W8BenFormMinimalRequest)super.getActualInstance(); + } + /** + * Get the actual instance of `W8ImyFormMinimalRequest`. If the actual instance is not `W8ImyFormMinimalRequest`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `W8ImyFormMinimalRequest` + * @throws ClassCastException if the instance is not `W8ImyFormMinimalRequest` + */ + public W8ImyFormMinimalRequest getW8ImyFormMinimalRequest() throws ClassCastException { + return (W8ImyFormMinimalRequest)super.getActualInstance(); + } + /** + * Get the actual instance of `W9FormMinimalRequest`. If the actual instance is not `W9FormMinimalRequest`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `W9FormMinimalRequest` + * @throws ClassCastException if the instance is not `W9FormMinimalRequest` + */ + public W9FormMinimalRequest getW9FormMinimalRequest() throws ClassCastException { + return (W9FormMinimalRequest)super.getActualInstance(); + } + + /** + * 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 CreateAndSendW9FormEmailRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with W4FormMinimalRequest + try { + W4FormMinimalRequest.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for W4FormMinimalRequest failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with W8BenEFormMinimalRequest + try { + W8BenEFormMinimalRequest.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for W8BenEFormMinimalRequest failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with W8BenFormMinimalRequest + try { + W8BenFormMinimalRequest.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for W8BenFormMinimalRequest failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with W8ImyFormMinimalRequest + try { + W8ImyFormMinimalRequest.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for W8ImyFormMinimalRequest failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with W9FormMinimalRequest + try { + W9FormMinimalRequest.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for W9FormMinimalRequest failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for CreateAndSendW9FormEmailRequest with oneOf schemas: W4FormMinimalRequest, W8BenEFormMinimalRequest, W8BenFormMinimalRequest, W8ImyFormMinimalRequest, W9FormMinimalRequest. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of CreateAndSendW9FormEmailRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateAndSendW9FormEmailRequest + * @throws IOException if the JSON string is invalid with respect to CreateAndSendW9FormEmailRequest + */ + public static CreateAndSendW9FormEmailRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateAndSendW9FormEmailRequest.class); + } + + /** + * Convert an instance of CreateAndSendW9FormEmailRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/CreateCompanyRequest.java b/src/main/java/Avalara/SDK/model/A1099/V2/CreateCompanyRequest.java new file mode 100644 index 0000000..3902762 --- /dev/null +++ b/src/main/java/Avalara/SDK/model/A1099/V2/CreateCompanyRequest.java @@ -0,0 +1,282 @@ +/* + * AvaTax Software Development Kit for Java (JRE) + * + * (c) 2004-2025 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * Avalara 1099 & W-9 API Definition + * + * ## 🔐 Authentication Generate a **license key** from: *[Avalara Portal](https://www.avalara.com/us/en/signin.html) → Settings → License and API Keys*. [More on authentication methods](https://developer.avalara.com/avatax-dm-combined-erp/common-setup/authentication/authentication-methods/) [Test your credentials](https://developer.avalara.com/avatax/test-credentials/) ## 📘 API & SDK Documentation [Avalara SDK (.NET) on GitHub](https://github.com/avadev/Avalara-SDK-DotNet#avalarasdk--the-unified-c-library-for-next-gen-avalara-services) [Code Examples – 1099 API](https://github.com/avadev/Avalara-SDK-DotNet/blob/main/docs/A1099/V2/Class1099IssuersApi.md#call1099issuersget) + * + * @author Sachin Baijal + * @author Jonathan Wenger + * @copyright 2004-2025 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @link https://github.com/avadev/Avalara-SDK-Java + */ + +package Avalara.SDK.model.A1099.V2; + +import java.util.Objects; +import Avalara.SDK.model.A1099.V2.CompanyCreateUpdateRequestModel; +import Avalara.SDK.model.A1099.V2.CompanyResponse; +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 org.openapitools.jackson.nullable.JsonNullable; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import Avalara.SDK.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") +public class CreateCompanyRequest extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(CreateCompanyRequest.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateCompanyRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateCompanyRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterCompanyCreateUpdateRequestModel = gson.getDelegateAdapter(this, TypeToken.get(CompanyCreateUpdateRequestModel.class)); + final TypeAdapter adapterCompanyResponse = gson.getDelegateAdapter(this, TypeToken.get(CompanyResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateCompanyRequest value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `CompanyCreateUpdateRequestModel` + if (value.getActualInstance() instanceof CompanyCreateUpdateRequestModel) { + JsonElement element = adapterCompanyCreateUpdateRequestModel.toJsonTree((CompanyCreateUpdateRequestModel)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `CompanyResponse` + if (value.getActualInstance() instanceof CompanyResponse) { + JsonElement element = adapterCompanyResponse.toJsonTree((CompanyResponse)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: CompanyCreateUpdateRequestModel, CompanyResponse"); + } + + @Override + public CreateCompanyRequest read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize CompanyCreateUpdateRequestModel + try { + // validate the JSON object to see if any exception is thrown + CompanyCreateUpdateRequestModel.validateJsonElement(jsonElement); + actualAdapter = adapterCompanyCreateUpdateRequestModel; + match++; + log.log(Level.FINER, "Input data matches schema 'CompanyCreateUpdateRequestModel'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for CompanyCreateUpdateRequestModel failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'CompanyCreateUpdateRequestModel'", e); + } + // deserialize CompanyResponse + try { + // validate the JSON object to see if any exception is thrown + CompanyResponse.validateJsonElement(jsonElement); + actualAdapter = adapterCompanyResponse; + match++; + log.log(Level.FINER, "Input data matches schema 'CompanyResponse'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for CompanyResponse failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'CompanyResponse'", e); + } + + if (match == 1) { + CreateCompanyRequest ret = new CreateCompanyRequest(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for CreateCompanyRequest: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap>(); + + public CreateCompanyRequest() { + super("oneOf", Boolean.FALSE); + } + + public CreateCompanyRequest(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("CompanyCreateUpdateRequestModel", CompanyCreateUpdateRequestModel.class); + schemas.put("CompanyResponse", CompanyResponse.class); + } + + @Override + public Map> getSchemas() { + return CreateCompanyRequest.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * CompanyCreateUpdateRequestModel, CompanyResponse + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof CompanyCreateUpdateRequestModel) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof CompanyResponse) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be CompanyCreateUpdateRequestModel, CompanyResponse"); + } + + /** + * Get the actual instance, which can be the following: + * CompanyCreateUpdateRequestModel, CompanyResponse + * + * @return The actual instance (CompanyCreateUpdateRequestModel, CompanyResponse) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `CompanyCreateUpdateRequestModel`. If the actual instance is not `CompanyCreateUpdateRequestModel`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `CompanyCreateUpdateRequestModel` + * @throws ClassCastException if the instance is not `CompanyCreateUpdateRequestModel` + */ + public CompanyCreateUpdateRequestModel getCompanyCreateUpdateRequestModel() throws ClassCastException { + return (CompanyCreateUpdateRequestModel)super.getActualInstance(); + } + /** + * Get the actual instance of `CompanyResponse`. If the actual instance is not `CompanyResponse`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `CompanyResponse` + * @throws ClassCastException if the instance is not `CompanyResponse` + */ + public CompanyResponse getCompanyResponse() throws ClassCastException { + return (CompanyResponse)super.getActualInstance(); + } + + /** + * 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 CreateCompanyRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with CompanyCreateUpdateRequestModel + try { + CompanyCreateUpdateRequestModel.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for CompanyCreateUpdateRequestModel failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with CompanyResponse + try { + CompanyResponse.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for CompanyResponse failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for CreateCompanyRequest with oneOf schemas: CompanyCreateUpdateRequestModel, CompanyResponse. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of CreateCompanyRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateCompanyRequest + * @throws IOException if the JSON string is invalid with respect to CreateCompanyRequest + */ + public static CreateCompanyRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateCompanyRequest.class); + } + + /** + * Convert an instance of CreateCompanyRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/CreateIssuerRequest.java b/src/main/java/Avalara/SDK/model/A1099/V2/CreateIssuerRequest.java new file mode 100644 index 0000000..5475e6d --- /dev/null +++ b/src/main/java/Avalara/SDK/model/A1099/V2/CreateIssuerRequest.java @@ -0,0 +1,282 @@ +/* + * AvaTax Software Development Kit for Java (JRE) + * + * (c) 2004-2025 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * Avalara 1099 & W-9 API Definition + * + * ## 🔐 Authentication Generate a **license key** from: *[Avalara Portal](https://www.avalara.com/us/en/signin.html) → Settings → License and API Keys*. [More on authentication methods](https://developer.avalara.com/avatax-dm-combined-erp/common-setup/authentication/authentication-methods/) [Test your credentials](https://developer.avalara.com/avatax/test-credentials/) ## 📘 API & SDK Documentation [Avalara SDK (.NET) on GitHub](https://github.com/avadev/Avalara-SDK-DotNet#avalarasdk--the-unified-c-library-for-next-gen-avalara-services) [Code Examples – 1099 API](https://github.com/avadev/Avalara-SDK-DotNet/blob/main/docs/A1099/V2/Class1099IssuersApi.md#call1099issuersget) + * + * @author Sachin Baijal + * @author Jonathan Wenger + * @copyright 2004-2025 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @link https://github.com/avadev/Avalara-SDK-Java + */ + +package Avalara.SDK.model.A1099.V2; + +import java.util.Objects; +import Avalara.SDK.model.A1099.V2.IssuerCommand; +import Avalara.SDK.model.A1099.V2.IssuerResponse; +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 org.openapitools.jackson.nullable.JsonNullable; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import Avalara.SDK.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") +public class CreateIssuerRequest extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(CreateIssuerRequest.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateIssuerRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateIssuerRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterIssuerCommand = gson.getDelegateAdapter(this, TypeToken.get(IssuerCommand.class)); + final TypeAdapter adapterIssuerResponse = gson.getDelegateAdapter(this, TypeToken.get(IssuerResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateIssuerRequest value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `IssuerCommand` + if (value.getActualInstance() instanceof IssuerCommand) { + JsonElement element = adapterIssuerCommand.toJsonTree((IssuerCommand)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `IssuerResponse` + if (value.getActualInstance() instanceof IssuerResponse) { + JsonElement element = adapterIssuerResponse.toJsonTree((IssuerResponse)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: IssuerCommand, IssuerResponse"); + } + + @Override + public CreateIssuerRequest read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize IssuerCommand + try { + // validate the JSON object to see if any exception is thrown + IssuerCommand.validateJsonElement(jsonElement); + actualAdapter = adapterIssuerCommand; + match++; + log.log(Level.FINER, "Input data matches schema 'IssuerCommand'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for IssuerCommand failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'IssuerCommand'", e); + } + // deserialize IssuerResponse + try { + // validate the JSON object to see if any exception is thrown + IssuerResponse.validateJsonElement(jsonElement); + actualAdapter = adapterIssuerResponse; + match++; + log.log(Level.FINER, "Input data matches schema 'IssuerResponse'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for IssuerResponse failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'IssuerResponse'", e); + } + + if (match == 1) { + CreateIssuerRequest ret = new CreateIssuerRequest(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for CreateIssuerRequest: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap>(); + + public CreateIssuerRequest() { + super("oneOf", Boolean.FALSE); + } + + public CreateIssuerRequest(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("IssuerCommand", IssuerCommand.class); + schemas.put("IssuerResponse", IssuerResponse.class); + } + + @Override + public Map> getSchemas() { + return CreateIssuerRequest.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * IssuerCommand, IssuerResponse + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof IssuerCommand) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof IssuerResponse) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be IssuerCommand, IssuerResponse"); + } + + /** + * Get the actual instance, which can be the following: + * IssuerCommand, IssuerResponse + * + * @return The actual instance (IssuerCommand, IssuerResponse) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `IssuerCommand`. If the actual instance is not `IssuerCommand`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `IssuerCommand` + * @throws ClassCastException if the instance is not `IssuerCommand` + */ + public IssuerCommand getIssuerCommand() throws ClassCastException { + return (IssuerCommand)super.getActualInstance(); + } + /** + * Get the actual instance of `IssuerResponse`. If the actual instance is not `IssuerResponse`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `IssuerResponse` + * @throws ClassCastException if the instance is not `IssuerResponse` + */ + public IssuerResponse getIssuerResponse() throws ClassCastException { + return (IssuerResponse)super.getActualInstance(); + } + + /** + * 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 CreateIssuerRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with IssuerCommand + try { + IssuerCommand.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for IssuerCommand failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with IssuerResponse + try { + IssuerResponse.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for IssuerResponse failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for CreateIssuerRequest with oneOf schemas: IssuerCommand, IssuerResponse. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of CreateIssuerRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateIssuerRequest + * @throws IOException if the JSON string is invalid with respect to CreateIssuerRequest + */ + public static CreateIssuerRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateIssuerRequest.class); + } + + /** + * Convert an instance of CreateIssuerRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/CreateW9Form201Response.java b/src/main/java/Avalara/SDK/model/A1099/V2/CreateW9Form201Response.java index 19ae7f9..09dd31a 100644 --- a/src/main/java/Avalara/SDK/model/A1099/V2/CreateW9Form201Response.java +++ b/src/main/java/Avalara/SDK/model/A1099/V2/CreateW9Form201Response.java @@ -20,6 +20,7 @@ package Avalara.SDK.model.A1099.V2; import java.util.Objects; +import Avalara.SDK.model.A1099.V2.EntryStatusResponse; import Avalara.SDK.model.A1099.V2.SubstantialUsOwnerResponse; import Avalara.SDK.model.A1099.V2.TinMatchStatusResponse; import Avalara.SDK.model.A1099.V2.W4FormResponse; diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/StateEfileStatusDetailApp.java b/src/main/java/Avalara/SDK/model/A1099/V2/EntryStatusResponse.java similarity index 58% rename from src/main/java/Avalara/SDK/model/A1099/V2/StateEfileStatusDetailApp.java rename to src/main/java/Avalara/SDK/model/A1099/V2/EntryStatusResponse.java index 6662749..3caad6b 100644 --- a/src/main/java/Avalara/SDK/model/A1099/V2/StateEfileStatusDetailApp.java +++ b/src/main/java/Avalara/SDK/model/A1099/V2/EntryStatusResponse.java @@ -8,7 +8,7 @@ * * Avalara 1099 & W-9 API Definition * - * ## 🔐 Authentication Use **username/password** or generate a **license key** from: *Avalara Portal → Settings → License and API Keys*. [More on authentication methods](https://developer.avalara.com/avatax-dm-combined-erp/common-setup/authentication/authentication-methods/) [Test your credentials](https://developer.avalara.com/avatax/test-credentials/) ## 📘 API & SDK Documentation [Avalara SDK (.NET) on GitHub](https://github.com/avadev/Avalara-SDK-DotNet#avalarasdk--the-unified-c-library-for-next-gen-avalara-services) [Code Examples – 1099 API](https://github.com/avadev/Avalara-SDK-DotNet/blob/main/docs/A1099/V2/Class1099IssuersApi.md#call1099issuersget) + * ## 🔐 Authentication Generate a **license key** from: *[Avalara Portal](https://www.avalara.com/us/en/signin.html) → Settings → License and API Keys*. [More on authentication methods](https://developer.avalara.com/avatax-dm-combined-erp/common-setup/authentication/authentication-methods/) [Test your credentials](https://developer.avalara.com/avatax/test-credentials/) ## 📘 API & SDK Documentation [Avalara SDK (.NET) on GitHub](https://github.com/avadev/Avalara-SDK-DotNet#avalarasdk--the-unified-c-library-for-next-gen-avalara-services) [Code Examples – 1099 API](https://github.com/avadev/Avalara-SDK-DotNet/blob/main/docs/A1099/V2/Class1099IssuersApi.md#call1099issuersget) * * @author Sachin Baijal * @author Jonathan Wenger @@ -26,6 +26,7 @@ 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 org.openapitools.jackson.nullable.JsonNullable; @@ -54,32 +55,28 @@ import Avalara.SDK.JSON; /** - * StateEfileStatusDetailApp + * Represents the entry status information for a W9 form. */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") -public class StateEfileStatusDetailApp { +public class EntryStatusResponse { public static final String SERIALIZED_NAME_STATUS = "status"; @SerializedName(SERIALIZED_NAME_STATUS) private String status; public static final String SERIALIZED_NAME_TIME = "time"; @SerializedName(SERIALIZED_NAME_TIME) - private String time; + private OffsetDateTime time; - public static final String SERIALIZED_NAME_JURISDICTION = "jurisdiction"; - @SerializedName(SERIALIZED_NAME_JURISDICTION) - private String jurisdiction; - - public StateEfileStatusDetailApp() { + public EntryStatusResponse() { } - public StateEfileStatusDetailApp status(String status) { + public EntryStatusResponse status(String status) { this.status = status; return this; } /** - * Get status + * The form status. * @return status */ @javax.annotation.Nullable @@ -92,44 +89,25 @@ public void setStatus(String status) { } - public StateEfileStatusDetailApp time(String time) { + public EntryStatusResponse time(OffsetDateTime time) { this.time = time; return this; } /** - * Get time + * The timestamp for the latest status update. * @return time */ @javax.annotation.Nullable - public String getTime() { + public OffsetDateTime getTime() { return time; } - public void setTime(String time) { + public void setTime(OffsetDateTime time) { this.time = time; } - public StateEfileStatusDetailApp jurisdiction(String jurisdiction) { - this.jurisdiction = jurisdiction; - return this; - } - - /** - * Get jurisdiction - * @return jurisdiction - */ - @javax.annotation.Nullable - public String getJurisdiction() { - return jurisdiction; - } - - public void setJurisdiction(String jurisdiction) { - this.jurisdiction = jurisdiction; - } - - @Override public boolean equals(Object o) { @@ -139,10 +117,9 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - StateEfileStatusDetailApp stateEfileStatusDetailApp = (StateEfileStatusDetailApp) o; - return Objects.equals(this.status, stateEfileStatusDetailApp.status) && - Objects.equals(this.time, stateEfileStatusDetailApp.time) && - Objects.equals(this.jurisdiction, stateEfileStatusDetailApp.jurisdiction); + EntryStatusResponse entryStatusResponse = (EntryStatusResponse) o; + return Objects.equals(this.status, entryStatusResponse.status) && + Objects.equals(this.time, entryStatusResponse.time); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -151,7 +128,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(status, time, jurisdiction); + return Objects.hash(status, time); } private static int hashCodeNullable(JsonNullable a) { @@ -164,10 +141,9 @@ private static int hashCodeNullable(JsonNullable a) { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class StateEfileStatusDetailApp {\n"); + sb.append("class EntryStatusResponse {\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" time: ").append(toIndentedString(time)).append("\n"); - sb.append(" jurisdiction: ").append(toIndentedString(jurisdiction)).append("\n"); sb.append("}"); return sb.toString(); } @@ -192,7 +168,6 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("status"); openapiFields.add("time"); - openapiFields.add("jurisdiction"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -202,54 +177,48 @@ private String toIndentedString(Object o) { * 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 StateEfileStatusDetailApp + * @throws IOException if the JSON Element is invalid with respect to EntryStatusResponse */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!StateEfileStatusDetailApp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in StateEfileStatusDetailApp is not found in the empty JSON string", StateEfileStatusDetailApp.openapiRequiredFields.toString())); + if (!EntryStatusResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EntryStatusResponse is not found in the empty JSON string", EntryStatusResponse.openapiRequiredFields.toString())); } } Set> entries = jsonElement.getAsJsonObject().entrySet(); // check to see if the JSON string contains additional fields for (Map.Entry entry : entries) { - if (!StateEfileStatusDetailApp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StateEfileStatusDetailApp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + if (!EntryStatusResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EntryStatusResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); 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("time") != null && !jsonObj.get("time").isJsonNull()) && !jsonObj.get("time").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `time` to be a primitive type in the JSON string but got `%s`", jsonObj.get("time").toString())); - } - if ((jsonObj.get("jurisdiction") != null && !jsonObj.get("jurisdiction").isJsonNull()) && !jsonObj.get("jurisdiction").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `jurisdiction` to be a primitive type in the JSON string but got `%s`", jsonObj.get("jurisdiction").toString())); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!StateEfileStatusDetailApp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'StateEfileStatusDetailApp' and its subtypes + if (!EntryStatusResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EntryStatusResponse' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(StateEfileStatusDetailApp.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EntryStatusResponse.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, StateEfileStatusDetailApp value) throws IOException { + public void write(JsonWriter out, EntryStatusResponse value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public StateEfileStatusDetailApp read(JsonReader in) throws IOException { + public EntryStatusResponse read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -260,18 +229,18 @@ public StateEfileStatusDetailApp read(JsonReader in) throws IOException { } /** - * Create an instance of StateEfileStatusDetailApp given an JSON string + * Create an instance of EntryStatusResponse given an JSON string * * @param jsonString JSON string - * @return An instance of StateEfileStatusDetailApp - * @throws IOException if the JSON string is invalid with respect to StateEfileStatusDetailApp + * @return An instance of EntryStatusResponse + * @throws IOException if the JSON string is invalid with respect to EntryStatusResponse */ - public static StateEfileStatusDetailApp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, StateEfileStatusDetailApp.class); + public static EntryStatusResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EntryStatusResponse.class); } /** - * Convert an instance of StateEfileStatusDetailApp to an JSON string + * Convert an instance of EntryStatusResponse to an JSON string * * @return JSON string */ diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/Form1042S.java b/src/main/java/Avalara/SDK/model/A1099/V2/Form1042S.java index 26703d9..70e4f1d 100644 --- a/src/main/java/Avalara/SDK/model/A1099/V2/Form1042S.java +++ b/src/main/java/Avalara/SDK/model/A1099/V2/Form1042S.java @@ -32,6 +32,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.Arrays; @@ -63,17 +64,79 @@ import Avalara.SDK.JSON; /** - * Form1042S + * Form 1042-S: Foreign Person's U.S. Source Income Subject to Withholding */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class Form1042S { + /** + * Gets or Sets tinType + */ + @JsonAdapter(TinTypeEnum.Adapter.class) + public enum TinTypeEnum { + EMPTY("Empty"), + + EIN("EIN"), + + SSN("SSN"), + + ITIN("ITIN"), + + ATIN("ATIN"); + + private String value; + + TinTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TinTypeEnum fromValue(String value) { + for (TinTypeEnum b : TinTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TinTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TinTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TinTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TinTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TIN_TYPE = "tinType"; + @SerializedName(SERIALIZED_NAME_TIN_TYPE) + private TinTypeEnum tinType; + public static final String SERIALIZED_NAME_UNIQUE_FORM_ID = "uniqueFormId"; @SerializedName(SERIALIZED_NAME_UNIQUE_FORM_ID) private String uniqueFormId; public static final String SERIALIZED_NAME_RECIPIENT_DATE_OF_BIRTH = "recipientDateOfBirth"; @SerializedName(SERIALIZED_NAME_RECIPIENT_DATE_OF_BIRTH) - private OffsetDateTime recipientDateOfBirth; + private LocalDate recipientDateOfBirth; public static final String SERIALIZED_NAME_RECIPIENT_GIIN = "recipientGiin"; @SerializedName(SERIALIZED_NAME_RECIPIENT_GIIN) @@ -83,37 +146,553 @@ public class Form1042S { @SerializedName(SERIALIZED_NAME_RECIPIENT_FOREIGN_TIN) private String recipientForeignTin; + /** + * Limitation on Benefits (LOB) code for tax treaty purposes. Available values: - 01: Individual (Deprecated - valid only for tax years prior to 2019) - 02: Government - contracting state/political subdivision/local authority - 03: Tax exempt pension trust/Pension fund - 04: Tax exempt/Charitable organization - 05: Publicly-traded corporation - 06: Subsidiary of publicly-traded corporation - 07: Company that meets the ownership and base erosion test - 08: Company that meets the derivative benefits test - 09: Company with an item of income that meets the active trade or business test - 10: Discretionary determination - 11: Other - 12: No LOB article in treaty + */ + @JsonAdapter(LobCodeEnum.Adapter.class) + public enum LobCodeEnum { + _01("01"), + + _02("02"), + + _03("03"), + + _04("04"), + + _05("05"), + + _06("06"), + + _07("07"), + + _08("08"), + + _09("09"), + + _10("10"), + + _11("11"), + + _12("12"); + + private String value; + + LobCodeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static LobCodeEnum fromValue(String value) { + for (LobCodeEnum b : LobCodeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final LobCodeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public LobCodeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return LobCodeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + LobCodeEnum.fromValue(value); + } + } + public static final String SERIALIZED_NAME_LOB_CODE = "lobCode"; @SerializedName(SERIALIZED_NAME_LOB_CODE) - private String lobCode; + private LobCodeEnum lobCode; + + /** + * Income code. Available values: Interest: - 01: Interest paid by US obligors - general - 02: Interest paid on real property mortgages - 03: Interest paid to controlling foreign corporations - 04: Interest paid by foreign corporations - 05: Interest on tax-free covenant bonds - 22: Interest paid on deposit with a foreign branch of a domestic corporation or partnership - 29: Deposit interest - 30: Original issue discount (OID) - 31: Short-term OID - 33: Substitute payment - interest - 51: Interest paid on certain actively traded or publicly offered securities(1) - 54: Substitute payments - interest from certain actively traded or publicly offered securities(1) Dividend: - 06: Dividends paid by U.S. corporations - general - 07: Dividends qualifying for direct dividend rate - 08: Dividends paid by foreign corporations - 34: Substitute payment - dividends - 40: Other dividend equivalents under IRC section 871(m) (formerly 871(l)) - 52: Dividends paid on certain actively traded or publicly offered securities(1) - 53: Substitute payments - dividends from certain actively traded or publicly offered securities(1) - 56: Dividend equivalents under IRC section 871(m) as a result of applying the combined transaction rules Other: - 09: Capital gains - 10: Industrial royalties - 11: Motion picture or television copyright royalties - 12: Other royalties (for example, copyright, software, broadcasting, endorsement payments) - 13: Royalties paid on certain publicly offered securities(1) - 14: Real property income and natural resources royalties - 15: Pensions, annuities, alimony, and/or insurance premiums - 16: Scholarship or fellowship grants - 17: Compensation for independent personal services(2) - 18: Compensation for dependent personal services(2) - 19: Compensation for teaching(2) - 20: Compensation during studying and training(2) - 23: Other income - 24: Qualified investment entity (QIE) distributions of capital gains - 25: Trust distributions subject to IRC section 1445 - 26: Unsevered growing crops and timber distributions by a trust subject to IRC section 1445 - 27: Publicly traded partnership distributions subject to IRC section 1446 - 28: Gambling winnings(3) - 32: Notional principal contract income(4) - 35: Substitute payment - other - 36: Capital gains distributions - 37: Return of capital - 38: Eligible deferred compensation items subject to IRC section 877A(d)(1) - 39: Distributions from a nongrantor trust subject to IRC section 877A(f)(1) - 41: Guarantee of indebtedness - 42: Earnings as an artist or athlete - no central withholding agreement(5) - 43: Earnings as an artist or athlete - central withholding agreement(5) - 44: Specified Federal procurement payments - 50: Income previously reported under escrow procedure(6) - 55: Taxable death benefits on life insurance contracts - 57: Amount realized under IRC section 1446(f) - 58: Publicly traded partnership distributions-undetermined + */ + @JsonAdapter(IncomeCodeEnum.Adapter.class) + public enum IncomeCodeEnum { + _01("01"), + + _02("02"), + + _03("03"), + + _04("04"), + + _05("05"), + + _22("22"), + + _29("29"), + + _30("30"), + + _31("31"), + + _33("33"), + + _51("51"), + + _54("54"), + + _06("06"), + + _07("07"), + + _08("08"), + + _34("34"), + + _40("40"), + + _52("52"), + + _53("53"), + + _56("56"), + + _09("09"), + + _10("10"), + + _11("11"), + + _12("12"), + + _13("13"), + + _14("14"), + + _15("15"), + + _16("16"), + + _17("17"), + + _18("18"), + + _19("19"), + + _20("20"), + + _23("23"), + + _24("24"), + + _25("25"), + + _26("26"), + + _27("27"), + + _28("28"), + + _32("32"), + + _35("35"), + + _36("36"), + + _37("37"), + + _38("38"), + + _39("39"), + + _41("41"), + + _42("42"), + + _43("43"), + + _44("44"), + + _50("50"), + + _55("55"), + + _57("57"), + + _58("58"); + + private String value; + + IncomeCodeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static IncomeCodeEnum fromValue(String value) { + for (IncomeCodeEnum b : IncomeCodeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final IncomeCodeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public IncomeCodeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return IncomeCodeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + IncomeCodeEnum.fromValue(value); + } + } public static final String SERIALIZED_NAME_INCOME_CODE = "incomeCode"; @SerializedName(SERIALIZED_NAME_INCOME_CODE) - private String incomeCode; + private IncomeCodeEnum incomeCode; public static final String SERIALIZED_NAME_GROSS_INCOME = "grossIncome"; @SerializedName(SERIALIZED_NAME_GROSS_INCOME) private Double grossIncome; + /** + * Withholding indicator Available values: - 3: Chapter 3 - 4: Chapter 4 + */ + @JsonAdapter(WithholdingIndicatorEnum.Adapter.class) + public enum WithholdingIndicatorEnum { + _3("3"), + + _4("4"); + + private String value; + + WithholdingIndicatorEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static WithholdingIndicatorEnum fromValue(String value) { + for (WithholdingIndicatorEnum b : WithholdingIndicatorEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final WithholdingIndicatorEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public WithholdingIndicatorEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return WithholdingIndicatorEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + WithholdingIndicatorEnum.fromValue(value); + } + } + public static final String SERIALIZED_NAME_WITHHOLDING_INDICATOR = "withholdingIndicator"; @SerializedName(SERIALIZED_NAME_WITHHOLDING_INDICATOR) - private String withholdingIndicator; + private WithholdingIndicatorEnum withholdingIndicator; public static final String SERIALIZED_NAME_TAX_COUNTRY_CODE = "taxCountryCode"; @SerializedName(SERIALIZED_NAME_TAX_COUNTRY_CODE) private String taxCountryCode; + /** + * Exemption code (Chapter 3). Required if WithholdingIndicator is 3 (Chapter 3). Required when using TaxRateChap3. Available values: - Empty: Tax rate is due to backup withholding - 00: Not exempt - 01: Effectively connected income - 02: Exempt under IRC (other than portfolio interest) - 03: Income is not from US sources - 04: Exempt under tax treaty - 05: Portfolio interest exempt under IRC - 06: QI that assumes primary withholding responsibility - 07: WFP or WFT - 08: U.S. branch treated as U.S. Person - 09: Territory FI treated as U.S. Person - 10: QI represents that income is exempt - 11: QSL that assumes primary withholding responsibility - 12: Payee subjected to chapter 4 withholding - 22: QDD that assumes primary withholding responsibility - 23: Exempt under section 897(l) - 24: Exempt under section 892 + */ + @JsonAdapter(ExemptionCodeChap3Enum.Adapter.class) + public enum ExemptionCodeChap3Enum { + _00("00"), + + _01("01"), + + _02("02"), + + _03("03"), + + _04("04"), + + _05("05"), + + _06("06"), + + _07("07"), + + _08("08"), + + _09("09"), + + _10("10"), + + _11("11"), + + _12("12"), + + _22("22"), + + _23("23"), + + _24("24"); + + private String value; + + ExemptionCodeChap3Enum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ExemptionCodeChap3Enum fromValue(String value) { + for (ExemptionCodeChap3Enum b : ExemptionCodeChap3Enum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ExemptionCodeChap3Enum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ExemptionCodeChap3Enum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ExemptionCodeChap3Enum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ExemptionCodeChap3Enum.fromValue(value); + } + } + public static final String SERIALIZED_NAME_EXEMPTION_CODE_CHAP3 = "exemptionCodeChap3"; @SerializedName(SERIALIZED_NAME_EXEMPTION_CODE_CHAP3) - private String exemptionCodeChap3; + private ExemptionCodeChap3Enum exemptionCodeChap3; + + /** + * Exemption code (Chapter 4). Required if WithholdingIndicator is 4 (Chapter 4). Available values: - 00: Not exempt - 13: Grandfathered payment - 14: Effectively connected income - 15: Payee not subject to chapter 4 withholding - 16: Excluded nonfinancial payment - 17: Foreign Entity that assumes primary withholding responsibility - 18: U.S. Payees - of participating FFI or registered deemed - compliant FFI - 19: Exempt from withholding under IGA(6) - 20: Dormant account(7) - 21: Other - payment not subject to chapter 4 withholding + */ + @JsonAdapter(ExemptionCodeChap4Enum.Adapter.class) + public enum ExemptionCodeChap4Enum { + _00("00"), + + _13("13"), + + _14("14"), + + _15("15"), + + _16("16"), + + _17("17"), + + _18("18"), + + _19("19"), + + _20("20"), + + _21("21"); + + private String value; + + ExemptionCodeChap4Enum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ExemptionCodeChap4Enum fromValue(String value) { + for (ExemptionCodeChap4Enum b : ExemptionCodeChap4Enum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ExemptionCodeChap4Enum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ExemptionCodeChap4Enum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ExemptionCodeChap4Enum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ExemptionCodeChap4Enum.fromValue(value); + } + } public static final String SERIALIZED_NAME_EXEMPTION_CODE_CHAP4 = "exemptionCodeChap4"; @SerializedName(SERIALIZED_NAME_EXEMPTION_CODE_CHAP4) - private String exemptionCodeChap4; + private ExemptionCodeChap4Enum exemptionCodeChap4; + + /** + * Tax rate (Chapter 3) - Required if WithholdingIndicator is 3 (Chapter 3). Available values: - 00.00: 0.00% - 02.00: 2.00% - 04.00: 4.00% - 04.90: 4.90% - 04.95: 4.95% - 05.00: 5.00% - 07.00: 7.00% - 08.00: 8.00% - 10.00: 10.00% - 12.00: 12.00% - 12.50: 12.50% - 14.00: 14.00% - 15.00: 15.00% - 17.50: 17.50% - 20.00: 20.00% - 21.00: 21.00% - 24.00: 24.00% - 25.00: 25.00% - 27.50: 27.50% - 28.00: 28.00% - 30.00: 30.00% - 37.00: 37.00% + */ + @JsonAdapter(TaxRateChap3Enum.Adapter.class) + public enum TaxRateChap3Enum { + _00_00("00.00"), + + _02_00("02.00"), + + _04_00("04.00"), + + _04_90("04.90"), + + _04_95("04.95"), + + _05_00("05.00"), + + _07_00("07.00"), + + _08_00("08.00"), + + _10_00("10.00"), + + _12_00("12.00"), + + _12_50("12.50"), + + _14_00("14.00"), + + _15_00("15.00"), + + _17_50("17.50"), + + _20_00("20.00"), + + _21_00("21.00"), + + _24_00("24.00"), + + _25_00("25.00"), + + _27_50("27.50"), + + _28_00("28.00"), + + _30_00("30.00"), + + _37_00("37.00"); + + private String value; + + TaxRateChap3Enum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TaxRateChap3Enum fromValue(String value) { + for (TaxRateChap3Enum b : TaxRateChap3Enum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TaxRateChap3Enum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TaxRateChap3Enum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TaxRateChap3Enum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TaxRateChap3Enum.fromValue(value); + } + } public static final String SERIALIZED_NAME_TAX_RATE_CHAP3 = "taxRateChap3"; @SerializedName(SERIALIZED_NAME_TAX_RATE_CHAP3) - private String taxRateChap3; + private TaxRateChap3Enum taxRateChap3; public static final String SERIALIZED_NAME_WITHHOLDING_ALLOWANCE = "withholdingAllowance"; @SerializedName(SERIALIZED_NAME_WITHHOLDING_ALLOWANCE) @@ -143,13 +722,285 @@ public class Form1042S { @SerializedName(SERIALIZED_NAME_TAX_PAID_AGENT) private Double taxPaidAgent; + /** + * Chapter 3 status code - Required if WithholdingIndicator is 3 (Chapter 3) Available values: - 01: U.S. Withholding Agent - FI (Deprecated - valid only for tax years prior to 2020) - 02: U.S. Withholding Agent - Other (Deprecated - valid only for tax years prior to 2020) - 03: Territory FI - treated as U.S. Person - 04: Territory FI - not treated as U.S. Person - 05: U.S. branch - treated as U.S. Person - 06: U.S. branch - not treated as U.S. Person - 07: U.S. branch - ECI presumption applied - 08: Partnership other than Withholding Foreign Partnership - 09: Withholding Foreign Partnership - 10: Trust other than Withholding Foreign Trust - 11: Withholding Foreign Trust - 12: Qualified Intermediary - 13: Qualified Securities Lender - Qualified Intermediary - 14: Qualified Securities Lender - Other - 15: Corporation - 16: Individual - 17: Estate - 18: Private Foundation - 19: Government or International Organization - 20: Tax Exempt Organization (Section 501(c) entities) - 21: Unknown Recipient - 22: Artist or Athlete - 23: Pension - 24: Foreign Central Bank of Issue - 25: Nonqualified Intermediary - 26: Hybrid entity making Treaty Claim - 27: Withholding Rate Pool - General - 28: Withholding Rate Pool - Exempt Organization - 29: PAI Withholding Rate Pool - General - 30: PAI Withholding Rate Pool - Exempt Organization - 31: Agency Withholding Rate Pool - General - 32: Agency Withholding Rate Pool - Exempt Organization - 34: U.S. Withholding Agent-Foreign branch of FI (Deprecated - valid only for tax years prior to 2020) - 35: Qualified Derivatives Dealer - 36: Foreign Government - Integral Part - 37: Foreign Government - Controlled Entity - 38: Publicly Traded Partnership - 39: Disclosing Qualified Intermediary + */ + @JsonAdapter(Chap3StatusCodeEnum.Adapter.class) + public enum Chap3StatusCodeEnum { + _01("01"), + + _02("02"), + + _34("34"), + + _03("03"), + + _04("04"), + + _05("05"), + + _06("06"), + + _07("07"), + + _08("08"), + + _09("09"), + + _10("10"), + + _11("11"), + + _12("12"), + + _13("13"), + + _14("14"), + + _15("15"), + + _16("16"), + + _17("17"), + + _18("18"), + + _19("19"), + + _20("20"), + + _21("21"), + + _22("22"), + + _23("23"), + + _24("24"), + + _25("25"), + + _26("26"), + + _27("27"), + + _28("28"), + + _29("29"), + + _30("30"), + + _31("31"), + + _32("32"), + + _35("35"), + + _36("36"), + + _37("37"), + + _38("38"), + + _39("39"); + + private String value; + + Chap3StatusCodeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static Chap3StatusCodeEnum fromValue(String value) { + for (Chap3StatusCodeEnum b : Chap3StatusCodeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final Chap3StatusCodeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public Chap3StatusCodeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return Chap3StatusCodeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + Chap3StatusCodeEnum.fromValue(value); + } + } + public static final String SERIALIZED_NAME_CHAP3_STATUS_CODE = "chap3StatusCode"; @SerializedName(SERIALIZED_NAME_CHAP3_STATUS_CODE) - private String chap3StatusCode; + private Chap3StatusCodeEnum chap3StatusCode; + + /** + * Chapter 4 status code. Required if WithholdingIndicator is 4 (Chapter 4). Required if email is specified, must fill either this or RecipientForeignTin. Available values: - 01: U.S. Withholding Agent - FI - 02: U.S. Withholding Agent - Other - 03: Territory FI - not treated as U.S. Person - 04: Territory FI - treated as U.S. Person - 05: Participating FFI - Other - 06: Participating FFI - Reporting Model 2 FFI - 07: Registered Deemed - Compliant FFI-Reporting Model 1 FFI - 08: Registered Deemed - Compliant FFI-Sponsored Entity - 09: Registered Deemed - Compliant FFI-Other - 10: Certified Deemed - Compliant FFI-Other - 11: Certified Deemed - Compliant FFI-FFI with Low Value Accounts - 12: Certified Deemed - Compliant FFI-Non-Registering Local Bank - 13: Certified Deemed - Compliant FFI-Sponsored Entity - 14: Certified Deemed - Compliant FFI-Investment Advisor or Investment Manager - 15: Nonparticipating FFI - 16: Owner-Documented FFI - 17: U.S. Branch - treated as U.S. person - 18: U.S. Branch - not treated as U.S. person (reporting under section 1471) - 19: Passive NFFE identifying Substantial U.S. Owners - 20: Passive NFFE with no Substantial U.S. Owners - 21: Publicly Traded NFFE or Affiliate of Publicly Traded NFFE - 22: Active NFFE - 23: Individual - 24: Section 501(c) Entities - 25: Excepted Territory NFFE - 26: Excepted NFFE - Other - 27: Exempt Beneficial Owner - 28: Entity Wholly Owned by Exempt Beneficial Owners - 29: Unknown Recipient - 30: Recalcitrant Account Holder - 31: Nonreporting IGA FFI - 32: Direct reporting NFFE - 33: U.S. reportable account - 34: Non-consenting U.S. account - 35: Sponsored direct reporting NFFE - 36: Excepted Inter-affiliate FFI - 37: Undocumented Preexisting Obligation - 38: U.S. Branch - ECI presumption applied - 39: Account Holder of Excluded Financial Account - 40: Passive NFFE reported by FFI - 41: NFFE subject to 1472 withholding - 42: Recalcitrant Pool - No U.S. Indicia - 43: Recalcitrant Pool - U.S. Indicia - 44: Recalcitrant Pool - Dormant Account - 45: Recalcitrant Pool - U.S. Persons - 46: Recalcitrant Pool - Passive NFFEs - 47: Nonparticipating FFI Pool - 48: U.S. Payees Pool - 49: QI - Recalcitrant Pool-General - 50: U.S. Withholding Agent-Foreign branch of FI + */ + @JsonAdapter(Chap4StatusCodeEnum.Adapter.class) + public enum Chap4StatusCodeEnum { + _01("01"), + + _02("02"), + + _03("03"), + + _04("04"), + + _05("05"), + + _06("06"), + + _07("07"), + + _08("08"), + + _09("09"), + + _10("10"), + + _11("11"), + + _12("12"), + + _13("13"), + + _14("14"), + + _15("15"), + + _16("16"), + + _17("17"), + + _18("18"), + + _19("19"), + + _20("20"), + + _21("21"), + + _22("22"), + + _23("23"), + + _24("24"), + + _25("25"), + + _26("26"), + + _27("27"), + + _28("28"), + + _29("29"), + + _30("30"), + + _31("31"), + + _32("32"), + + _33("33"), + + _34("34"), + + _35("35"), + + _36("36"), + + _37("37"), + + _38("38"), + + _39("39"), + + _40("40"), + + _41("41"), + + _42("42"), + + _43("43"), + + _44("44"), + + _45("45"), + + _46("46"), + + _47("47"), + + _48("48"), + + _49("49"), + + _50("50"); + + private String value; + + Chap4StatusCodeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static Chap4StatusCodeEnum fromValue(String value) { + for (Chap4StatusCodeEnum b : Chap4StatusCodeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final Chap4StatusCodeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public Chap4StatusCodeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return Chap4StatusCodeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + Chap4StatusCodeEnum.fromValue(value); + } + } public static final String SERIALIZED_NAME_CHAP4_STATUS_CODE = "chap4StatusCode"; @SerializedName(SERIALIZED_NAME_CHAP4_STATUS_CODE) - private String chap4StatusCode; + private Chap4StatusCodeEnum chap4StatusCode; public static final String SERIALIZED_NAME_PRIMARY_WITHHOLDING_AGENT = "primaryWithholdingAgent"; @SerializedName(SERIALIZED_NAME_PRIMARY_WITHHOLDING_AGENT) @@ -159,17 +1010,83 @@ public class Form1042S { @SerializedName(SERIALIZED_NAME_INTERMEDIARY_OR_FLOW_THROUGH) private IntermediaryOrFlowThrough intermediaryOrFlowThrough; - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; + /** + * Form type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + _1099_NEC("1099-NEC"), + + _1099_MISC("1099-MISC"), + + _1099_DIV("1099-DIV"), + + _1099_R("1099-R"), + + _1099_K("1099-K"), + + _1095_B("1095-B"), + + _1042_S("1042-S"), + + _1095_C("1095-C"), + + _1099_INT("1099-INT"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.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 TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) - private String type; + private TypeEnum type; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; public static final String SERIALIZED_NAME_ISSUER_ID = "issuerId"; @SerializedName(SERIALIZED_NAME_ISSUER_ID) - private Integer issuerId; + private String issuerId; public static final String SERIALIZED_NAME_ISSUER_REFERENCE_ID = "issuerReferenceId"; @SerializedName(SERIALIZED_NAME_ISSUER_REFERENCE_ID) @@ -183,78 +1100,14 @@ public class Form1042S { @SerializedName(SERIALIZED_NAME_TAX_YEAR) private Integer taxYear; - public static final String SERIALIZED_NAME_FEDERAL_EFILE = "federalEfile"; - @SerializedName(SERIALIZED_NAME_FEDERAL_EFILE) - private Boolean federalEfile; - - public static final String SERIALIZED_NAME_FEDERAL_EFILE_STATUS = "federalEfileStatus"; - @SerializedName(SERIALIZED_NAME_FEDERAL_EFILE_STATUS) - private Form1099StatusDetail federalEfileStatus; - - public static final String SERIALIZED_NAME_STATE_EFILE = "stateEfile"; - @SerializedName(SERIALIZED_NAME_STATE_EFILE) - private Boolean stateEfile; - - public static final String SERIALIZED_NAME_STATE_EFILE_STATUS = "stateEfileStatus"; - @SerializedName(SERIALIZED_NAME_STATE_EFILE_STATUS) - private List stateEfileStatus; - - public static final String SERIALIZED_NAME_POSTAL_MAIL = "postalMail"; - @SerializedName(SERIALIZED_NAME_POSTAL_MAIL) - private Boolean postalMail; - - public static final String SERIALIZED_NAME_POSTAL_MAIL_STATUS = "postalMailStatus"; - @SerializedName(SERIALIZED_NAME_POSTAL_MAIL_STATUS) - private Form1099StatusDetail postalMailStatus; - - public static final String SERIALIZED_NAME_TIN_MATCH = "tinMatch"; - @SerializedName(SERIALIZED_NAME_TIN_MATCH) - private Boolean tinMatch; - - public static final String SERIALIZED_NAME_TIN_MATCH_STATUS = "tinMatchStatus"; - @SerializedName(SERIALIZED_NAME_TIN_MATCH_STATUS) - private Form1099StatusDetail tinMatchStatus; - - public static final String SERIALIZED_NAME_ADDRESS_VERIFICATION = "addressVerification"; - @SerializedName(SERIALIZED_NAME_ADDRESS_VERIFICATION) - private Boolean addressVerification; - - public static final String SERIALIZED_NAME_ADDRESS_VERIFICATION_STATUS = "addressVerificationStatus"; - @SerializedName(SERIALIZED_NAME_ADDRESS_VERIFICATION_STATUS) - private Form1099StatusDetail addressVerificationStatus; - - public static final String SERIALIZED_NAME_E_DELIVERY_STATUS = "eDeliveryStatus"; - @SerializedName(SERIALIZED_NAME_E_DELIVERY_STATUS) - private Form1099StatusDetail eDeliveryStatus; - public static final String SERIALIZED_NAME_REFERENCE_ID = "referenceId"; @SerializedName(SERIALIZED_NAME_REFERENCE_ID) private String referenceId; - public static final String SERIALIZED_NAME_EMAIL = "email"; - @SerializedName(SERIALIZED_NAME_EMAIL) - private String email; - - public static final String SERIALIZED_NAME_TIN_TYPE = "tinType"; - @SerializedName(SERIALIZED_NAME_TIN_TYPE) - private String tinType; - - public static final String SERIALIZED_NAME_FATCA_FILING_REQUIREMENT = "fatcaFilingRequirement"; - @SerializedName(SERIALIZED_NAME_FATCA_FILING_REQUIREMENT) - private Boolean fatcaFilingRequirement; - public static final String SERIALIZED_NAME_TIN = "tin"; @SerializedName(SERIALIZED_NAME_TIN) private String tin; - public static final String SERIALIZED_NAME_NO_TIN = "noTin"; - @SerializedName(SERIALIZED_NAME_NO_TIN) - private Boolean noTin; - - public static final String SERIALIZED_NAME_SECOND_TIN_NOTICE = "secondTinNotice"; - @SerializedName(SERIALIZED_NAME_SECOND_TIN_NOTICE) - private Boolean secondTinNotice; - public static final String SERIALIZED_NAME_RECIPIENT_NAME = "recipientName"; @SerializedName(SERIALIZED_NAME_RECIPIENT_NAME) private String recipientName; @@ -283,6 +1136,18 @@ public class Form1042S { @SerializedName(SERIALIZED_NAME_ZIP) private String zip; + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) + private String accountNumber; + + public static final String SERIALIZED_NAME_OFFICE_CODE = "officeCode"; + @SerializedName(SERIALIZED_NAME_OFFICE_CODE) + private String officeCode; + public static final String SERIALIZED_NAME_NON_US_PROVINCE = "nonUsProvince"; @SerializedName(SERIALIZED_NAME_NON_US_PROVINCE) private String nonUsProvince; @@ -291,13 +1156,65 @@ public class Form1042S { @SerializedName(SERIALIZED_NAME_COUNTRY_CODE) private String countryCode; - public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; - @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) - private String accountNumber; + public static final String SERIALIZED_NAME_FEDERAL_EFILE_DATE = "federalEfileDate"; + @SerializedName(SERIALIZED_NAME_FEDERAL_EFILE_DATE) + private LocalDate federalEfileDate; - public static final String SERIALIZED_NAME_OFFICE_CODE = "officeCode"; - @SerializedName(SERIALIZED_NAME_OFFICE_CODE) - private String officeCode; + public static final String SERIALIZED_NAME_POSTAL_MAIL = "postalMail"; + @SerializedName(SERIALIZED_NAME_POSTAL_MAIL) + private Boolean postalMail; + + public static final String SERIALIZED_NAME_STATE_EFILE_DATE = "stateEfileDate"; + @SerializedName(SERIALIZED_NAME_STATE_EFILE_DATE) + private LocalDate stateEfileDate; + + public static final String SERIALIZED_NAME_RECIPIENT_EDELIVERY_DATE = "recipientEdeliveryDate"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_EDELIVERY_DATE) + private LocalDate recipientEdeliveryDate; + + public static final String SERIALIZED_NAME_TIN_MATCH = "tinMatch"; + @SerializedName(SERIALIZED_NAME_TIN_MATCH) + private Boolean tinMatch; + + public static final String SERIALIZED_NAME_NO_TIN = "noTin"; + @SerializedName(SERIALIZED_NAME_NO_TIN) + private Boolean noTin; + + public static final String SERIALIZED_NAME_ADDRESS_VERIFICATION = "addressVerification"; + @SerializedName(SERIALIZED_NAME_ADDRESS_VERIFICATION) + private Boolean addressVerification; + + public static final String SERIALIZED_NAME_STATE_AND_LOCAL_WITHHOLDING = "stateAndLocalWithholding"; + @SerializedName(SERIALIZED_NAME_STATE_AND_LOCAL_WITHHOLDING) + private StateAndLocalWithholding stateAndLocalWithholding; + + public static final String SERIALIZED_NAME_SECOND_TIN_NOTICE = "secondTinNotice"; + @SerializedName(SERIALIZED_NAME_SECOND_TIN_NOTICE) + private Boolean secondTinNotice; + + public static final String SERIALIZED_NAME_FEDERAL_EFILE_STATUS = "federalEfileStatus"; + @SerializedName(SERIALIZED_NAME_FEDERAL_EFILE_STATUS) + private Form1099StatusDetail federalEfileStatus; + + public static final String SERIALIZED_NAME_STATE_EFILE_STATUS = "stateEfileStatus"; + @SerializedName(SERIALIZED_NAME_STATE_EFILE_STATUS) + private List stateEfileStatus; + + public static final String SERIALIZED_NAME_POSTAL_MAIL_STATUS = "postalMailStatus"; + @SerializedName(SERIALIZED_NAME_POSTAL_MAIL_STATUS) + private Form1099StatusDetail postalMailStatus; + + public static final String SERIALIZED_NAME_TIN_MATCH_STATUS = "tinMatchStatus"; + @SerializedName(SERIALIZED_NAME_TIN_MATCH_STATUS) + private Form1099StatusDetail tinMatchStatus; + + public static final String SERIALIZED_NAME_ADDRESS_VERIFICATION_STATUS = "addressVerificationStatus"; + @SerializedName(SERIALIZED_NAME_ADDRESS_VERIFICATION_STATUS) + private Form1099StatusDetail addressVerificationStatus; + + public static final String SERIALIZED_NAME_E_DELIVERY_STATUS = "eDeliveryStatus"; + @SerializedName(SERIALIZED_NAME_E_DELIVERY_STATUS) + private Form1099StatusDetail eDeliveryStatus; public static final String SERIALIZED_NAME_VALIDATION_ERRORS = "validationErrors"; @SerializedName(SERIALIZED_NAME_VALIDATION_ERRORS) @@ -311,20 +1228,54 @@ public class Form1042S { @SerializedName(SERIALIZED_NAME_UPDATED_AT) private OffsetDateTime updatedAt; - public static final String SERIALIZED_NAME_STATE_AND_LOCAL_WITHHOLDING = "stateAndLocalWithholding"; - @SerializedName(SERIALIZED_NAME_STATE_AND_LOCAL_WITHHOLDING) - private StateAndLocalWithholding stateAndLocalWithholding; - public Form1042S() { } + public Form1042S( + TinTypeEnum tinType, + String id, + Form1099StatusDetail federalEfileStatus, + List stateEfileStatus, + Form1099StatusDetail postalMailStatus, + Form1099StatusDetail tinMatchStatus, + Form1099StatusDetail addressVerificationStatus, + Form1099StatusDetail eDeliveryStatus, + List validationErrors, + OffsetDateTime createdAt, + OffsetDateTime updatedAt + ) { + this(); + this.tinType = tinType; + this.id = id; + this.federalEfileStatus = federalEfileStatus; + this.stateEfileStatus = stateEfileStatus; + this.postalMailStatus = postalMailStatus; + this.tinMatchStatus = tinMatchStatus; + this.addressVerificationStatus = addressVerificationStatus; + this.eDeliveryStatus = eDeliveryStatus; + this.validationErrors = validationErrors; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + + /** + * Get tinType + * @return tinType + */ + @javax.annotation.Nullable + public TinTypeEnum getTinType() { + return tinType; + } + + + public Form1042S uniqueFormId(String uniqueFormId) { this.uniqueFormId = uniqueFormId; return this; } /** - * Get uniqueFormId + * Unique form identifier * @return uniqueFormId */ @javax.annotation.Nullable @@ -337,21 +1288,21 @@ public void setUniqueFormId(String uniqueFormId) { } - public Form1042S recipientDateOfBirth(OffsetDateTime recipientDateOfBirth) { + public Form1042S recipientDateOfBirth(LocalDate recipientDateOfBirth) { this.recipientDateOfBirth = recipientDateOfBirth; return this; } /** - * Get recipientDateOfBirth + * Recipient's date of birth * @return recipientDateOfBirth */ @javax.annotation.Nullable - public OffsetDateTime getRecipientDateOfBirth() { + public LocalDate getRecipientDateOfBirth() { return recipientDateOfBirth; } - public void setRecipientDateOfBirth(OffsetDateTime recipientDateOfBirth) { + public void setRecipientDateOfBirth(LocalDate recipientDateOfBirth) { this.recipientDateOfBirth = recipientDateOfBirth; } @@ -362,7 +1313,7 @@ public Form1042S recipientGiin(String recipientGiin) { } /** - * Get recipientGiin + * Recipient's Global Intermediary Identification Number (GIIN). A valid GIIN looks like 'XXXXXX.XXXXX.XX.XXX'. * @return recipientGiin */ @javax.annotation.Nullable @@ -381,7 +1332,7 @@ public Form1042S recipientForeignTin(String recipientForeignTin) { } /** - * Get recipientForeignTin + * Recipient's foreign TIN. Required if email is specified, must fill either this or Chap3StatusCode. * @return recipientForeignTin */ @javax.annotation.Nullable @@ -394,40 +1345,40 @@ public void setRecipientForeignTin(String recipientForeignTin) { } - public Form1042S lobCode(String lobCode) { + public Form1042S lobCode(LobCodeEnum lobCode) { this.lobCode = lobCode; return this; } /** - * Get lobCode + * Limitation on Benefits (LOB) code for tax treaty purposes. Available values: - 01: Individual (Deprecated - valid only for tax years prior to 2019) - 02: Government - contracting state/political subdivision/local authority - 03: Tax exempt pension trust/Pension fund - 04: Tax exempt/Charitable organization - 05: Publicly-traded corporation - 06: Subsidiary of publicly-traded corporation - 07: Company that meets the ownership and base erosion test - 08: Company that meets the derivative benefits test - 09: Company with an item of income that meets the active trade or business test - 10: Discretionary determination - 11: Other - 12: No LOB article in treaty * @return lobCode */ @javax.annotation.Nullable - public String getLobCode() { + public LobCodeEnum getLobCode() { return lobCode; } - public void setLobCode(String lobCode) { + public void setLobCode(LobCodeEnum lobCode) { this.lobCode = lobCode; } - public Form1042S incomeCode(String incomeCode) { + public Form1042S incomeCode(IncomeCodeEnum incomeCode) { this.incomeCode = incomeCode; return this; } /** - * Get incomeCode + * Income code. Available values: Interest: - 01: Interest paid by US obligors - general - 02: Interest paid on real property mortgages - 03: Interest paid to controlling foreign corporations - 04: Interest paid by foreign corporations - 05: Interest on tax-free covenant bonds - 22: Interest paid on deposit with a foreign branch of a domestic corporation or partnership - 29: Deposit interest - 30: Original issue discount (OID) - 31: Short-term OID - 33: Substitute payment - interest - 51: Interest paid on certain actively traded or publicly offered securities(1) - 54: Substitute payments - interest from certain actively traded or publicly offered securities(1) Dividend: - 06: Dividends paid by U.S. corporations - general - 07: Dividends qualifying for direct dividend rate - 08: Dividends paid by foreign corporations - 34: Substitute payment - dividends - 40: Other dividend equivalents under IRC section 871(m) (formerly 871(l)) - 52: Dividends paid on certain actively traded or publicly offered securities(1) - 53: Substitute payments - dividends from certain actively traded or publicly offered securities(1) - 56: Dividend equivalents under IRC section 871(m) as a result of applying the combined transaction rules Other: - 09: Capital gains - 10: Industrial royalties - 11: Motion picture or television copyright royalties - 12: Other royalties (for example, copyright, software, broadcasting, endorsement payments) - 13: Royalties paid on certain publicly offered securities(1) - 14: Real property income and natural resources royalties - 15: Pensions, annuities, alimony, and/or insurance premiums - 16: Scholarship or fellowship grants - 17: Compensation for independent personal services(2) - 18: Compensation for dependent personal services(2) - 19: Compensation for teaching(2) - 20: Compensation during studying and training(2) - 23: Other income - 24: Qualified investment entity (QIE) distributions of capital gains - 25: Trust distributions subject to IRC section 1445 - 26: Unsevered growing crops and timber distributions by a trust subject to IRC section 1445 - 27: Publicly traded partnership distributions subject to IRC section 1446 - 28: Gambling winnings(3) - 32: Notional principal contract income(4) - 35: Substitute payment - other - 36: Capital gains distributions - 37: Return of capital - 38: Eligible deferred compensation items subject to IRC section 877A(d)(1) - 39: Distributions from a nongrantor trust subject to IRC section 877A(f)(1) - 41: Guarantee of indebtedness - 42: Earnings as an artist or athlete - no central withholding agreement(5) - 43: Earnings as an artist or athlete - central withholding agreement(5) - 44: Specified Federal procurement payments - 50: Income previously reported under escrow procedure(6) - 55: Taxable death benefits on life insurance contracts - 57: Amount realized under IRC section 1446(f) - 58: Publicly traded partnership distributions-undetermined * @return incomeCode */ @javax.annotation.Nullable - public String getIncomeCode() { + public IncomeCodeEnum getIncomeCode() { return incomeCode; } - public void setIncomeCode(String incomeCode) { + public void setIncomeCode(IncomeCodeEnum incomeCode) { this.incomeCode = incomeCode; } @@ -438,7 +1389,7 @@ public Form1042S grossIncome(Double grossIncome) { } /** - * Get grossIncome + * Gross income * @return grossIncome */ @javax.annotation.Nullable @@ -451,21 +1402,21 @@ public void setGrossIncome(Double grossIncome) { } - public Form1042S withholdingIndicator(String withholdingIndicator) { + public Form1042S withholdingIndicator(WithholdingIndicatorEnum withholdingIndicator) { this.withholdingIndicator = withholdingIndicator; return this; } /** - * Get withholdingIndicator + * Withholding indicator Available values: - 3: Chapter 3 - 4: Chapter 4 * @return withholdingIndicator */ @javax.annotation.Nullable - public String getWithholdingIndicator() { + public WithholdingIndicatorEnum getWithholdingIndicator() { return withholdingIndicator; } - public void setWithholdingIndicator(String withholdingIndicator) { + public void setWithholdingIndicator(WithholdingIndicatorEnum withholdingIndicator) { this.withholdingIndicator = withholdingIndicator; } @@ -476,7 +1427,7 @@ public Form1042S taxCountryCode(String taxCountryCode) { } /** - * Get taxCountryCode + * Country code * @return taxCountryCode */ @javax.annotation.Nullable @@ -489,59 +1440,59 @@ public void setTaxCountryCode(String taxCountryCode) { } - public Form1042S exemptionCodeChap3(String exemptionCodeChap3) { + public Form1042S exemptionCodeChap3(ExemptionCodeChap3Enum exemptionCodeChap3) { this.exemptionCodeChap3 = exemptionCodeChap3; return this; } /** - * Get exemptionCodeChap3 + * Exemption code (Chapter 3). Required if WithholdingIndicator is 3 (Chapter 3). Required when using TaxRateChap3. Available values: - Empty: Tax rate is due to backup withholding - 00: Not exempt - 01: Effectively connected income - 02: Exempt under IRC (other than portfolio interest) - 03: Income is not from US sources - 04: Exempt under tax treaty - 05: Portfolio interest exempt under IRC - 06: QI that assumes primary withholding responsibility - 07: WFP or WFT - 08: U.S. branch treated as U.S. Person - 09: Territory FI treated as U.S. Person - 10: QI represents that income is exempt - 11: QSL that assumes primary withholding responsibility - 12: Payee subjected to chapter 4 withholding - 22: QDD that assumes primary withholding responsibility - 23: Exempt under section 897(l) - 24: Exempt under section 892 * @return exemptionCodeChap3 */ @javax.annotation.Nullable - public String getExemptionCodeChap3() { + public ExemptionCodeChap3Enum getExemptionCodeChap3() { return exemptionCodeChap3; } - public void setExemptionCodeChap3(String exemptionCodeChap3) { + public void setExemptionCodeChap3(ExemptionCodeChap3Enum exemptionCodeChap3) { this.exemptionCodeChap3 = exemptionCodeChap3; } - public Form1042S exemptionCodeChap4(String exemptionCodeChap4) { + public Form1042S exemptionCodeChap4(ExemptionCodeChap4Enum exemptionCodeChap4) { this.exemptionCodeChap4 = exemptionCodeChap4; return this; } /** - * Get exemptionCodeChap4 + * Exemption code (Chapter 4). Required if WithholdingIndicator is 4 (Chapter 4). Available values: - 00: Not exempt - 13: Grandfathered payment - 14: Effectively connected income - 15: Payee not subject to chapter 4 withholding - 16: Excluded nonfinancial payment - 17: Foreign Entity that assumes primary withholding responsibility - 18: U.S. Payees - of participating FFI or registered deemed - compliant FFI - 19: Exempt from withholding under IGA(6) - 20: Dormant account(7) - 21: Other - payment not subject to chapter 4 withholding * @return exemptionCodeChap4 */ @javax.annotation.Nullable - public String getExemptionCodeChap4() { + public ExemptionCodeChap4Enum getExemptionCodeChap4() { return exemptionCodeChap4; } - public void setExemptionCodeChap4(String exemptionCodeChap4) { + public void setExemptionCodeChap4(ExemptionCodeChap4Enum exemptionCodeChap4) { this.exemptionCodeChap4 = exemptionCodeChap4; } - public Form1042S taxRateChap3(String taxRateChap3) { + public Form1042S taxRateChap3(TaxRateChap3Enum taxRateChap3) { this.taxRateChap3 = taxRateChap3; return this; } /** - * Get taxRateChap3 + * Tax rate (Chapter 3) - Required if WithholdingIndicator is 3 (Chapter 3). Available values: - 00.00: 0.00% - 02.00: 2.00% - 04.00: 4.00% - 04.90: 4.90% - 04.95: 4.95% - 05.00: 5.00% - 07.00: 7.00% - 08.00: 8.00% - 10.00: 10.00% - 12.00: 12.00% - 12.50: 12.50% - 14.00: 14.00% - 15.00: 15.00% - 17.50: 17.50% - 20.00: 20.00% - 21.00: 21.00% - 24.00: 24.00% - 25.00: 25.00% - 27.50: 27.50% - 28.00: 28.00% - 30.00: 30.00% - 37.00: 37.00% * @return taxRateChap3 */ @javax.annotation.Nullable - public String getTaxRateChap3() { + public TaxRateChap3Enum getTaxRateChap3() { return taxRateChap3; } - public void setTaxRateChap3(String taxRateChap3) { + public void setTaxRateChap3(TaxRateChap3Enum taxRateChap3) { this.taxRateChap3 = taxRateChap3; } @@ -552,7 +1503,7 @@ public Form1042S withholdingAllowance(Double withholdingAllowance) { } /** - * Get withholdingAllowance + * Withholding allowance * @return withholdingAllowance */ @javax.annotation.Nullable @@ -571,7 +1522,7 @@ public Form1042S federalTaxWithheld(Double federalTaxWithheld) { } /** - * Get federalTaxWithheld + * Federal tax withheld * @return federalTaxWithheld */ @javax.annotation.Nullable @@ -590,7 +1541,7 @@ public Form1042S taxNotDepositedIndicator(Boolean taxNotDepositedIndicator) { } /** - * Get taxNotDepositedIndicator + * Tax not deposited indicator * @return taxNotDepositedIndicator */ @javax.annotation.Nullable @@ -609,7 +1560,7 @@ public Form1042S academicIndicator(Boolean academicIndicator) { } /** - * Get academicIndicator + * Academic indicator * @return academicIndicator */ @javax.annotation.Nullable @@ -628,7 +1579,7 @@ public Form1042S taxWithheldOtherAgents(Double taxWithheldOtherAgents) { } /** - * Get taxWithheldOtherAgents + * Tax withheld by other agents * @return taxWithheldOtherAgents */ @javax.annotation.Nullable @@ -647,7 +1598,7 @@ public Form1042S amountRepaid(Double amountRepaid) { } /** - * Get amountRepaid + * Amount repaid to recipient * @return amountRepaid */ @javax.annotation.Nullable @@ -666,7 +1617,7 @@ public Form1042S taxPaidAgent(Double taxPaidAgent) { } /** - * Get taxPaidAgent + * Tax paid by withholding agent * @return taxPaidAgent */ @javax.annotation.Nullable @@ -679,40 +1630,40 @@ public void setTaxPaidAgent(Double taxPaidAgent) { } - public Form1042S chap3StatusCode(String chap3StatusCode) { + public Form1042S chap3StatusCode(Chap3StatusCodeEnum chap3StatusCode) { this.chap3StatusCode = chap3StatusCode; return this; } /** - * Get chap3StatusCode + * Chapter 3 status code - Required if WithholdingIndicator is 3 (Chapter 3) Available values: - 01: U.S. Withholding Agent - FI (Deprecated - valid only for tax years prior to 2020) - 02: U.S. Withholding Agent - Other (Deprecated - valid only for tax years prior to 2020) - 03: Territory FI - treated as U.S. Person - 04: Territory FI - not treated as U.S. Person - 05: U.S. branch - treated as U.S. Person - 06: U.S. branch - not treated as U.S. Person - 07: U.S. branch - ECI presumption applied - 08: Partnership other than Withholding Foreign Partnership - 09: Withholding Foreign Partnership - 10: Trust other than Withholding Foreign Trust - 11: Withholding Foreign Trust - 12: Qualified Intermediary - 13: Qualified Securities Lender - Qualified Intermediary - 14: Qualified Securities Lender - Other - 15: Corporation - 16: Individual - 17: Estate - 18: Private Foundation - 19: Government or International Organization - 20: Tax Exempt Organization (Section 501(c) entities) - 21: Unknown Recipient - 22: Artist or Athlete - 23: Pension - 24: Foreign Central Bank of Issue - 25: Nonqualified Intermediary - 26: Hybrid entity making Treaty Claim - 27: Withholding Rate Pool - General - 28: Withholding Rate Pool - Exempt Organization - 29: PAI Withholding Rate Pool - General - 30: PAI Withholding Rate Pool - Exempt Organization - 31: Agency Withholding Rate Pool - General - 32: Agency Withholding Rate Pool - Exempt Organization - 34: U.S. Withholding Agent-Foreign branch of FI (Deprecated - valid only for tax years prior to 2020) - 35: Qualified Derivatives Dealer - 36: Foreign Government - Integral Part - 37: Foreign Government - Controlled Entity - 38: Publicly Traded Partnership - 39: Disclosing Qualified Intermediary * @return chap3StatusCode */ @javax.annotation.Nullable - public String getChap3StatusCode() { + public Chap3StatusCodeEnum getChap3StatusCode() { return chap3StatusCode; } - public void setChap3StatusCode(String chap3StatusCode) { + public void setChap3StatusCode(Chap3StatusCodeEnum chap3StatusCode) { this.chap3StatusCode = chap3StatusCode; } - public Form1042S chap4StatusCode(String chap4StatusCode) { + public Form1042S chap4StatusCode(Chap4StatusCodeEnum chap4StatusCode) { this.chap4StatusCode = chap4StatusCode; return this; } /** - * Get chap4StatusCode + * Chapter 4 status code. Required if WithholdingIndicator is 4 (Chapter 4). Required if email is specified, must fill either this or RecipientForeignTin. Available values: - 01: U.S. Withholding Agent - FI - 02: U.S. Withholding Agent - Other - 03: Territory FI - not treated as U.S. Person - 04: Territory FI - treated as U.S. Person - 05: Participating FFI - Other - 06: Participating FFI - Reporting Model 2 FFI - 07: Registered Deemed - Compliant FFI-Reporting Model 1 FFI - 08: Registered Deemed - Compliant FFI-Sponsored Entity - 09: Registered Deemed - Compliant FFI-Other - 10: Certified Deemed - Compliant FFI-Other - 11: Certified Deemed - Compliant FFI-FFI with Low Value Accounts - 12: Certified Deemed - Compliant FFI-Non-Registering Local Bank - 13: Certified Deemed - Compliant FFI-Sponsored Entity - 14: Certified Deemed - Compliant FFI-Investment Advisor or Investment Manager - 15: Nonparticipating FFI - 16: Owner-Documented FFI - 17: U.S. Branch - treated as U.S. person - 18: U.S. Branch - not treated as U.S. person (reporting under section 1471) - 19: Passive NFFE identifying Substantial U.S. Owners - 20: Passive NFFE with no Substantial U.S. Owners - 21: Publicly Traded NFFE or Affiliate of Publicly Traded NFFE - 22: Active NFFE - 23: Individual - 24: Section 501(c) Entities - 25: Excepted Territory NFFE - 26: Excepted NFFE - Other - 27: Exempt Beneficial Owner - 28: Entity Wholly Owned by Exempt Beneficial Owners - 29: Unknown Recipient - 30: Recalcitrant Account Holder - 31: Nonreporting IGA FFI - 32: Direct reporting NFFE - 33: U.S. reportable account - 34: Non-consenting U.S. account - 35: Sponsored direct reporting NFFE - 36: Excepted Inter-affiliate FFI - 37: Undocumented Preexisting Obligation - 38: U.S. Branch - ECI presumption applied - 39: Account Holder of Excluded Financial Account - 40: Passive NFFE reported by FFI - 41: NFFE subject to 1472 withholding - 42: Recalcitrant Pool - No U.S. Indicia - 43: Recalcitrant Pool - U.S. Indicia - 44: Recalcitrant Pool - Dormant Account - 45: Recalcitrant Pool - U.S. Persons - 46: Recalcitrant Pool - Passive NFFEs - 47: Nonparticipating FFI Pool - 48: U.S. Payees Pool - 49: QI - Recalcitrant Pool-General - 50: U.S. Withholding Agent-Foreign branch of FI * @return chap4StatusCode */ @javax.annotation.Nullable - public String getChap4StatusCode() { + public Chap4StatusCodeEnum getChap4StatusCode() { return chap4StatusCode; } - public void setChap4StatusCode(String chap4StatusCode) { + public void setChap4StatusCode(Chap4StatusCodeEnum chap4StatusCode) { this.chap4StatusCode = chap4StatusCode; } @@ -723,7 +1674,7 @@ public Form1042S primaryWithholdingAgent(PrimaryWithholdingAgent primaryWithhold } /** - * Get primaryWithholdingAgent + * Primary withholding agent information * @return primaryWithholdingAgent */ @javax.annotation.Nullable @@ -742,7 +1693,7 @@ public Form1042S intermediaryOrFlowThrough(IntermediaryOrFlowThrough intermediar } /** - * Get intermediaryOrFlowThrough + * Intermediary or flow-through entity information * @return intermediaryOrFlowThrough */ @javax.annotation.Nullable @@ -755,59 +1706,51 @@ public void setIntermediaryOrFlowThrough(IntermediaryOrFlowThrough intermediaryO } - public Form1042S id(String id) { - this.id = id; + public Form1042S type(TypeEnum type) { + this.type = type; return this; } /** - * Get id - * @return id + * Form type + * @return type */ - @javax.annotation.Nullable - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; } - - public Form1042S type(String type) { + public void setType(TypeEnum type) { this.type = type; - return this; } + /** - * Get type - * @return type + * Form ID. Unique identifier set when the record is created. + * @return id */ @javax.annotation.Nullable - public String getType() { - return type; + public String getId() { + return id; } - public void setType(String type) { - this.type = type; - } - public Form1042S issuerId(Integer issuerId) { + public Form1042S issuerId(String issuerId) { this.issuerId = issuerId; return this; } /** - * Get issuerId + * Issuer ID - only required when creating forms * @return issuerId */ @javax.annotation.Nullable - public Integer getIssuerId() { + public String getIssuerId() { return issuerId; } - public void setIssuerId(Integer issuerId) { + public void setIssuerId(String issuerId) { this.issuerId = issuerId; } @@ -818,7 +1761,7 @@ public Form1042S issuerReferenceId(String issuerReferenceId) { } /** - * Get issuerReferenceId + * Issuer Reference ID - only required when creating forms * @return issuerReferenceId */ @javax.annotation.Nullable @@ -837,7 +1780,7 @@ public Form1042S issuerTin(String issuerTin) { } /** - * Get issuerTin + * Issuer TIN - readonly * @return issuerTin */ @javax.annotation.Nullable @@ -856,7 +1799,7 @@ public Form1042S taxYear(Integer taxYear) { } /** - * Get taxYear + * Tax Year - only required when creating forms * @return taxYear */ @javax.annotation.Nullable @@ -869,239 +1812,174 @@ public void setTaxYear(Integer taxYear) { } - public Form1042S federalEfile(Boolean federalEfile) { - this.federalEfile = federalEfile; - return this; - } - - /** - * Get federalEfile - * @return federalEfile - */ - @javax.annotation.Nullable - public Boolean getFederalEfile() { - return federalEfile; - } - - public void setFederalEfile(Boolean federalEfile) { - this.federalEfile = federalEfile; - } - - - public Form1042S federalEfileStatus(Form1099StatusDetail federalEfileStatus) { - this.federalEfileStatus = federalEfileStatus; - return this; - } - - /** - * Get federalEfileStatus - * @return federalEfileStatus - */ - @javax.annotation.Nullable - public Form1099StatusDetail getFederalEfileStatus() { - return federalEfileStatus; - } - - public void setFederalEfileStatus(Form1099StatusDetail federalEfileStatus) { - this.federalEfileStatus = federalEfileStatus; - } - - - public Form1042S stateEfile(Boolean stateEfile) { - this.stateEfile = stateEfile; - return this; - } - - /** - * Get stateEfile - * @return stateEfile - */ - @javax.annotation.Nullable - public Boolean getStateEfile() { - return stateEfile; - } - - public void setStateEfile(Boolean stateEfile) { - this.stateEfile = stateEfile; - } - - - public Form1042S stateEfileStatus(List stateEfileStatus) { - this.stateEfileStatus = stateEfileStatus; - return this; - } - - public Form1042S addStateEfileStatusItem(StateEfileStatusDetail stateEfileStatusItem) { - if (this.stateEfileStatus == null) { - this.stateEfileStatus = new ArrayList<>(); - } - this.stateEfileStatus.add(stateEfileStatusItem); + public Form1042S referenceId(String referenceId) { + this.referenceId = referenceId; return this; } /** - * Get stateEfileStatus - * @return stateEfileStatus + * Internal reference ID. Never shown to any agency or recipient. + * @return referenceId */ @javax.annotation.Nullable - public List getStateEfileStatus() { - return stateEfileStatus; + public String getReferenceId() { + return referenceId; } - public void setStateEfileStatus(List stateEfileStatus) { - this.stateEfileStatus = stateEfileStatus; + public void setReferenceId(String referenceId) { + this.referenceId = referenceId; } - public Form1042S postalMail(Boolean postalMail) { - this.postalMail = postalMail; + public Form1042S tin(String tin) { + this.tin = tin; return this; } /** - * Get postalMail - * @return postalMail + * Recipient's Federal Tax Identification Number (TIN). + * @return tin */ @javax.annotation.Nullable - public Boolean getPostalMail() { - return postalMail; + public String getTin() { + return tin; } - public void setPostalMail(Boolean postalMail) { - this.postalMail = postalMail; + public void setTin(String tin) { + this.tin = tin; } - public Form1042S postalMailStatus(Form1099StatusDetail postalMailStatus) { - this.postalMailStatus = postalMailStatus; + public Form1042S recipientName(String recipientName) { + this.recipientName = recipientName; return this; } /** - * Get postalMailStatus - * @return postalMailStatus + * Recipient name + * @return recipientName */ @javax.annotation.Nullable - public Form1099StatusDetail getPostalMailStatus() { - return postalMailStatus; + public String getRecipientName() { + return recipientName; } - public void setPostalMailStatus(Form1099StatusDetail postalMailStatus) { - this.postalMailStatus = postalMailStatus; + public void setRecipientName(String recipientName) { + this.recipientName = recipientName; } - public Form1042S tinMatch(Boolean tinMatch) { - this.tinMatch = tinMatch; + public Form1042S recipientSecondName(String recipientSecondName) { + this.recipientSecondName = recipientSecondName; return this; } /** - * Get tinMatch - * @return tinMatch + * Recipient second name + * @return recipientSecondName */ @javax.annotation.Nullable - public Boolean getTinMatch() { - return tinMatch; + public String getRecipientSecondName() { + return recipientSecondName; } - public void setTinMatch(Boolean tinMatch) { - this.tinMatch = tinMatch; + public void setRecipientSecondName(String recipientSecondName) { + this.recipientSecondName = recipientSecondName; } - public Form1042S tinMatchStatus(Form1099StatusDetail tinMatchStatus) { - this.tinMatchStatus = tinMatchStatus; + public Form1042S address(String address) { + this.address = address; return this; } /** - * Get tinMatchStatus - * @return tinMatchStatus + * Address. + * @return address */ @javax.annotation.Nullable - public Form1099StatusDetail getTinMatchStatus() { - return tinMatchStatus; + public String getAddress() { + return address; } - public void setTinMatchStatus(Form1099StatusDetail tinMatchStatus) { - this.tinMatchStatus = tinMatchStatus; + public void setAddress(String address) { + this.address = address; } - public Form1042S addressVerification(Boolean addressVerification) { - this.addressVerification = addressVerification; + public Form1042S address2(String address2) { + this.address2 = address2; return this; } /** - * Get addressVerification - * @return addressVerification + * Address line 2. + * @return address2 */ @javax.annotation.Nullable - public Boolean getAddressVerification() { - return addressVerification; + public String getAddress2() { + return address2; } - public void setAddressVerification(Boolean addressVerification) { - this.addressVerification = addressVerification; + public void setAddress2(String address2) { + this.address2 = address2; } - public Form1042S addressVerificationStatus(Form1099StatusDetail addressVerificationStatus) { - this.addressVerificationStatus = addressVerificationStatus; + public Form1042S city(String city) { + this.city = city; return this; } /** - * Get addressVerificationStatus - * @return addressVerificationStatus + * City. + * @return city */ @javax.annotation.Nullable - public Form1099StatusDetail getAddressVerificationStatus() { - return addressVerificationStatus; + public String getCity() { + return city; } - public void setAddressVerificationStatus(Form1099StatusDetail addressVerificationStatus) { - this.addressVerificationStatus = addressVerificationStatus; + public void setCity(String city) { + this.city = city; } - public Form1042S eDeliveryStatus(Form1099StatusDetail eDeliveryStatus) { - this.eDeliveryStatus = eDeliveryStatus; + public Form1042S state(String state) { + this.state = state; return this; } /** - * Get eDeliveryStatus - * @return eDeliveryStatus + * Two-letter US state or Canadian province code (required for US/CA addresses). + * @return state */ @javax.annotation.Nullable - public Form1099StatusDetail geteDeliveryStatus() { - return eDeliveryStatus; + public String getState() { + return state; } - public void seteDeliveryStatus(Form1099StatusDetail eDeliveryStatus) { - this.eDeliveryStatus = eDeliveryStatus; + public void setState(String state) { + this.state = state; } - public Form1042S referenceId(String referenceId) { - this.referenceId = referenceId; + public Form1042S zip(String zip) { + this.zip = zip; return this; } /** - * Get referenceId - * @return referenceId + * ZIP/postal code. + * @return zip */ @javax.annotation.Nullable - public String getReferenceId() { - return referenceId; + public String getZip() { + return zip; } - public void setReferenceId(String referenceId) { - this.referenceId = referenceId; + public void setZip(String zip) { + this.zip = zip; } @@ -1111,7 +1989,7 @@ public Form1042S email(String email) { } /** - * Get email + * Recipient's Contact email address. * @return email */ @javax.annotation.Nullable @@ -1124,325 +2002,321 @@ public void setEmail(String email) { } - public Form1042S tinType(String tinType) { - this.tinType = tinType; + public Form1042S accountNumber(String accountNumber) { + this.accountNumber = accountNumber; return this; } /** - * Get tinType - * @return tinType + * Account number + * @return accountNumber */ @javax.annotation.Nullable - public String getTinType() { - return tinType; + public String getAccountNumber() { + return accountNumber; } - public void setTinType(String tinType) { - this.tinType = tinType; + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; } - public Form1042S fatcaFilingRequirement(Boolean fatcaFilingRequirement) { - this.fatcaFilingRequirement = fatcaFilingRequirement; + public Form1042S officeCode(String officeCode) { + this.officeCode = officeCode; return this; } /** - * Get fatcaFilingRequirement - * @return fatcaFilingRequirement + * Office code + * @return officeCode */ @javax.annotation.Nullable - public Boolean getFatcaFilingRequirement() { - return fatcaFilingRequirement; + public String getOfficeCode() { + return officeCode; } - public void setFatcaFilingRequirement(Boolean fatcaFilingRequirement) { - this.fatcaFilingRequirement = fatcaFilingRequirement; + public void setOfficeCode(String officeCode) { + this.officeCode = officeCode; } - public Form1042S tin(String tin) { - this.tin = tin; + public Form1042S nonUsProvince(String nonUsProvince) { + this.nonUsProvince = nonUsProvince; return this; } /** - * Get tin - * @return tin + * Province or region for non-US/CA addresses. + * @return nonUsProvince */ @javax.annotation.Nullable - public String getTin() { - return tin; + public String getNonUsProvince() { + return nonUsProvince; } - public void setTin(String tin) { - this.tin = tin; + public void setNonUsProvince(String nonUsProvince) { + this.nonUsProvince = nonUsProvince; } - public Form1042S noTin(Boolean noTin) { - this.noTin = noTin; + public Form1042S countryCode(String countryCode) { + this.countryCode = countryCode; return this; } /** - * Get noTin - * @return noTin + * Two-letter IRS country code (e.g., 'US', 'CA'), as defined at https://www.irs.gov/e-file-providers/country-codes. + * @return countryCode */ @javax.annotation.Nullable - public Boolean getNoTin() { - return noTin; + public String getCountryCode() { + return countryCode; } - public void setNoTin(Boolean noTin) { - this.noTin = noTin; + public void setCountryCode(String countryCode) { + this.countryCode = countryCode; } - public Form1042S secondTinNotice(Boolean secondTinNotice) { - this.secondTinNotice = secondTinNotice; + public Form1042S federalEfileDate(LocalDate federalEfileDate) { + this.federalEfileDate = federalEfileDate; return this; } /** - * Get secondTinNotice - * @return secondTinNotice + * Date when federal e-filing should be scheduled for this form + * @return federalEfileDate */ @javax.annotation.Nullable - public Boolean getSecondTinNotice() { - return secondTinNotice; + public LocalDate getFederalEfileDate() { + return federalEfileDate; } - public void setSecondTinNotice(Boolean secondTinNotice) { - this.secondTinNotice = secondTinNotice; + public void setFederalEfileDate(LocalDate federalEfileDate) { + this.federalEfileDate = federalEfileDate; } - public Form1042S recipientName(String recipientName) { - this.recipientName = recipientName; + public Form1042S postalMail(Boolean postalMail) { + this.postalMail = postalMail; return this; } /** - * Get recipientName - * @return recipientName + * Boolean indicating that postal mailing to the recipient should be scheduled for this form + * @return postalMail */ @javax.annotation.Nullable - public String getRecipientName() { - return recipientName; + public Boolean getPostalMail() { + return postalMail; } - public void setRecipientName(String recipientName) { - this.recipientName = recipientName; + public void setPostalMail(Boolean postalMail) { + this.postalMail = postalMail; } - public Form1042S recipientSecondName(String recipientSecondName) { - this.recipientSecondName = recipientSecondName; + public Form1042S stateEfileDate(LocalDate stateEfileDate) { + this.stateEfileDate = stateEfileDate; return this; } /** - * Get recipientSecondName - * @return recipientSecondName + * Date when state e-filing should be scheduled for this form + * @return stateEfileDate */ @javax.annotation.Nullable - public String getRecipientSecondName() { - return recipientSecondName; + public LocalDate getStateEfileDate() { + return stateEfileDate; } - public void setRecipientSecondName(String recipientSecondName) { - this.recipientSecondName = recipientSecondName; + public void setStateEfileDate(LocalDate stateEfileDate) { + this.stateEfileDate = stateEfileDate; } - public Form1042S address(String address) { - this.address = address; + public Form1042S recipientEdeliveryDate(LocalDate recipientEdeliveryDate) { + this.recipientEdeliveryDate = recipientEdeliveryDate; return this; } /** - * Get address - * @return address + * Date when recipient e-delivery should be scheduled for this form + * @return recipientEdeliveryDate */ @javax.annotation.Nullable - public String getAddress() { - return address; + public LocalDate getRecipientEdeliveryDate() { + return recipientEdeliveryDate; } - public void setAddress(String address) { - this.address = address; + public void setRecipientEdeliveryDate(LocalDate recipientEdeliveryDate) { + this.recipientEdeliveryDate = recipientEdeliveryDate; } - public Form1042S address2(String address2) { - this.address2 = address2; + public Form1042S tinMatch(Boolean tinMatch) { + this.tinMatch = tinMatch; return this; } /** - * Get address2 - * @return address2 + * Boolean indicating that TIN Matching should be scheduled for this form + * @return tinMatch */ @javax.annotation.Nullable - public String getAddress2() { - return address2; + public Boolean getTinMatch() { + return tinMatch; } - public void setAddress2(String address2) { - this.address2 = address2; + public void setTinMatch(Boolean tinMatch) { + this.tinMatch = tinMatch; } - public Form1042S city(String city) { - this.city = city; + public Form1042S noTin(Boolean noTin) { + this.noTin = noTin; return this; } /** - * Get city - * @return city + * No TIN indicator + * @return noTin */ @javax.annotation.Nullable - public String getCity() { - return city; + public Boolean getNoTin() { + return noTin; } - public void setCity(String city) { - this.city = city; + public void setNoTin(Boolean noTin) { + this.noTin = noTin; } - public Form1042S state(String state) { - this.state = state; + public Form1042S addressVerification(Boolean addressVerification) { + this.addressVerification = addressVerification; return this; } /** - * Get state - * @return state + * Boolean indicating that address verification should be scheduled for this form + * @return addressVerification */ @javax.annotation.Nullable - public String getState() { - return state; + public Boolean getAddressVerification() { + return addressVerification; } - public void setState(String state) { - this.state = state; + public void setAddressVerification(Boolean addressVerification) { + this.addressVerification = addressVerification; } - public Form1042S zip(String zip) { - this.zip = zip; + public Form1042S stateAndLocalWithholding(StateAndLocalWithholding stateAndLocalWithholding) { + this.stateAndLocalWithholding = stateAndLocalWithholding; return this; } /** - * Get zip - * @return zip + * State and local withholding information + * @return stateAndLocalWithholding */ @javax.annotation.Nullable - public String getZip() { - return zip; + public StateAndLocalWithholding getStateAndLocalWithholding() { + return stateAndLocalWithholding; } - public void setZip(String zip) { - this.zip = zip; + public void setStateAndLocalWithholding(StateAndLocalWithholding stateAndLocalWithholding) { + this.stateAndLocalWithholding = stateAndLocalWithholding; } - public Form1042S nonUsProvince(String nonUsProvince) { - this.nonUsProvince = nonUsProvince; + public Form1042S secondTinNotice(Boolean secondTinNotice) { + this.secondTinNotice = secondTinNotice; return this; } /** - * Get nonUsProvince - * @return nonUsProvince + * Second TIN notice + * @return secondTinNotice */ @javax.annotation.Nullable - public String getNonUsProvince() { - return nonUsProvince; + public Boolean getSecondTinNotice() { + return secondTinNotice; } - public void setNonUsProvince(String nonUsProvince) { - this.nonUsProvince = nonUsProvince; + public void setSecondTinNotice(Boolean secondTinNotice) { + this.secondTinNotice = secondTinNotice; } - public Form1042S countryCode(String countryCode) { - this.countryCode = countryCode; - return this; + /** + * Federal e-file status + * @return federalEfileStatus + */ + @javax.annotation.Nullable + public Form1099StatusDetail getFederalEfileStatus() { + return federalEfileStatus; } + + /** - * Get countryCode - * @return countryCode + * State e-file status + * @return stateEfileStatus */ @javax.annotation.Nullable - public String getCountryCode() { - return countryCode; + public List getStateEfileStatus() { + return stateEfileStatus; } - public void setCountryCode(String countryCode) { - this.countryCode = countryCode; - } - public Form1042S accountNumber(String accountNumber) { - this.accountNumber = accountNumber; - return this; + /** + * Postal mail to recipient status + * @return postalMailStatus + */ + @javax.annotation.Nullable + public Form1099StatusDetail getPostalMailStatus() { + return postalMailStatus; } + + /** - * Get accountNumber - * @return accountNumber + * TIN Match status + * @return tinMatchStatus */ @javax.annotation.Nullable - public String getAccountNumber() { - return accountNumber; + public Form1099StatusDetail getTinMatchStatus() { + return tinMatchStatus; } - public void setAccountNumber(String accountNumber) { - this.accountNumber = accountNumber; - } - public Form1042S officeCode(String officeCode) { - this.officeCode = officeCode; - return this; + /** + * Address verification status + * @return addressVerificationStatus + */ + @javax.annotation.Nullable + public Form1099StatusDetail getAddressVerificationStatus() { + return addressVerificationStatus; } + + /** - * Get officeCode - * @return officeCode + * EDelivery status + * @return eDeliveryStatus */ @javax.annotation.Nullable - public String getOfficeCode() { - return officeCode; - } - - public void setOfficeCode(String officeCode) { - this.officeCode = officeCode; + public Form1099StatusDetail geteDeliveryStatus() { + return eDeliveryStatus; } - public Form1042S validationErrors(List validationErrors) { - this.validationErrors = validationErrors; - return this; - } - - public Form1042S addValidationErrorsItem(ValidationError validationErrorsItem) { - if (this.validationErrors == null) { - this.validationErrors = new ArrayList<>(); - } - this.validationErrors.add(validationErrorsItem); - return this; - } /** - * Get validationErrors + * Validation errors * @return validationErrors */ @javax.annotation.Nullable @@ -1450,18 +2324,10 @@ public List getValidationErrors() { return validationErrors; } - public void setValidationErrors(List validationErrors) { - this.validationErrors = validationErrors; - } - - public Form1042S createdAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - return this; - } /** - * Get createdAt + * Date time when the record was created. * @return createdAt */ @javax.annotation.Nullable @@ -1469,18 +2335,10 @@ public OffsetDateTime getCreatedAt() { return createdAt; } - public void setCreatedAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - } - - public Form1042S updatedAt(OffsetDateTime updatedAt) { - this.updatedAt = updatedAt; - return this; - } /** - * Get updatedAt + * Date time when the record was last updated. * @return updatedAt */ @javax.annotation.Nullable @@ -1488,28 +2346,6 @@ public OffsetDateTime getUpdatedAt() { return updatedAt; } - public void setUpdatedAt(OffsetDateTime updatedAt) { - this.updatedAt = updatedAt; - } - - - public Form1042S stateAndLocalWithholding(StateAndLocalWithholding stateAndLocalWithholding) { - this.stateAndLocalWithholding = stateAndLocalWithholding; - return this; - } - - /** - * Get stateAndLocalWithholding - * @return stateAndLocalWithholding - */ - @javax.annotation.Nullable - public StateAndLocalWithholding getStateAndLocalWithholding() { - return stateAndLocalWithholding; - } - - public void setStateAndLocalWithholding(StateAndLocalWithholding stateAndLocalWithholding) { - this.stateAndLocalWithholding = stateAndLocalWithholding; - } @@ -1522,7 +2358,8 @@ public boolean equals(Object o) { return false; } Form1042S form1042S = (Form1042S) o; - return Objects.equals(this.uniqueFormId, form1042S.uniqueFormId) && + return Objects.equals(this.tinType, form1042S.tinType) && + Objects.equals(this.uniqueFormId, form1042S.uniqueFormId) && Objects.equals(this.recipientDateOfBirth, form1042S.recipientDateOfBirth) && Objects.equals(this.recipientGiin, form1042S.recipientGiin) && Objects.equals(this.recipientForeignTin, form1042S.recipientForeignTin) && @@ -1545,30 +2382,14 @@ public boolean equals(Object o) { Objects.equals(this.chap4StatusCode, form1042S.chap4StatusCode) && Objects.equals(this.primaryWithholdingAgent, form1042S.primaryWithholdingAgent) && Objects.equals(this.intermediaryOrFlowThrough, form1042S.intermediaryOrFlowThrough) && - Objects.equals(this.id, form1042S.id) && Objects.equals(this.type, form1042S.type) && + Objects.equals(this.id, form1042S.id) && Objects.equals(this.issuerId, form1042S.issuerId) && Objects.equals(this.issuerReferenceId, form1042S.issuerReferenceId) && Objects.equals(this.issuerTin, form1042S.issuerTin) && Objects.equals(this.taxYear, form1042S.taxYear) && - Objects.equals(this.federalEfile, form1042S.federalEfile) && - Objects.equals(this.federalEfileStatus, form1042S.federalEfileStatus) && - Objects.equals(this.stateEfile, form1042S.stateEfile) && - Objects.equals(this.stateEfileStatus, form1042S.stateEfileStatus) && - Objects.equals(this.postalMail, form1042S.postalMail) && - Objects.equals(this.postalMailStatus, form1042S.postalMailStatus) && - Objects.equals(this.tinMatch, form1042S.tinMatch) && - Objects.equals(this.tinMatchStatus, form1042S.tinMatchStatus) && - Objects.equals(this.addressVerification, form1042S.addressVerification) && - Objects.equals(this.addressVerificationStatus, form1042S.addressVerificationStatus) && - Objects.equals(this.eDeliveryStatus, form1042S.eDeliveryStatus) && Objects.equals(this.referenceId, form1042S.referenceId) && - Objects.equals(this.email, form1042S.email) && - Objects.equals(this.tinType, form1042S.tinType) && - Objects.equals(this.fatcaFilingRequirement, form1042S.fatcaFilingRequirement) && Objects.equals(this.tin, form1042S.tin) && - Objects.equals(this.noTin, form1042S.noTin) && - Objects.equals(this.secondTinNotice, form1042S.secondTinNotice) && Objects.equals(this.recipientName, form1042S.recipientName) && Objects.equals(this.recipientSecondName, form1042S.recipientSecondName) && Objects.equals(this.address, form1042S.address) && @@ -1576,14 +2397,29 @@ public boolean equals(Object o) { Objects.equals(this.city, form1042S.city) && Objects.equals(this.state, form1042S.state) && Objects.equals(this.zip, form1042S.zip) && - Objects.equals(this.nonUsProvince, form1042S.nonUsProvince) && - Objects.equals(this.countryCode, form1042S.countryCode) && + Objects.equals(this.email, form1042S.email) && Objects.equals(this.accountNumber, form1042S.accountNumber) && Objects.equals(this.officeCode, form1042S.officeCode) && + Objects.equals(this.nonUsProvince, form1042S.nonUsProvince) && + Objects.equals(this.countryCode, form1042S.countryCode) && + Objects.equals(this.federalEfileDate, form1042S.federalEfileDate) && + Objects.equals(this.postalMail, form1042S.postalMail) && + Objects.equals(this.stateEfileDate, form1042S.stateEfileDate) && + Objects.equals(this.recipientEdeliveryDate, form1042S.recipientEdeliveryDate) && + Objects.equals(this.tinMatch, form1042S.tinMatch) && + Objects.equals(this.noTin, form1042S.noTin) && + Objects.equals(this.addressVerification, form1042S.addressVerification) && + Objects.equals(this.stateAndLocalWithholding, form1042S.stateAndLocalWithholding) && + Objects.equals(this.secondTinNotice, form1042S.secondTinNotice) && + Objects.equals(this.federalEfileStatus, form1042S.federalEfileStatus) && + Objects.equals(this.stateEfileStatus, form1042S.stateEfileStatus) && + Objects.equals(this.postalMailStatus, form1042S.postalMailStatus) && + Objects.equals(this.tinMatchStatus, form1042S.tinMatchStatus) && + Objects.equals(this.addressVerificationStatus, form1042S.addressVerificationStatus) && + Objects.equals(this.eDeliveryStatus, form1042S.eDeliveryStatus) && Objects.equals(this.validationErrors, form1042S.validationErrors) && Objects.equals(this.createdAt, form1042S.createdAt) && - Objects.equals(this.updatedAt, form1042S.updatedAt) && - Objects.equals(this.stateAndLocalWithholding, form1042S.stateAndLocalWithholding); + Objects.equals(this.updatedAt, form1042S.updatedAt); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -1592,7 +2428,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(uniqueFormId, recipientDateOfBirth, recipientGiin, recipientForeignTin, lobCode, incomeCode, grossIncome, withholdingIndicator, taxCountryCode, exemptionCodeChap3, exemptionCodeChap4, taxRateChap3, withholdingAllowance, federalTaxWithheld, taxNotDepositedIndicator, academicIndicator, taxWithheldOtherAgents, amountRepaid, taxPaidAgent, chap3StatusCode, chap4StatusCode, primaryWithholdingAgent, intermediaryOrFlowThrough, id, type, issuerId, issuerReferenceId, issuerTin, taxYear, federalEfile, federalEfileStatus, stateEfile, stateEfileStatus, postalMail, postalMailStatus, tinMatch, tinMatchStatus, addressVerification, addressVerificationStatus, eDeliveryStatus, referenceId, email, tinType, fatcaFilingRequirement, tin, noTin, secondTinNotice, recipientName, recipientSecondName, address, address2, city, state, zip, nonUsProvince, countryCode, accountNumber, officeCode, validationErrors, createdAt, updatedAt, stateAndLocalWithholding); + return Objects.hash(tinType, uniqueFormId, recipientDateOfBirth, recipientGiin, recipientForeignTin, lobCode, incomeCode, grossIncome, withholdingIndicator, taxCountryCode, exemptionCodeChap3, exemptionCodeChap4, taxRateChap3, withholdingAllowance, federalTaxWithheld, taxNotDepositedIndicator, academicIndicator, taxWithheldOtherAgents, amountRepaid, taxPaidAgent, chap3StatusCode, chap4StatusCode, primaryWithholdingAgent, intermediaryOrFlowThrough, type, id, issuerId, issuerReferenceId, issuerTin, taxYear, referenceId, tin, recipientName, recipientSecondName, address, address2, city, state, zip, email, accountNumber, officeCode, nonUsProvince, countryCode, federalEfileDate, postalMail, stateEfileDate, recipientEdeliveryDate, tinMatch, noTin, addressVerification, stateAndLocalWithholding, secondTinNotice, federalEfileStatus, stateEfileStatus, postalMailStatus, tinMatchStatus, addressVerificationStatus, eDeliveryStatus, validationErrors, createdAt, updatedAt); } private static int hashCodeNullable(JsonNullable a) { @@ -1606,6 +2442,7 @@ private static int hashCodeNullable(JsonNullable a) { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Form1042S {\n"); + sb.append(" tinType: ").append(toIndentedString(tinType)).append("\n"); sb.append(" uniqueFormId: ").append(toIndentedString(uniqueFormId)).append("\n"); sb.append(" recipientDateOfBirth: ").append(toIndentedString(recipientDateOfBirth)).append("\n"); sb.append(" recipientGiin: ").append(toIndentedString(recipientGiin)).append("\n"); @@ -1629,30 +2466,14 @@ public String toString() { sb.append(" chap4StatusCode: ").append(toIndentedString(chap4StatusCode)).append("\n"); sb.append(" primaryWithholdingAgent: ").append(toIndentedString(primaryWithholdingAgent)).append("\n"); sb.append(" intermediaryOrFlowThrough: ").append(toIndentedString(intermediaryOrFlowThrough)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" issuerId: ").append(toIndentedString(issuerId)).append("\n"); sb.append(" issuerReferenceId: ").append(toIndentedString(issuerReferenceId)).append("\n"); sb.append(" issuerTin: ").append(toIndentedString(issuerTin)).append("\n"); sb.append(" taxYear: ").append(toIndentedString(taxYear)).append("\n"); - sb.append(" federalEfile: ").append(toIndentedString(federalEfile)).append("\n"); - sb.append(" federalEfileStatus: ").append(toIndentedString(federalEfileStatus)).append("\n"); - sb.append(" stateEfile: ").append(toIndentedString(stateEfile)).append("\n"); - sb.append(" stateEfileStatus: ").append(toIndentedString(stateEfileStatus)).append("\n"); - sb.append(" postalMail: ").append(toIndentedString(postalMail)).append("\n"); - sb.append(" postalMailStatus: ").append(toIndentedString(postalMailStatus)).append("\n"); - sb.append(" tinMatch: ").append(toIndentedString(tinMatch)).append("\n"); - sb.append(" tinMatchStatus: ").append(toIndentedString(tinMatchStatus)).append("\n"); - sb.append(" addressVerification: ").append(toIndentedString(addressVerification)).append("\n"); - sb.append(" addressVerificationStatus: ").append(toIndentedString(addressVerificationStatus)).append("\n"); - sb.append(" eDeliveryStatus: ").append(toIndentedString(eDeliveryStatus)).append("\n"); sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" tinType: ").append(toIndentedString(tinType)).append("\n"); - sb.append(" fatcaFilingRequirement: ").append(toIndentedString(fatcaFilingRequirement)).append("\n"); sb.append(" tin: ").append(toIndentedString(tin)).append("\n"); - sb.append(" noTin: ").append(toIndentedString(noTin)).append("\n"); - sb.append(" secondTinNotice: ").append(toIndentedString(secondTinNotice)).append("\n"); sb.append(" recipientName: ").append(toIndentedString(recipientName)).append("\n"); sb.append(" recipientSecondName: ").append(toIndentedString(recipientSecondName)).append("\n"); sb.append(" address: ").append(toIndentedString(address)).append("\n"); @@ -1660,14 +2481,29 @@ public String toString() { sb.append(" city: ").append(toIndentedString(city)).append("\n"); sb.append(" state: ").append(toIndentedString(state)).append("\n"); sb.append(" zip: ").append(toIndentedString(zip)).append("\n"); - sb.append(" nonUsProvince: ").append(toIndentedString(nonUsProvince)).append("\n"); - sb.append(" countryCode: ").append(toIndentedString(countryCode)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); sb.append(" officeCode: ").append(toIndentedString(officeCode)).append("\n"); + sb.append(" nonUsProvince: ").append(toIndentedString(nonUsProvince)).append("\n"); + sb.append(" countryCode: ").append(toIndentedString(countryCode)).append("\n"); + sb.append(" federalEfileDate: ").append(toIndentedString(federalEfileDate)).append("\n"); + sb.append(" postalMail: ").append(toIndentedString(postalMail)).append("\n"); + sb.append(" stateEfileDate: ").append(toIndentedString(stateEfileDate)).append("\n"); + sb.append(" recipientEdeliveryDate: ").append(toIndentedString(recipientEdeliveryDate)).append("\n"); + sb.append(" tinMatch: ").append(toIndentedString(tinMatch)).append("\n"); + sb.append(" noTin: ").append(toIndentedString(noTin)).append("\n"); + sb.append(" addressVerification: ").append(toIndentedString(addressVerification)).append("\n"); + sb.append(" stateAndLocalWithholding: ").append(toIndentedString(stateAndLocalWithholding)).append("\n"); + sb.append(" secondTinNotice: ").append(toIndentedString(secondTinNotice)).append("\n"); + sb.append(" federalEfileStatus: ").append(toIndentedString(federalEfileStatus)).append("\n"); + sb.append(" stateEfileStatus: ").append(toIndentedString(stateEfileStatus)).append("\n"); + sb.append(" postalMailStatus: ").append(toIndentedString(postalMailStatus)).append("\n"); + sb.append(" tinMatchStatus: ").append(toIndentedString(tinMatchStatus)).append("\n"); + sb.append(" addressVerificationStatus: ").append(toIndentedString(addressVerificationStatus)).append("\n"); + sb.append(" eDeliveryStatus: ").append(toIndentedString(eDeliveryStatus)).append("\n"); sb.append(" validationErrors: ").append(toIndentedString(validationErrors)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append(" stateAndLocalWithholding: ").append(toIndentedString(stateAndLocalWithholding)).append("\n"); sb.append("}"); return sb.toString(); } @@ -1690,48 +2526,58 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("id"); openapiFields.add("type"); + openapiFields.add("id"); openapiFields.add("issuerId"); openapiFields.add("issuerReferenceId"); openapiFields.add("issuerTin"); openapiFields.add("taxYear"); - openapiFields.add("federalEfile"); - openapiFields.add("federalEfileStatus"); - openapiFields.add("stateEfile"); - openapiFields.add("stateEfileStatus"); - openapiFields.add("postalMail"); - openapiFields.add("postalMailStatus"); - openapiFields.add("tinMatch"); - openapiFields.add("tinMatchStatus"); - openapiFields.add("addressVerification"); - openapiFields.add("addressVerificationStatus"); - openapiFields.add("eDeliveryStatus"); openapiFields.add("referenceId"); - openapiFields.add("email"); - openapiFields.add("tinType"); - openapiFields.add("fatcaFilingRequirement"); openapiFields.add("tin"); - openapiFields.add("noTin"); - openapiFields.add("secondTinNotice"); openapiFields.add("recipientName"); + openapiFields.add("tinType"); openapiFields.add("recipientSecondName"); openapiFields.add("address"); openapiFields.add("address2"); openapiFields.add("city"); openapiFields.add("state"); openapiFields.add("zip"); - openapiFields.add("nonUsProvince"); - openapiFields.add("countryCode"); + openapiFields.add("email"); openapiFields.add("accountNumber"); openapiFields.add("officeCode"); + openapiFields.add("nonUsProvince"); + openapiFields.add("countryCode"); + openapiFields.add("federalEfileDate"); + openapiFields.add("postalMail"); + openapiFields.add("stateEfileDate"); + openapiFields.add("recipientEdeliveryDate"); + openapiFields.add("tinMatch"); + openapiFields.add("noTin"); + openapiFields.add("addressVerification"); + openapiFields.add("stateAndLocalWithholding"); + openapiFields.add("secondTinNotice"); + openapiFields.add("federalEfileStatus"); + openapiFields.add("stateEfileStatus"); + openapiFields.add("postalMailStatus"); + openapiFields.add("tinMatchStatus"); + openapiFields.add("addressVerificationStatus"); + openapiFields.add("eDeliveryStatus"); openapiFields.add("validationErrors"); openapiFields.add("createdAt"); openapiFields.add("updatedAt"); - openapiFields.add("stateAndLocalWithholding"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("uniqueFormId"); + openapiRequiredFields.add("incomeCode"); + openapiRequiredFields.add("grossIncome"); + openapiRequiredFields.add("withholdingIndicator"); + openapiRequiredFields.add("taxCountryCode"); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("recipientName"); + openapiRequiredFields.add("address"); + openapiRequiredFields.add("city"); + openapiRequiredFields.add("countryCode"); } /** @@ -1754,7 +2600,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Form1042S` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Form1042S.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("tinType") != null && !jsonObj.get("tinType").isJsonNull()) && !jsonObj.get("tinType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `tinType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tinType").toString())); + } + // validate the optional field `tinType` + if (jsonObj.get("tinType") != null && !jsonObj.get("tinType").isJsonNull()) { + TinTypeEnum.validateJsonElement(jsonObj.get("tinType")); + } if ((jsonObj.get("uniqueFormId") != null && !jsonObj.get("uniqueFormId").isJsonNull()) && !jsonObj.get("uniqueFormId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `uniqueFormId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uniqueFormId").toString())); } @@ -1767,30 +2627,58 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("lobCode") != null && !jsonObj.get("lobCode").isJsonNull()) && !jsonObj.get("lobCode").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `lobCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lobCode").toString())); } + // validate the optional field `lobCode` + if (jsonObj.get("lobCode") != null && !jsonObj.get("lobCode").isJsonNull()) { + LobCodeEnum.validateJsonElement(jsonObj.get("lobCode")); + } if ((jsonObj.get("incomeCode") != null && !jsonObj.get("incomeCode").isJsonNull()) && !jsonObj.get("incomeCode").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `incomeCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("incomeCode").toString())); } + // validate the required field `incomeCode` + IncomeCodeEnum.validateJsonElement(jsonObj.get("incomeCode")); if ((jsonObj.get("withholdingIndicator") != null && !jsonObj.get("withholdingIndicator").isJsonNull()) && !jsonObj.get("withholdingIndicator").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `withholdingIndicator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("withholdingIndicator").toString())); } + // validate the required field `withholdingIndicator` + WithholdingIndicatorEnum.validateJsonElement(jsonObj.get("withholdingIndicator")); if ((jsonObj.get("taxCountryCode") != null && !jsonObj.get("taxCountryCode").isJsonNull()) && !jsonObj.get("taxCountryCode").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `taxCountryCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("taxCountryCode").toString())); } if ((jsonObj.get("exemptionCodeChap3") != null && !jsonObj.get("exemptionCodeChap3").isJsonNull()) && !jsonObj.get("exemptionCodeChap3").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `exemptionCodeChap3` to be a primitive type in the JSON string but got `%s`", jsonObj.get("exemptionCodeChap3").toString())); } + // validate the optional field `exemptionCodeChap3` + if (jsonObj.get("exemptionCodeChap3") != null && !jsonObj.get("exemptionCodeChap3").isJsonNull()) { + ExemptionCodeChap3Enum.validateJsonElement(jsonObj.get("exemptionCodeChap3")); + } if ((jsonObj.get("exemptionCodeChap4") != null && !jsonObj.get("exemptionCodeChap4").isJsonNull()) && !jsonObj.get("exemptionCodeChap4").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `exemptionCodeChap4` to be a primitive type in the JSON string but got `%s`", jsonObj.get("exemptionCodeChap4").toString())); } + // validate the optional field `exemptionCodeChap4` + if (jsonObj.get("exemptionCodeChap4") != null && !jsonObj.get("exemptionCodeChap4").isJsonNull()) { + ExemptionCodeChap4Enum.validateJsonElement(jsonObj.get("exemptionCodeChap4")); + } if ((jsonObj.get("taxRateChap3") != null && !jsonObj.get("taxRateChap3").isJsonNull()) && !jsonObj.get("taxRateChap3").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `taxRateChap3` to be a primitive type in the JSON string but got `%s`", jsonObj.get("taxRateChap3").toString())); } + // validate the optional field `taxRateChap3` + if (jsonObj.get("taxRateChap3") != null && !jsonObj.get("taxRateChap3").isJsonNull()) { + TaxRateChap3Enum.validateJsonElement(jsonObj.get("taxRateChap3")); + } if ((jsonObj.get("chap3StatusCode") != null && !jsonObj.get("chap3StatusCode").isJsonNull()) && !jsonObj.get("chap3StatusCode").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `chap3StatusCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("chap3StatusCode").toString())); } + // validate the optional field `chap3StatusCode` + if (jsonObj.get("chap3StatusCode") != null && !jsonObj.get("chap3StatusCode").isJsonNull()) { + Chap3StatusCodeEnum.validateJsonElement(jsonObj.get("chap3StatusCode")); + } if ((jsonObj.get("chap4StatusCode") != null && !jsonObj.get("chap4StatusCode").isJsonNull()) && !jsonObj.get("chap4StatusCode").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `chap4StatusCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("chap4StatusCode").toString())); } + // validate the optional field `chap4StatusCode` + if (jsonObj.get("chap4StatusCode") != null && !jsonObj.get("chap4StatusCode").isJsonNull()) { + Chap4StatusCodeEnum.validateJsonElement(jsonObj.get("chap4StatusCode")); + } // validate the optional field `primaryWithholdingAgent` if (jsonObj.get("primaryWithholdingAgent") != null && !jsonObj.get("primaryWithholdingAgent").isJsonNull()) { PrimaryWithholdingAgent.validateJsonElement(jsonObj.get("primaryWithholdingAgent")); @@ -1799,11 +2687,16 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("intermediaryOrFlowThrough") != null && !jsonObj.get("intermediaryOrFlowThrough").isJsonNull()) { IntermediaryOrFlowThrough.validateJsonElement(jsonObj.get("intermediaryOrFlowThrough")); } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); 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("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + if ((jsonObj.get("issuerId") != null && !jsonObj.get("issuerId").isJsonNull()) && !jsonObj.get("issuerId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `issuerId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerId").toString())); } if ((jsonObj.get("issuerReferenceId") != null && !jsonObj.get("issuerReferenceId").isJsonNull()) && !jsonObj.get("issuerReferenceId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `issuerReferenceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerReferenceId").toString())); @@ -1811,49 +2704,9 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("issuerTin") != null && !jsonObj.get("issuerTin").isJsonNull()) && !jsonObj.get("issuerTin").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `issuerTin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerTin").toString())); } - // validate the optional field `federalEfileStatus` - if (jsonObj.get("federalEfileStatus") != null && !jsonObj.get("federalEfileStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("federalEfileStatus")); - } - if (jsonObj.get("stateEfileStatus") != null && !jsonObj.get("stateEfileStatus").isJsonNull()) { - JsonArray jsonArraystateEfileStatus = jsonObj.getAsJsonArray("stateEfileStatus"); - if (jsonArraystateEfileStatus != null) { - // ensure the json data is an array - if (!jsonObj.get("stateEfileStatus").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `stateEfileStatus` to be an array in the JSON string but got `%s`", jsonObj.get("stateEfileStatus").toString())); - } - - // validate the optional field `stateEfileStatus` (array) - for (int i = 0; i < jsonArraystateEfileStatus.size(); i++) { - StateEfileStatusDetail.validateJsonElement(jsonArraystateEfileStatus.get(i)); - }; - } - } - // validate the optional field `postalMailStatus` - if (jsonObj.get("postalMailStatus") != null && !jsonObj.get("postalMailStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("postalMailStatus")); - } - // validate the optional field `tinMatchStatus` - if (jsonObj.get("tinMatchStatus") != null && !jsonObj.get("tinMatchStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("tinMatchStatus")); - } - // validate the optional field `addressVerificationStatus` - if (jsonObj.get("addressVerificationStatus") != null && !jsonObj.get("addressVerificationStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("addressVerificationStatus")); - } - // validate the optional field `eDeliveryStatus` - if (jsonObj.get("eDeliveryStatus") != null && !jsonObj.get("eDeliveryStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("eDeliveryStatus")); - } if ((jsonObj.get("referenceId") != null && !jsonObj.get("referenceId").isJsonNull()) && !jsonObj.get("referenceId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `referenceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("referenceId").toString())); } - if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); - } - if ((jsonObj.get("tinType") != null && !jsonObj.get("tinType").isJsonNull()) && !jsonObj.get("tinType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `tinType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tinType").toString())); - } if ((jsonObj.get("tin") != null && !jsonObj.get("tin").isJsonNull()) && !jsonObj.get("tin").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `tin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tin").toString())); } @@ -1878,17 +2731,58 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("zip") != null && !jsonObj.get("zip").isJsonNull()) && !jsonObj.get("zip").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `zip` to be a primitive type in the JSON string but got `%s`", jsonObj.get("zip").toString())); } + if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if ((jsonObj.get("accountNumber") != null && !jsonObj.get("accountNumber").isJsonNull()) && !jsonObj.get("accountNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); + } + if ((jsonObj.get("officeCode") != null && !jsonObj.get("officeCode").isJsonNull()) && !jsonObj.get("officeCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `officeCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("officeCode").toString())); + } if ((jsonObj.get("nonUsProvince") != null && !jsonObj.get("nonUsProvince").isJsonNull()) && !jsonObj.get("nonUsProvince").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `nonUsProvince` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nonUsProvince").toString())); } if ((jsonObj.get("countryCode") != null && !jsonObj.get("countryCode").isJsonNull()) && !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("accountNumber") != null && !jsonObj.get("accountNumber").isJsonNull()) && !jsonObj.get("accountNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); + // validate the optional field `stateAndLocalWithholding` + if (jsonObj.get("stateAndLocalWithholding") != null && !jsonObj.get("stateAndLocalWithholding").isJsonNull()) { + StateAndLocalWithholding.validateJsonElement(jsonObj.get("stateAndLocalWithholding")); } - if ((jsonObj.get("officeCode") != null && !jsonObj.get("officeCode").isJsonNull()) && !jsonObj.get("officeCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `officeCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("officeCode").toString())); + // validate the optional field `federalEfileStatus` + if (jsonObj.get("federalEfileStatus") != null && !jsonObj.get("federalEfileStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("federalEfileStatus")); + } + if (jsonObj.get("stateEfileStatus") != null && !jsonObj.get("stateEfileStatus").isJsonNull()) { + JsonArray jsonArraystateEfileStatus = jsonObj.getAsJsonArray("stateEfileStatus"); + if (jsonArraystateEfileStatus != null) { + // ensure the json data is an array + if (!jsonObj.get("stateEfileStatus").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `stateEfileStatus` to be an array in the JSON string but got `%s`", jsonObj.get("stateEfileStatus").toString())); + } + + // validate the optional field `stateEfileStatus` (array) + for (int i = 0; i < jsonArraystateEfileStatus.size(); i++) { + StateEfileStatusDetail.validateJsonElement(jsonArraystateEfileStatus.get(i)); + }; + } + } + // validate the optional field `postalMailStatus` + if (jsonObj.get("postalMailStatus") != null && !jsonObj.get("postalMailStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("postalMailStatus")); + } + // validate the optional field `tinMatchStatus` + if (jsonObj.get("tinMatchStatus") != null && !jsonObj.get("tinMatchStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("tinMatchStatus")); + } + // validate the optional field `addressVerificationStatus` + if (jsonObj.get("addressVerificationStatus") != null && !jsonObj.get("addressVerificationStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("addressVerificationStatus")); + } + // validate the optional field `eDeliveryStatus` + if (jsonObj.get("eDeliveryStatus") != null && !jsonObj.get("eDeliveryStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("eDeliveryStatus")); } if (jsonObj.get("validationErrors") != null && !jsonObj.get("validationErrors").isJsonNull()) { JsonArray jsonArrayvalidationErrors = jsonObj.getAsJsonArray("validationErrors"); @@ -1904,10 +2798,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti }; } } - // validate the optional field `stateAndLocalWithholding` - if (jsonObj.get("stateAndLocalWithholding") != null && !jsonObj.get("stateAndLocalWithholding").isJsonNull()) { - StateAndLocalWithholding.validateJsonElement(jsonObj.get("stateAndLocalWithholding")); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/Form1095B.java b/src/main/java/Avalara/SDK/model/A1099/V2/Form1095B.java index cbbc83c..f144f02 100644 --- a/src/main/java/Avalara/SDK/model/A1099/V2/Form1095B.java +++ b/src/main/java/Avalara/SDK/model/A1099/V2/Form1095B.java @@ -20,7 +20,7 @@ package Avalara.SDK.model.A1099.V2; import java.util.Objects; -import Avalara.SDK.model.A1099.V2.CoveredIndividualReference; +import Avalara.SDK.model.A1099.V2.CoveredIndividual; import Avalara.SDK.model.A1099.V2.Form1099StatusDetail; import Avalara.SDK.model.A1099.V2.StateAndLocalWithholding; import Avalara.SDK.model.A1099.V2.StateEfileStatusDetail; @@ -31,6 +31,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.Arrays; @@ -62,29 +63,177 @@ import Avalara.SDK.JSON; /** - * Form1095B + * Form 1095-B: Health Coverage */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class Form1095B { + public static final String SERIALIZED_NAME_EMPLOYEE_FIRST_NAME = "employeeFirstName"; + @SerializedName(SERIALIZED_NAME_EMPLOYEE_FIRST_NAME) + private String employeeFirstName; + + public static final String SERIALIZED_NAME_EMPLOYEE_MIDDLE_NAME = "employeeMiddleName"; + @SerializedName(SERIALIZED_NAME_EMPLOYEE_MIDDLE_NAME) + private String employeeMiddleName; + + public static final String SERIALIZED_NAME_EMPLOYEE_LAST_NAME = "employeeLastName"; + @SerializedName(SERIALIZED_NAME_EMPLOYEE_LAST_NAME) + private String employeeLastName; + + public static final String SERIALIZED_NAME_EMPLOYEE_NAME_SUFFIX = "employeeNameSuffix"; + @SerializedName(SERIALIZED_NAME_EMPLOYEE_NAME_SUFFIX) + private String employeeNameSuffix; + + public static final String SERIALIZED_NAME_EMPLOYEE_DATE_OF_BIRTH = "employeeDateOfBirth"; + @SerializedName(SERIALIZED_NAME_EMPLOYEE_DATE_OF_BIRTH) + private LocalDate employeeDateOfBirth; + + /** + * Origin of health coverage code Available values: - A: Small Business Health Options Program (SHOP) - B: Employer-sponsored coverage - C: Government-sponsored program - D: Individual market insurance - E: Multiemployer plan - F: Other designated minimum essential coverage - G: Employer-sponsored coverage that is an individual coverage HRA (valid for tax years 2020 and later) + */ + @JsonAdapter(OriginOfHealthCoverageCodeEnum.Adapter.class) + public enum OriginOfHealthCoverageCodeEnum { + A("A"), + + B("B"), + + C("C"), + + D("D"), + + E("E"), + + F("F"), + + G("G"); + + private String value; + + OriginOfHealthCoverageCodeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static OriginOfHealthCoverageCodeEnum fromValue(String value) { + for (OriginOfHealthCoverageCodeEnum b : OriginOfHealthCoverageCodeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final OriginOfHealthCoverageCodeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public OriginOfHealthCoverageCodeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return OriginOfHealthCoverageCodeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + OriginOfHealthCoverageCodeEnum.fromValue(value); + } + } + public static final String SERIALIZED_NAME_ORIGIN_OF_HEALTH_COVERAGE_CODE = "originOfHealthCoverageCode"; @SerializedName(SERIALIZED_NAME_ORIGIN_OF_HEALTH_COVERAGE_CODE) - private String originOfHealthCoverageCode; + private OriginOfHealthCoverageCodeEnum originOfHealthCoverageCode; public static final String SERIALIZED_NAME_COVERED_INDIVIDUALS = "coveredIndividuals"; @SerializedName(SERIALIZED_NAME_COVERED_INDIVIDUALS) - private List coveredIndividuals; + private List coveredIndividuals; - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; + /** + * Form type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + _1099_NEC("1099-NEC"), + + _1099_MISC("1099-MISC"), + + _1099_DIV("1099-DIV"), + + _1099_R("1099-R"), + + _1099_K("1099-K"), + + _1095_B("1095-B"), + + _1042_S("1042-S"), + + _1095_C("1095-C"), + + _1099_INT("1099-INT"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.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 TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) - private String type; + private TypeEnum type; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; public static final String SERIALIZED_NAME_ISSUER_ID = "issuerId"; @SerializedName(SERIALIZED_NAME_ISSUER_ID) - private Integer issuerId; + private String issuerId; public static final String SERIALIZED_NAME_ISSUER_REFERENCE_ID = "issuerReferenceId"; @SerializedName(SERIALIZED_NAME_ISSUER_REFERENCE_ID) @@ -98,81 +247,79 @@ public class Form1095B { @SerializedName(SERIALIZED_NAME_TAX_YEAR) private Integer taxYear; - public static final String SERIALIZED_NAME_FEDERAL_EFILE = "federalEfile"; - @SerializedName(SERIALIZED_NAME_FEDERAL_EFILE) - private Boolean federalEfile; - - public static final String SERIALIZED_NAME_FEDERAL_EFILE_STATUS = "federalEfileStatus"; - @SerializedName(SERIALIZED_NAME_FEDERAL_EFILE_STATUS) - private Form1099StatusDetail federalEfileStatus; - - public static final String SERIALIZED_NAME_STATE_EFILE = "stateEfile"; - @SerializedName(SERIALIZED_NAME_STATE_EFILE) - private Boolean stateEfile; - - public static final String SERIALIZED_NAME_STATE_EFILE_STATUS = "stateEfileStatus"; - @SerializedName(SERIALIZED_NAME_STATE_EFILE_STATUS) - private List stateEfileStatus; + public static final String SERIALIZED_NAME_REFERENCE_ID = "referenceId"; + @SerializedName(SERIALIZED_NAME_REFERENCE_ID) + private String referenceId; - public static final String SERIALIZED_NAME_POSTAL_MAIL = "postalMail"; - @SerializedName(SERIALIZED_NAME_POSTAL_MAIL) - private Boolean postalMail; + public static final String SERIALIZED_NAME_TIN = "tin"; + @SerializedName(SERIALIZED_NAME_TIN) + private String tin; - public static final String SERIALIZED_NAME_POSTAL_MAIL_STATUS = "postalMailStatus"; - @SerializedName(SERIALIZED_NAME_POSTAL_MAIL_STATUS) - private Form1099StatusDetail postalMailStatus; + public static final String SERIALIZED_NAME_RECIPIENT_NAME = "recipientName"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_NAME) + private String recipientName; - public static final String SERIALIZED_NAME_TIN_MATCH = "tinMatch"; - @SerializedName(SERIALIZED_NAME_TIN_MATCH) - private Boolean tinMatch; + /** + * Type of TIN (Tax ID Number) + */ + @JsonAdapter(TinTypeEnum.Adapter.class) + public enum TinTypeEnum { + EMPTY("Empty"), + + EIN("EIN"), + + SSN("SSN"), + + ITIN("ITIN"), + + ATIN("ATIN"); + + private String value; + + TinTypeEnum(String value) { + this.value = value; + } - public static final String SERIALIZED_NAME_TIN_MATCH_STATUS = "tinMatchStatus"; - @SerializedName(SERIALIZED_NAME_TIN_MATCH_STATUS) - private Form1099StatusDetail tinMatchStatus; + public String getValue() { + return value; + } - public static final String SERIALIZED_NAME_ADDRESS_VERIFICATION = "addressVerification"; - @SerializedName(SERIALIZED_NAME_ADDRESS_VERIFICATION) - private Boolean addressVerification; + @Override + public String toString() { + return String.valueOf(value); + } - public static final String SERIALIZED_NAME_ADDRESS_VERIFICATION_STATUS = "addressVerificationStatus"; - @SerializedName(SERIALIZED_NAME_ADDRESS_VERIFICATION_STATUS) - private Form1099StatusDetail addressVerificationStatus; + public static TinTypeEnum fromValue(String value) { + for (TinTypeEnum b : TinTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } - public static final String SERIALIZED_NAME_E_DELIVERY_STATUS = "eDeliveryStatus"; - @SerializedName(SERIALIZED_NAME_E_DELIVERY_STATUS) - private Form1099StatusDetail eDeliveryStatus; + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TinTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } - public static final String SERIALIZED_NAME_REFERENCE_ID = "referenceId"; - @SerializedName(SERIALIZED_NAME_REFERENCE_ID) - private String referenceId; + @Override + public TinTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TinTypeEnum.fromValue(value); + } + } - public static final String SERIALIZED_NAME_EMAIL = "email"; - @SerializedName(SERIALIZED_NAME_EMAIL) - private String email; + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TinTypeEnum.fromValue(value); + } + } public static final String SERIALIZED_NAME_TIN_TYPE = "tinType"; @SerializedName(SERIALIZED_NAME_TIN_TYPE) - private String tinType; - - public static final String SERIALIZED_NAME_FATCA_FILING_REQUIREMENT = "fatcaFilingRequirement"; - @SerializedName(SERIALIZED_NAME_FATCA_FILING_REQUIREMENT) - private Boolean fatcaFilingRequirement; - - public static final String SERIALIZED_NAME_TIN = "tin"; - @SerializedName(SERIALIZED_NAME_TIN) - private String tin; - - public static final String SERIALIZED_NAME_NO_TIN = "noTin"; - @SerializedName(SERIALIZED_NAME_NO_TIN) - private Boolean noTin; - - public static final String SERIALIZED_NAME_SECOND_TIN_NOTICE = "secondTinNotice"; - @SerializedName(SERIALIZED_NAME_SECOND_TIN_NOTICE) - private Boolean secondTinNotice; - - public static final String SERIALIZED_NAME_RECIPIENT_NAME = "recipientName"; - @SerializedName(SERIALIZED_NAME_RECIPIENT_NAME) - private String recipientName; + private TinTypeEnum tinType; public static final String SERIALIZED_NAME_RECIPIENT_SECOND_NAME = "recipientSecondName"; @SerializedName(SERIALIZED_NAME_RECIPIENT_SECOND_NAME) @@ -198,6 +345,18 @@ public class Form1095B { @SerializedName(SERIALIZED_NAME_ZIP) private String zip; + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) + private String accountNumber; + + public static final String SERIALIZED_NAME_OFFICE_CODE = "officeCode"; + @SerializedName(SERIALIZED_NAME_OFFICE_CODE) + private String officeCode; + public static final String SERIALIZED_NAME_NON_US_PROVINCE = "nonUsProvince"; @SerializedName(SERIALIZED_NAME_NON_US_PROVINCE) private String nonUsProvince; @@ -206,13 +365,65 @@ public class Form1095B { @SerializedName(SERIALIZED_NAME_COUNTRY_CODE) private String countryCode; - public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; - @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) - private String accountNumber; + public static final String SERIALIZED_NAME_FEDERAL_EFILE_DATE = "federalEfileDate"; + @SerializedName(SERIALIZED_NAME_FEDERAL_EFILE_DATE) + private LocalDate federalEfileDate; - public static final String SERIALIZED_NAME_OFFICE_CODE = "officeCode"; - @SerializedName(SERIALIZED_NAME_OFFICE_CODE) - private String officeCode; + public static final String SERIALIZED_NAME_POSTAL_MAIL = "postalMail"; + @SerializedName(SERIALIZED_NAME_POSTAL_MAIL) + private Boolean postalMail; + + public static final String SERIALIZED_NAME_STATE_EFILE_DATE = "stateEfileDate"; + @SerializedName(SERIALIZED_NAME_STATE_EFILE_DATE) + private LocalDate stateEfileDate; + + public static final String SERIALIZED_NAME_RECIPIENT_EDELIVERY_DATE = "recipientEdeliveryDate"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_EDELIVERY_DATE) + private LocalDate recipientEdeliveryDate; + + public static final String SERIALIZED_NAME_TIN_MATCH = "tinMatch"; + @SerializedName(SERIALIZED_NAME_TIN_MATCH) + private Boolean tinMatch; + + public static final String SERIALIZED_NAME_NO_TIN = "noTin"; + @SerializedName(SERIALIZED_NAME_NO_TIN) + private Boolean noTin; + + public static final String SERIALIZED_NAME_ADDRESS_VERIFICATION = "addressVerification"; + @SerializedName(SERIALIZED_NAME_ADDRESS_VERIFICATION) + private Boolean addressVerification; + + public static final String SERIALIZED_NAME_STATE_AND_LOCAL_WITHHOLDING = "stateAndLocalWithholding"; + @SerializedName(SERIALIZED_NAME_STATE_AND_LOCAL_WITHHOLDING) + private StateAndLocalWithholding stateAndLocalWithholding; + + public static final String SERIALIZED_NAME_SECOND_TIN_NOTICE = "secondTinNotice"; + @SerializedName(SERIALIZED_NAME_SECOND_TIN_NOTICE) + private Boolean secondTinNotice; + + public static final String SERIALIZED_NAME_FEDERAL_EFILE_STATUS = "federalEfileStatus"; + @SerializedName(SERIALIZED_NAME_FEDERAL_EFILE_STATUS) + private Form1099StatusDetail federalEfileStatus; + + public static final String SERIALIZED_NAME_STATE_EFILE_STATUS = "stateEfileStatus"; + @SerializedName(SERIALIZED_NAME_STATE_EFILE_STATUS) + private List stateEfileStatus; + + public static final String SERIALIZED_NAME_POSTAL_MAIL_STATUS = "postalMailStatus"; + @SerializedName(SERIALIZED_NAME_POSTAL_MAIL_STATUS) + private Form1099StatusDetail postalMailStatus; + + public static final String SERIALIZED_NAME_TIN_MATCH_STATUS = "tinMatchStatus"; + @SerializedName(SERIALIZED_NAME_TIN_MATCH_STATUS) + private Form1099StatusDetail tinMatchStatus; + + public static final String SERIALIZED_NAME_ADDRESS_VERIFICATION_STATUS = "addressVerificationStatus"; + @SerializedName(SERIALIZED_NAME_ADDRESS_VERIFICATION_STATUS) + private Form1099StatusDetail addressVerificationStatus; + + public static final String SERIALIZED_NAME_E_DELIVERY_STATUS = "eDeliveryStatus"; + @SerializedName(SERIALIZED_NAME_E_DELIVERY_STATUS) + private Form1099StatusDetail eDeliveryStatus; public static final String SERIALIZED_NAME_VALIDATION_ERRORS = "validationErrors"; @SerializedName(SERIALIZED_NAME_VALIDATION_ERRORS) @@ -226,38 +437,154 @@ public class Form1095B { @SerializedName(SERIALIZED_NAME_UPDATED_AT) private OffsetDateTime updatedAt; - public static final String SERIALIZED_NAME_STATE_AND_LOCAL_WITHHOLDING = "stateAndLocalWithholding"; - @SerializedName(SERIALIZED_NAME_STATE_AND_LOCAL_WITHHOLDING) - private StateAndLocalWithholding stateAndLocalWithholding; - public Form1095B() { } - public Form1095B originOfHealthCoverageCode(String originOfHealthCoverageCode) { + public Form1095B( + String id, + Form1099StatusDetail federalEfileStatus, + List stateEfileStatus, + Form1099StatusDetail postalMailStatus, + Form1099StatusDetail tinMatchStatus, + Form1099StatusDetail addressVerificationStatus, + Form1099StatusDetail eDeliveryStatus, + List validationErrors, + OffsetDateTime createdAt, + OffsetDateTime updatedAt + ) { + this(); + this.id = id; + this.federalEfileStatus = federalEfileStatus; + this.stateEfileStatus = stateEfileStatus; + this.postalMailStatus = postalMailStatus; + this.tinMatchStatus = tinMatchStatus; + this.addressVerificationStatus = addressVerificationStatus; + this.eDeliveryStatus = eDeliveryStatus; + this.validationErrors = validationErrors; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + + public Form1095B employeeFirstName(String employeeFirstName) { + this.employeeFirstName = employeeFirstName; + return this; + } + + /** + * Employee's first name + * @return employeeFirstName + */ + @javax.annotation.Nullable + public String getEmployeeFirstName() { + return employeeFirstName; + } + + public void setEmployeeFirstName(String employeeFirstName) { + this.employeeFirstName = employeeFirstName; + } + + + public Form1095B employeeMiddleName(String employeeMiddleName) { + this.employeeMiddleName = employeeMiddleName; + return this; + } + + /** + * Employee's middle name + * @return employeeMiddleName + */ + @javax.annotation.Nullable + public String getEmployeeMiddleName() { + return employeeMiddleName; + } + + public void setEmployeeMiddleName(String employeeMiddleName) { + this.employeeMiddleName = employeeMiddleName; + } + + + public Form1095B employeeLastName(String employeeLastName) { + this.employeeLastName = employeeLastName; + return this; + } + + /** + * Employee's last name + * @return employeeLastName + */ + @javax.annotation.Nullable + public String getEmployeeLastName() { + return employeeLastName; + } + + public void setEmployeeLastName(String employeeLastName) { + this.employeeLastName = employeeLastName; + } + + + public Form1095B employeeNameSuffix(String employeeNameSuffix) { + this.employeeNameSuffix = employeeNameSuffix; + return this; + } + + /** + * Employee's name suffix + * @return employeeNameSuffix + */ + @javax.annotation.Nullable + public String getEmployeeNameSuffix() { + return employeeNameSuffix; + } + + public void setEmployeeNameSuffix(String employeeNameSuffix) { + this.employeeNameSuffix = employeeNameSuffix; + } + + + public Form1095B employeeDateOfBirth(LocalDate employeeDateOfBirth) { + this.employeeDateOfBirth = employeeDateOfBirth; + return this; + } + + /** + * Employee's date of birth + * @return employeeDateOfBirth + */ + @javax.annotation.Nullable + public LocalDate getEmployeeDateOfBirth() { + return employeeDateOfBirth; + } + + public void setEmployeeDateOfBirth(LocalDate employeeDateOfBirth) { + this.employeeDateOfBirth = employeeDateOfBirth; + } + + + public Form1095B originOfHealthCoverageCode(OriginOfHealthCoverageCodeEnum originOfHealthCoverageCode) { this.originOfHealthCoverageCode = originOfHealthCoverageCode; return this; } /** - * Get originOfHealthCoverageCode + * Origin of health coverage code Available values: - A: Small Business Health Options Program (SHOP) - B: Employer-sponsored coverage - C: Government-sponsored program - D: Individual market insurance - E: Multiemployer plan - F: Other designated minimum essential coverage - G: Employer-sponsored coverage that is an individual coverage HRA (valid for tax years 2020 and later) * @return originOfHealthCoverageCode */ @javax.annotation.Nullable - public String getOriginOfHealthCoverageCode() { + public OriginOfHealthCoverageCodeEnum getOriginOfHealthCoverageCode() { return originOfHealthCoverageCode; } - public void setOriginOfHealthCoverageCode(String originOfHealthCoverageCode) { + public void setOriginOfHealthCoverageCode(OriginOfHealthCoverageCodeEnum originOfHealthCoverageCode) { this.originOfHealthCoverageCode = originOfHealthCoverageCode; } - public Form1095B coveredIndividuals(List coveredIndividuals) { + public Form1095B coveredIndividuals(List coveredIndividuals) { this.coveredIndividuals = coveredIndividuals; return this; } - public Form1095B addCoveredIndividualsItem(CoveredIndividualReference coveredIndividualsItem) { + public Form1095B addCoveredIndividualsItem(CoveredIndividual coveredIndividualsItem) { if (this.coveredIndividuals == null) { this.coveredIndividuals = new ArrayList<>(); } @@ -266,72 +593,64 @@ public Form1095B addCoveredIndividualsItem(CoveredIndividualReference coveredInd } /** - * Get coveredIndividuals + * Covered individuals information - At least one month of coverage must be entered if it's not a correction. * @return coveredIndividuals */ @javax.annotation.Nullable - public List getCoveredIndividuals() { + public List getCoveredIndividuals() { return coveredIndividuals; } - public void setCoveredIndividuals(List coveredIndividuals) { + public void setCoveredIndividuals(List coveredIndividuals) { this.coveredIndividuals = coveredIndividuals; } - public Form1095B id(String id) { - this.id = id; + public Form1095B type(TypeEnum type) { + this.type = type; return this; } /** - * Get id - * @return id + * Form type + * @return type */ - @javax.annotation.Nullable - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; } - - public Form1095B type(String type) { + public void setType(TypeEnum type) { this.type = type; - return this; } + /** - * Get type - * @return type + * Form ID. Unique identifier set when the record is created. + * @return id */ @javax.annotation.Nullable - public String getType() { - return type; + public String getId() { + return id; } - public void setType(String type) { - this.type = type; - } - public Form1095B issuerId(Integer issuerId) { + public Form1095B issuerId(String issuerId) { this.issuerId = issuerId; return this; } /** - * Get issuerId + * Issuer ID - only required when creating forms * @return issuerId */ @javax.annotation.Nullable - public Integer getIssuerId() { + public String getIssuerId() { return issuerId; } - public void setIssuerId(Integer issuerId) { + public void setIssuerId(String issuerId) { this.issuerId = issuerId; } @@ -342,7 +661,7 @@ public Form1095B issuerReferenceId(String issuerReferenceId) { } /** - * Get issuerReferenceId + * Issuer Reference ID - only required when creating forms * @return issuerReferenceId */ @javax.annotation.Nullable @@ -361,7 +680,7 @@ public Form1095B issuerTin(String issuerTin) { } /** - * Get issuerTin + * Issuer TIN - readonly * @return issuerTin */ @javax.annotation.Nullable @@ -380,7 +699,7 @@ public Form1095B taxYear(Integer taxYear) { } /** - * Get taxYear + * Tax Year - only required when creating forms * @return taxYear */ @javax.annotation.Nullable @@ -393,239 +712,193 @@ public void setTaxYear(Integer taxYear) { } - public Form1095B federalEfile(Boolean federalEfile) { - this.federalEfile = federalEfile; - return this; - } - - /** - * Get federalEfile - * @return federalEfile - */ - @javax.annotation.Nullable - public Boolean getFederalEfile() { - return federalEfile; - } - - public void setFederalEfile(Boolean federalEfile) { - this.federalEfile = federalEfile; - } - - - public Form1095B federalEfileStatus(Form1099StatusDetail federalEfileStatus) { - this.federalEfileStatus = federalEfileStatus; - return this; - } - - /** - * Get federalEfileStatus - * @return federalEfileStatus - */ - @javax.annotation.Nullable - public Form1099StatusDetail getFederalEfileStatus() { - return federalEfileStatus; - } - - public void setFederalEfileStatus(Form1099StatusDetail federalEfileStatus) { - this.federalEfileStatus = federalEfileStatus; - } - - - public Form1095B stateEfile(Boolean stateEfile) { - this.stateEfile = stateEfile; + public Form1095B referenceId(String referenceId) { + this.referenceId = referenceId; return this; } /** - * Get stateEfile - * @return stateEfile + * Internal reference ID. Never shown to any agency or recipient. + * @return referenceId */ @javax.annotation.Nullable - public Boolean getStateEfile() { - return stateEfile; + public String getReferenceId() { + return referenceId; } - public void setStateEfile(Boolean stateEfile) { - this.stateEfile = stateEfile; + public void setReferenceId(String referenceId) { + this.referenceId = referenceId; } - public Form1095B stateEfileStatus(List stateEfileStatus) { - this.stateEfileStatus = stateEfileStatus; - return this; - } - - public Form1095B addStateEfileStatusItem(StateEfileStatusDetail stateEfileStatusItem) { - if (this.stateEfileStatus == null) { - this.stateEfileStatus = new ArrayList<>(); - } - this.stateEfileStatus.add(stateEfileStatusItem); + public Form1095B tin(String tin) { + this.tin = tin; return this; } /** - * Get stateEfileStatus - * @return stateEfileStatus + * Recipient's Federal Tax Identification Number (TIN). + * @return tin */ @javax.annotation.Nullable - public List getStateEfileStatus() { - return stateEfileStatus; + public String getTin() { + return tin; } - public void setStateEfileStatus(List stateEfileStatus) { - this.stateEfileStatus = stateEfileStatus; + public void setTin(String tin) { + this.tin = tin; } - public Form1095B postalMail(Boolean postalMail) { - this.postalMail = postalMail; + public Form1095B recipientName(String recipientName) { + this.recipientName = recipientName; return this; } /** - * Get postalMail - * @return postalMail + * Recipient name + * @return recipientName */ @javax.annotation.Nullable - public Boolean getPostalMail() { - return postalMail; + public String getRecipientName() { + return recipientName; } - public void setPostalMail(Boolean postalMail) { - this.postalMail = postalMail; + public void setRecipientName(String recipientName) { + this.recipientName = recipientName; } - public Form1095B postalMailStatus(Form1099StatusDetail postalMailStatus) { - this.postalMailStatus = postalMailStatus; + public Form1095B tinType(TinTypeEnum tinType) { + this.tinType = tinType; return this; } /** - * Get postalMailStatus - * @return postalMailStatus + * Type of TIN (Tax ID Number) + * @return tinType */ @javax.annotation.Nullable - public Form1099StatusDetail getPostalMailStatus() { - return postalMailStatus; + public TinTypeEnum getTinType() { + return tinType; } - public void setPostalMailStatus(Form1099StatusDetail postalMailStatus) { - this.postalMailStatus = postalMailStatus; + public void setTinType(TinTypeEnum tinType) { + this.tinType = tinType; } - public Form1095B tinMatch(Boolean tinMatch) { - this.tinMatch = tinMatch; + public Form1095B recipientSecondName(String recipientSecondName) { + this.recipientSecondName = recipientSecondName; return this; } /** - * Get tinMatch - * @return tinMatch + * Recipient second name + * @return recipientSecondName */ @javax.annotation.Nullable - public Boolean getTinMatch() { - return tinMatch; + public String getRecipientSecondName() { + return recipientSecondName; } - public void setTinMatch(Boolean tinMatch) { - this.tinMatch = tinMatch; + public void setRecipientSecondName(String recipientSecondName) { + this.recipientSecondName = recipientSecondName; } - public Form1095B tinMatchStatus(Form1099StatusDetail tinMatchStatus) { - this.tinMatchStatus = tinMatchStatus; + public Form1095B address(String address) { + this.address = address; return this; } /** - * Get tinMatchStatus - * @return tinMatchStatus + * Address. + * @return address */ @javax.annotation.Nullable - public Form1099StatusDetail getTinMatchStatus() { - return tinMatchStatus; + public String getAddress() { + return address; } - public void setTinMatchStatus(Form1099StatusDetail tinMatchStatus) { - this.tinMatchStatus = tinMatchStatus; + public void setAddress(String address) { + this.address = address; } - public Form1095B addressVerification(Boolean addressVerification) { - this.addressVerification = addressVerification; + public Form1095B address2(String address2) { + this.address2 = address2; return this; } /** - * Get addressVerification - * @return addressVerification + * Address line 2. + * @return address2 */ @javax.annotation.Nullable - public Boolean getAddressVerification() { - return addressVerification; + public String getAddress2() { + return address2; } - public void setAddressVerification(Boolean addressVerification) { - this.addressVerification = addressVerification; + public void setAddress2(String address2) { + this.address2 = address2; } - public Form1095B addressVerificationStatus(Form1099StatusDetail addressVerificationStatus) { - this.addressVerificationStatus = addressVerificationStatus; + public Form1095B city(String city) { + this.city = city; return this; } /** - * Get addressVerificationStatus - * @return addressVerificationStatus + * City. + * @return city */ @javax.annotation.Nullable - public Form1099StatusDetail getAddressVerificationStatus() { - return addressVerificationStatus; + public String getCity() { + return city; } - public void setAddressVerificationStatus(Form1099StatusDetail addressVerificationStatus) { - this.addressVerificationStatus = addressVerificationStatus; + public void setCity(String city) { + this.city = city; } - public Form1095B eDeliveryStatus(Form1099StatusDetail eDeliveryStatus) { - this.eDeliveryStatus = eDeliveryStatus; + public Form1095B state(String state) { + this.state = state; return this; } /** - * Get eDeliveryStatus - * @return eDeliveryStatus + * Two-letter US state or Canadian province code (required for US/CA addresses). + * @return state */ @javax.annotation.Nullable - public Form1099StatusDetail geteDeliveryStatus() { - return eDeliveryStatus; + public String getState() { + return state; } - public void seteDeliveryStatus(Form1099StatusDetail eDeliveryStatus) { - this.eDeliveryStatus = eDeliveryStatus; + public void setState(String state) { + this.state = state; } - public Form1095B referenceId(String referenceId) { - this.referenceId = referenceId; + public Form1095B zip(String zip) { + this.zip = zip; return this; } /** - * Get referenceId - * @return referenceId + * ZIP/postal code. + * @return zip */ @javax.annotation.Nullable - public String getReferenceId() { - return referenceId; + public String getZip() { + return zip; } - public void setReferenceId(String referenceId) { - this.referenceId = referenceId; + public void setZip(String zip) { + this.zip = zip; } @@ -635,7 +908,7 @@ public Form1095B email(String email) { } /** - * Get email + * Recipient's Contact email address. * @return email */ @javax.annotation.Nullable @@ -648,325 +921,321 @@ public void setEmail(String email) { } - public Form1095B tinType(String tinType) { - this.tinType = tinType; + public Form1095B accountNumber(String accountNumber) { + this.accountNumber = accountNumber; return this; } /** - * Get tinType - * @return tinType + * Account number + * @return accountNumber */ @javax.annotation.Nullable - public String getTinType() { - return tinType; + public String getAccountNumber() { + return accountNumber; } - public void setTinType(String tinType) { - this.tinType = tinType; + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; } - public Form1095B fatcaFilingRequirement(Boolean fatcaFilingRequirement) { - this.fatcaFilingRequirement = fatcaFilingRequirement; + public Form1095B officeCode(String officeCode) { + this.officeCode = officeCode; return this; } /** - * Get fatcaFilingRequirement - * @return fatcaFilingRequirement + * Office code + * @return officeCode */ @javax.annotation.Nullable - public Boolean getFatcaFilingRequirement() { - return fatcaFilingRequirement; + public String getOfficeCode() { + return officeCode; } - public void setFatcaFilingRequirement(Boolean fatcaFilingRequirement) { - this.fatcaFilingRequirement = fatcaFilingRequirement; + public void setOfficeCode(String officeCode) { + this.officeCode = officeCode; } - public Form1095B tin(String tin) { - this.tin = tin; + public Form1095B nonUsProvince(String nonUsProvince) { + this.nonUsProvince = nonUsProvince; return this; } /** - * Get tin - * @return tin + * Province or region for non-US/CA addresses. + * @return nonUsProvince */ @javax.annotation.Nullable - public String getTin() { - return tin; + public String getNonUsProvince() { + return nonUsProvince; } - public void setTin(String tin) { - this.tin = tin; + public void setNonUsProvince(String nonUsProvince) { + this.nonUsProvince = nonUsProvince; } - public Form1095B noTin(Boolean noTin) { - this.noTin = noTin; + public Form1095B countryCode(String countryCode) { + this.countryCode = countryCode; return this; } /** - * Get noTin - * @return noTin + * Two-letter IRS country code (e.g., 'US', 'CA'), as defined at https://www.irs.gov/e-file-providers/country-codes. + * @return countryCode */ @javax.annotation.Nullable - public Boolean getNoTin() { - return noTin; + public String getCountryCode() { + return countryCode; } - public void setNoTin(Boolean noTin) { - this.noTin = noTin; + public void setCountryCode(String countryCode) { + this.countryCode = countryCode; } - public Form1095B secondTinNotice(Boolean secondTinNotice) { - this.secondTinNotice = secondTinNotice; + public Form1095B federalEfileDate(LocalDate federalEfileDate) { + this.federalEfileDate = federalEfileDate; return this; } /** - * Get secondTinNotice - * @return secondTinNotice + * Date when federal e-filing should be scheduled for this form + * @return federalEfileDate */ @javax.annotation.Nullable - public Boolean getSecondTinNotice() { - return secondTinNotice; + public LocalDate getFederalEfileDate() { + return federalEfileDate; } - public void setSecondTinNotice(Boolean secondTinNotice) { - this.secondTinNotice = secondTinNotice; + public void setFederalEfileDate(LocalDate federalEfileDate) { + this.federalEfileDate = federalEfileDate; } - public Form1095B recipientName(String recipientName) { - this.recipientName = recipientName; + public Form1095B postalMail(Boolean postalMail) { + this.postalMail = postalMail; return this; } /** - * Get recipientName - * @return recipientName + * Boolean indicating that postal mailing to the recipient should be scheduled for this form + * @return postalMail */ @javax.annotation.Nullable - public String getRecipientName() { - return recipientName; + public Boolean getPostalMail() { + return postalMail; } - public void setRecipientName(String recipientName) { - this.recipientName = recipientName; + public void setPostalMail(Boolean postalMail) { + this.postalMail = postalMail; } - public Form1095B recipientSecondName(String recipientSecondName) { - this.recipientSecondName = recipientSecondName; + public Form1095B stateEfileDate(LocalDate stateEfileDate) { + this.stateEfileDate = stateEfileDate; return this; } /** - * Get recipientSecondName - * @return recipientSecondName + * Date when state e-filing should be scheduled for this form + * @return stateEfileDate */ @javax.annotation.Nullable - public String getRecipientSecondName() { - return recipientSecondName; + public LocalDate getStateEfileDate() { + return stateEfileDate; } - public void setRecipientSecondName(String recipientSecondName) { - this.recipientSecondName = recipientSecondName; + public void setStateEfileDate(LocalDate stateEfileDate) { + this.stateEfileDate = stateEfileDate; } - public Form1095B address(String address) { - this.address = address; + public Form1095B recipientEdeliveryDate(LocalDate recipientEdeliveryDate) { + this.recipientEdeliveryDate = recipientEdeliveryDate; return this; } /** - * Get address - * @return address + * Date when recipient e-delivery should be scheduled for this form + * @return recipientEdeliveryDate */ @javax.annotation.Nullable - public String getAddress() { - return address; + public LocalDate getRecipientEdeliveryDate() { + return recipientEdeliveryDate; } - public void setAddress(String address) { - this.address = address; + public void setRecipientEdeliveryDate(LocalDate recipientEdeliveryDate) { + this.recipientEdeliveryDate = recipientEdeliveryDate; } - public Form1095B address2(String address2) { - this.address2 = address2; + public Form1095B tinMatch(Boolean tinMatch) { + this.tinMatch = tinMatch; return this; } /** - * Get address2 - * @return address2 + * Boolean indicating that TIN Matching should be scheduled for this form + * @return tinMatch */ @javax.annotation.Nullable - public String getAddress2() { - return address2; + public Boolean getTinMatch() { + return tinMatch; } - public void setAddress2(String address2) { - this.address2 = address2; + public void setTinMatch(Boolean tinMatch) { + this.tinMatch = tinMatch; } - public Form1095B city(String city) { - this.city = city; + public Form1095B noTin(Boolean noTin) { + this.noTin = noTin; return this; } /** - * Get city - * @return city + * No TIN indicator + * @return noTin */ @javax.annotation.Nullable - public String getCity() { - return city; + public Boolean getNoTin() { + return noTin; } - public void setCity(String city) { - this.city = city; + public void setNoTin(Boolean noTin) { + this.noTin = noTin; } - public Form1095B state(String state) { - this.state = state; + public Form1095B addressVerification(Boolean addressVerification) { + this.addressVerification = addressVerification; return this; } /** - * Get state - * @return state + * Boolean indicating that address verification should be scheduled for this form + * @return addressVerification */ @javax.annotation.Nullable - public String getState() { - return state; + public Boolean getAddressVerification() { + return addressVerification; } - public void setState(String state) { - this.state = state; + public void setAddressVerification(Boolean addressVerification) { + this.addressVerification = addressVerification; } - public Form1095B zip(String zip) { - this.zip = zip; + public Form1095B stateAndLocalWithholding(StateAndLocalWithholding stateAndLocalWithholding) { + this.stateAndLocalWithholding = stateAndLocalWithholding; return this; } /** - * Get zip - * @return zip + * State and local withholding information + * @return stateAndLocalWithholding */ @javax.annotation.Nullable - public String getZip() { - return zip; + public StateAndLocalWithholding getStateAndLocalWithholding() { + return stateAndLocalWithholding; } - public void setZip(String zip) { - this.zip = zip; + public void setStateAndLocalWithholding(StateAndLocalWithholding stateAndLocalWithholding) { + this.stateAndLocalWithholding = stateAndLocalWithholding; } - public Form1095B nonUsProvince(String nonUsProvince) { - this.nonUsProvince = nonUsProvince; + public Form1095B secondTinNotice(Boolean secondTinNotice) { + this.secondTinNotice = secondTinNotice; return this; } /** - * Get nonUsProvince - * @return nonUsProvince + * Second TIN notice + * @return secondTinNotice */ @javax.annotation.Nullable - public String getNonUsProvince() { - return nonUsProvince; + public Boolean getSecondTinNotice() { + return secondTinNotice; } - public void setNonUsProvince(String nonUsProvince) { - this.nonUsProvince = nonUsProvince; + public void setSecondTinNotice(Boolean secondTinNotice) { + this.secondTinNotice = secondTinNotice; } - public Form1095B countryCode(String countryCode) { - this.countryCode = countryCode; - return this; + /** + * Federal e-file status + * @return federalEfileStatus + */ + @javax.annotation.Nullable + public Form1099StatusDetail getFederalEfileStatus() { + return federalEfileStatus; } + + /** - * Get countryCode - * @return countryCode + * State e-file status + * @return stateEfileStatus */ @javax.annotation.Nullable - public String getCountryCode() { - return countryCode; + public List getStateEfileStatus() { + return stateEfileStatus; } - public void setCountryCode(String countryCode) { - this.countryCode = countryCode; - } - public Form1095B accountNumber(String accountNumber) { - this.accountNumber = accountNumber; - return this; + /** + * Postal mail to recipient status + * @return postalMailStatus + */ + @javax.annotation.Nullable + public Form1099StatusDetail getPostalMailStatus() { + return postalMailStatus; } + + /** - * Get accountNumber - * @return accountNumber + * TIN Match status + * @return tinMatchStatus */ @javax.annotation.Nullable - public String getAccountNumber() { - return accountNumber; + public Form1099StatusDetail getTinMatchStatus() { + return tinMatchStatus; } - public void setAccountNumber(String accountNumber) { - this.accountNumber = accountNumber; - } - public Form1095B officeCode(String officeCode) { - this.officeCode = officeCode; - return this; + /** + * Address verification status + * @return addressVerificationStatus + */ + @javax.annotation.Nullable + public Form1099StatusDetail getAddressVerificationStatus() { + return addressVerificationStatus; } + + /** - * Get officeCode - * @return officeCode + * EDelivery status + * @return eDeliveryStatus */ @javax.annotation.Nullable - public String getOfficeCode() { - return officeCode; - } - - public void setOfficeCode(String officeCode) { - this.officeCode = officeCode; + public Form1099StatusDetail geteDeliveryStatus() { + return eDeliveryStatus; } - public Form1095B validationErrors(List validationErrors) { - this.validationErrors = validationErrors; - return this; - } - - public Form1095B addValidationErrorsItem(ValidationError validationErrorsItem) { - if (this.validationErrors == null) { - this.validationErrors = new ArrayList<>(); - } - this.validationErrors.add(validationErrorsItem); - return this; - } /** - * Get validationErrors + * Validation errors * @return validationErrors */ @javax.annotation.Nullable @@ -974,18 +1243,10 @@ public List getValidationErrors() { return validationErrors; } - public void setValidationErrors(List validationErrors) { - this.validationErrors = validationErrors; - } - - public Form1095B createdAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - return this; - } /** - * Get createdAt + * Date time when the record was created. * @return createdAt */ @javax.annotation.Nullable @@ -993,18 +1254,10 @@ public OffsetDateTime getCreatedAt() { return createdAt; } - public void setCreatedAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - } - - public Form1095B updatedAt(OffsetDateTime updatedAt) { - this.updatedAt = updatedAt; - return this; - } /** - * Get updatedAt + * Date time when the record was last updated. * @return updatedAt */ @javax.annotation.Nullable @@ -1012,28 +1265,6 @@ public OffsetDateTime getUpdatedAt() { return updatedAt; } - public void setUpdatedAt(OffsetDateTime updatedAt) { - this.updatedAt = updatedAt; - } - - - public Form1095B stateAndLocalWithholding(StateAndLocalWithholding stateAndLocalWithholding) { - this.stateAndLocalWithholding = stateAndLocalWithholding; - return this; - } - - /** - * Get stateAndLocalWithholding - * @return stateAndLocalWithholding - */ - @javax.annotation.Nullable - public StateAndLocalWithholding getStateAndLocalWithholding() { - return stateAndLocalWithholding; - } - - public void setStateAndLocalWithholding(StateAndLocalWithholding stateAndLocalWithholding) { - this.stateAndLocalWithholding = stateAndLocalWithholding; - } @@ -1046,47 +1277,52 @@ public boolean equals(Object o) { return false; } Form1095B form1095B = (Form1095B) o; - return Objects.equals(this.originOfHealthCoverageCode, form1095B.originOfHealthCoverageCode) && + return Objects.equals(this.employeeFirstName, form1095B.employeeFirstName) && + Objects.equals(this.employeeMiddleName, form1095B.employeeMiddleName) && + Objects.equals(this.employeeLastName, form1095B.employeeLastName) && + Objects.equals(this.employeeNameSuffix, form1095B.employeeNameSuffix) && + Objects.equals(this.employeeDateOfBirth, form1095B.employeeDateOfBirth) && + Objects.equals(this.originOfHealthCoverageCode, form1095B.originOfHealthCoverageCode) && Objects.equals(this.coveredIndividuals, form1095B.coveredIndividuals) && - Objects.equals(this.id, form1095B.id) && Objects.equals(this.type, form1095B.type) && + Objects.equals(this.id, form1095B.id) && Objects.equals(this.issuerId, form1095B.issuerId) && Objects.equals(this.issuerReferenceId, form1095B.issuerReferenceId) && Objects.equals(this.issuerTin, form1095B.issuerTin) && Objects.equals(this.taxYear, form1095B.taxYear) && - Objects.equals(this.federalEfile, form1095B.federalEfile) && - Objects.equals(this.federalEfileStatus, form1095B.federalEfileStatus) && - Objects.equals(this.stateEfile, form1095B.stateEfile) && - Objects.equals(this.stateEfileStatus, form1095B.stateEfileStatus) && - Objects.equals(this.postalMail, form1095B.postalMail) && - Objects.equals(this.postalMailStatus, form1095B.postalMailStatus) && - Objects.equals(this.tinMatch, form1095B.tinMatch) && - Objects.equals(this.tinMatchStatus, form1095B.tinMatchStatus) && - Objects.equals(this.addressVerification, form1095B.addressVerification) && - Objects.equals(this.addressVerificationStatus, form1095B.addressVerificationStatus) && - Objects.equals(this.eDeliveryStatus, form1095B.eDeliveryStatus) && Objects.equals(this.referenceId, form1095B.referenceId) && - Objects.equals(this.email, form1095B.email) && - Objects.equals(this.tinType, form1095B.tinType) && - Objects.equals(this.fatcaFilingRequirement, form1095B.fatcaFilingRequirement) && Objects.equals(this.tin, form1095B.tin) && - Objects.equals(this.noTin, form1095B.noTin) && - Objects.equals(this.secondTinNotice, form1095B.secondTinNotice) && Objects.equals(this.recipientName, form1095B.recipientName) && + Objects.equals(this.tinType, form1095B.tinType) && Objects.equals(this.recipientSecondName, form1095B.recipientSecondName) && Objects.equals(this.address, form1095B.address) && Objects.equals(this.address2, form1095B.address2) && Objects.equals(this.city, form1095B.city) && Objects.equals(this.state, form1095B.state) && Objects.equals(this.zip, form1095B.zip) && - Objects.equals(this.nonUsProvince, form1095B.nonUsProvince) && - Objects.equals(this.countryCode, form1095B.countryCode) && + Objects.equals(this.email, form1095B.email) && Objects.equals(this.accountNumber, form1095B.accountNumber) && Objects.equals(this.officeCode, form1095B.officeCode) && + Objects.equals(this.nonUsProvince, form1095B.nonUsProvince) && + Objects.equals(this.countryCode, form1095B.countryCode) && + Objects.equals(this.federalEfileDate, form1095B.federalEfileDate) && + Objects.equals(this.postalMail, form1095B.postalMail) && + Objects.equals(this.stateEfileDate, form1095B.stateEfileDate) && + Objects.equals(this.recipientEdeliveryDate, form1095B.recipientEdeliveryDate) && + Objects.equals(this.tinMatch, form1095B.tinMatch) && + Objects.equals(this.noTin, form1095B.noTin) && + Objects.equals(this.addressVerification, form1095B.addressVerification) && + Objects.equals(this.stateAndLocalWithholding, form1095B.stateAndLocalWithholding) && + Objects.equals(this.secondTinNotice, form1095B.secondTinNotice) && + Objects.equals(this.federalEfileStatus, form1095B.federalEfileStatus) && + Objects.equals(this.stateEfileStatus, form1095B.stateEfileStatus) && + Objects.equals(this.postalMailStatus, form1095B.postalMailStatus) && + Objects.equals(this.tinMatchStatus, form1095B.tinMatchStatus) && + Objects.equals(this.addressVerificationStatus, form1095B.addressVerificationStatus) && + Objects.equals(this.eDeliveryStatus, form1095B.eDeliveryStatus) && Objects.equals(this.validationErrors, form1095B.validationErrors) && Objects.equals(this.createdAt, form1095B.createdAt) && - Objects.equals(this.updatedAt, form1095B.updatedAt) && - Objects.equals(this.stateAndLocalWithholding, form1095B.stateAndLocalWithholding); + Objects.equals(this.updatedAt, form1095B.updatedAt); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -1095,7 +1331,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(originOfHealthCoverageCode, coveredIndividuals, id, type, issuerId, issuerReferenceId, issuerTin, taxYear, federalEfile, federalEfileStatus, stateEfile, stateEfileStatus, postalMail, postalMailStatus, tinMatch, tinMatchStatus, addressVerification, addressVerificationStatus, eDeliveryStatus, referenceId, email, tinType, fatcaFilingRequirement, tin, noTin, secondTinNotice, recipientName, recipientSecondName, address, address2, city, state, zip, nonUsProvince, countryCode, accountNumber, officeCode, validationErrors, createdAt, updatedAt, stateAndLocalWithholding); + return Objects.hash(employeeFirstName, employeeMiddleName, employeeLastName, employeeNameSuffix, employeeDateOfBirth, originOfHealthCoverageCode, coveredIndividuals, type, id, issuerId, issuerReferenceId, issuerTin, taxYear, referenceId, tin, recipientName, tinType, recipientSecondName, address, address2, city, state, zip, email, accountNumber, officeCode, nonUsProvince, countryCode, federalEfileDate, postalMail, stateEfileDate, recipientEdeliveryDate, tinMatch, noTin, addressVerification, stateAndLocalWithholding, secondTinNotice, federalEfileStatus, stateEfileStatus, postalMailStatus, tinMatchStatus, addressVerificationStatus, eDeliveryStatus, validationErrors, createdAt, updatedAt); } private static int hashCodeNullable(JsonNullable a) { @@ -1109,47 +1345,52 @@ private static int hashCodeNullable(JsonNullable a) { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Form1095B {\n"); + sb.append(" employeeFirstName: ").append(toIndentedString(employeeFirstName)).append("\n"); + sb.append(" employeeMiddleName: ").append(toIndentedString(employeeMiddleName)).append("\n"); + sb.append(" employeeLastName: ").append(toIndentedString(employeeLastName)).append("\n"); + sb.append(" employeeNameSuffix: ").append(toIndentedString(employeeNameSuffix)).append("\n"); + sb.append(" employeeDateOfBirth: ").append(toIndentedString(employeeDateOfBirth)).append("\n"); sb.append(" originOfHealthCoverageCode: ").append(toIndentedString(originOfHealthCoverageCode)).append("\n"); sb.append(" coveredIndividuals: ").append(toIndentedString(coveredIndividuals)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" issuerId: ").append(toIndentedString(issuerId)).append("\n"); sb.append(" issuerReferenceId: ").append(toIndentedString(issuerReferenceId)).append("\n"); sb.append(" issuerTin: ").append(toIndentedString(issuerTin)).append("\n"); sb.append(" taxYear: ").append(toIndentedString(taxYear)).append("\n"); - sb.append(" federalEfile: ").append(toIndentedString(federalEfile)).append("\n"); - sb.append(" federalEfileStatus: ").append(toIndentedString(federalEfileStatus)).append("\n"); - sb.append(" stateEfile: ").append(toIndentedString(stateEfile)).append("\n"); - sb.append(" stateEfileStatus: ").append(toIndentedString(stateEfileStatus)).append("\n"); - sb.append(" postalMail: ").append(toIndentedString(postalMail)).append("\n"); - sb.append(" postalMailStatus: ").append(toIndentedString(postalMailStatus)).append("\n"); - sb.append(" tinMatch: ").append(toIndentedString(tinMatch)).append("\n"); - sb.append(" tinMatchStatus: ").append(toIndentedString(tinMatchStatus)).append("\n"); - sb.append(" addressVerification: ").append(toIndentedString(addressVerification)).append("\n"); - sb.append(" addressVerificationStatus: ").append(toIndentedString(addressVerificationStatus)).append("\n"); - sb.append(" eDeliveryStatus: ").append(toIndentedString(eDeliveryStatus)).append("\n"); sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" tinType: ").append(toIndentedString(tinType)).append("\n"); - sb.append(" fatcaFilingRequirement: ").append(toIndentedString(fatcaFilingRequirement)).append("\n"); sb.append(" tin: ").append(toIndentedString(tin)).append("\n"); - sb.append(" noTin: ").append(toIndentedString(noTin)).append("\n"); - sb.append(" secondTinNotice: ").append(toIndentedString(secondTinNotice)).append("\n"); sb.append(" recipientName: ").append(toIndentedString(recipientName)).append("\n"); + sb.append(" tinType: ").append(toIndentedString(tinType)).append("\n"); sb.append(" recipientSecondName: ").append(toIndentedString(recipientSecondName)).append("\n"); sb.append(" address: ").append(toIndentedString(address)).append("\n"); sb.append(" address2: ").append(toIndentedString(address2)).append("\n"); sb.append(" city: ").append(toIndentedString(city)).append("\n"); sb.append(" state: ").append(toIndentedString(state)).append("\n"); sb.append(" zip: ").append(toIndentedString(zip)).append("\n"); - sb.append(" nonUsProvince: ").append(toIndentedString(nonUsProvince)).append("\n"); - sb.append(" countryCode: ").append(toIndentedString(countryCode)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); sb.append(" officeCode: ").append(toIndentedString(officeCode)).append("\n"); + sb.append(" nonUsProvince: ").append(toIndentedString(nonUsProvince)).append("\n"); + sb.append(" countryCode: ").append(toIndentedString(countryCode)).append("\n"); + sb.append(" federalEfileDate: ").append(toIndentedString(federalEfileDate)).append("\n"); + sb.append(" postalMail: ").append(toIndentedString(postalMail)).append("\n"); + sb.append(" stateEfileDate: ").append(toIndentedString(stateEfileDate)).append("\n"); + sb.append(" recipientEdeliveryDate: ").append(toIndentedString(recipientEdeliveryDate)).append("\n"); + sb.append(" tinMatch: ").append(toIndentedString(tinMatch)).append("\n"); + sb.append(" noTin: ").append(toIndentedString(noTin)).append("\n"); + sb.append(" addressVerification: ").append(toIndentedString(addressVerification)).append("\n"); + sb.append(" stateAndLocalWithholding: ").append(toIndentedString(stateAndLocalWithholding)).append("\n"); + sb.append(" secondTinNotice: ").append(toIndentedString(secondTinNotice)).append("\n"); + sb.append(" federalEfileStatus: ").append(toIndentedString(federalEfileStatus)).append("\n"); + sb.append(" stateEfileStatus: ").append(toIndentedString(stateEfileStatus)).append("\n"); + sb.append(" postalMailStatus: ").append(toIndentedString(postalMailStatus)).append("\n"); + sb.append(" tinMatchStatus: ").append(toIndentedString(tinMatchStatus)).append("\n"); + sb.append(" addressVerificationStatus: ").append(toIndentedString(addressVerificationStatus)).append("\n"); + sb.append(" eDeliveryStatus: ").append(toIndentedString(eDeliveryStatus)).append("\n"); sb.append(" validationErrors: ").append(toIndentedString(validationErrors)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append(" stateAndLocalWithholding: ").append(toIndentedString(stateAndLocalWithholding)).append("\n"); sb.append("}"); return sb.toString(); } @@ -1172,48 +1413,56 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("id"); openapiFields.add("type"); + openapiFields.add("id"); openapiFields.add("issuerId"); openapiFields.add("issuerReferenceId"); openapiFields.add("issuerTin"); openapiFields.add("taxYear"); - openapiFields.add("federalEfile"); - openapiFields.add("federalEfileStatus"); - openapiFields.add("stateEfile"); - openapiFields.add("stateEfileStatus"); - openapiFields.add("postalMail"); - openapiFields.add("postalMailStatus"); - openapiFields.add("tinMatch"); - openapiFields.add("tinMatchStatus"); - openapiFields.add("addressVerification"); - openapiFields.add("addressVerificationStatus"); - openapiFields.add("eDeliveryStatus"); openapiFields.add("referenceId"); - openapiFields.add("email"); - openapiFields.add("tinType"); - openapiFields.add("fatcaFilingRequirement"); openapiFields.add("tin"); - openapiFields.add("noTin"); - openapiFields.add("secondTinNotice"); openapiFields.add("recipientName"); + openapiFields.add("tinType"); openapiFields.add("recipientSecondName"); openapiFields.add("address"); openapiFields.add("address2"); openapiFields.add("city"); openapiFields.add("state"); openapiFields.add("zip"); - openapiFields.add("nonUsProvince"); - openapiFields.add("countryCode"); + openapiFields.add("email"); openapiFields.add("accountNumber"); openapiFields.add("officeCode"); + openapiFields.add("nonUsProvince"); + openapiFields.add("countryCode"); + openapiFields.add("federalEfileDate"); + openapiFields.add("postalMail"); + openapiFields.add("stateEfileDate"); + openapiFields.add("recipientEdeliveryDate"); + openapiFields.add("tinMatch"); + openapiFields.add("noTin"); + openapiFields.add("addressVerification"); + openapiFields.add("stateAndLocalWithholding"); + openapiFields.add("secondTinNotice"); + openapiFields.add("federalEfileStatus"); + openapiFields.add("stateEfileStatus"); + openapiFields.add("postalMailStatus"); + openapiFields.add("tinMatchStatus"); + openapiFields.add("addressVerificationStatus"); + openapiFields.add("eDeliveryStatus"); openapiFields.add("validationErrors"); openapiFields.add("createdAt"); openapiFields.add("updatedAt"); - openapiFields.add("stateAndLocalWithholding"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("employeeFirstName"); + openapiRequiredFields.add("employeeLastName"); + openapiRequiredFields.add("originOfHealthCoverageCode"); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("recipientName"); + openapiRequiredFields.add("address"); + openapiRequiredFields.add("city"); + openapiRequiredFields.add("countryCode"); } /** @@ -1236,10 +1485,31 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Form1095B` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Form1095B.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("employeeFirstName") != null && !jsonObj.get("employeeFirstName").isJsonNull()) && !jsonObj.get("employeeFirstName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `employeeFirstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("employeeFirstName").toString())); + } + if ((jsonObj.get("employeeMiddleName") != null && !jsonObj.get("employeeMiddleName").isJsonNull()) && !jsonObj.get("employeeMiddleName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `employeeMiddleName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("employeeMiddleName").toString())); + } + if ((jsonObj.get("employeeLastName") != null && !jsonObj.get("employeeLastName").isJsonNull()) && !jsonObj.get("employeeLastName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `employeeLastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("employeeLastName").toString())); + } + if ((jsonObj.get("employeeNameSuffix") != null && !jsonObj.get("employeeNameSuffix").isJsonNull()) && !jsonObj.get("employeeNameSuffix").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `employeeNameSuffix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("employeeNameSuffix").toString())); + } if ((jsonObj.get("originOfHealthCoverageCode") != null && !jsonObj.get("originOfHealthCoverageCode").isJsonNull()) && !jsonObj.get("originOfHealthCoverageCode").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `originOfHealthCoverageCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("originOfHealthCoverageCode").toString())); } + // validate the required field `originOfHealthCoverageCode` + OriginOfHealthCoverageCodeEnum.validateJsonElement(jsonObj.get("originOfHealthCoverageCode")); if (jsonObj.get("coveredIndividuals") != null && !jsonObj.get("coveredIndividuals").isJsonNull()) { JsonArray jsonArraycoveredIndividuals = jsonObj.getAsJsonArray("coveredIndividuals"); if (jsonArraycoveredIndividuals != null) { @@ -1250,15 +1520,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti // validate the optional field `coveredIndividuals` (array) for (int i = 0; i < jsonArraycoveredIndividuals.size(); i++) { - CoveredIndividualReference.validateJsonElement(jsonArraycoveredIndividuals.get(i)); + CoveredIndividual.validateJsonElement(jsonArraycoveredIndividuals.get(i)); }; } } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); 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("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + if ((jsonObj.get("issuerId") != null && !jsonObj.get("issuerId").isJsonNull()) && !jsonObj.get("issuerId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `issuerId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerId").toString())); } if ((jsonObj.get("issuerReferenceId") != null && !jsonObj.get("issuerReferenceId").isJsonNull()) && !jsonObj.get("issuerReferenceId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `issuerReferenceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerReferenceId").toString())); @@ -1266,55 +1541,22 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("issuerTin") != null && !jsonObj.get("issuerTin").isJsonNull()) && !jsonObj.get("issuerTin").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `issuerTin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerTin").toString())); } - // validate the optional field `federalEfileStatus` - if (jsonObj.get("federalEfileStatus") != null && !jsonObj.get("federalEfileStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("federalEfileStatus")); - } - if (jsonObj.get("stateEfileStatus") != null && !jsonObj.get("stateEfileStatus").isJsonNull()) { - JsonArray jsonArraystateEfileStatus = jsonObj.getAsJsonArray("stateEfileStatus"); - if (jsonArraystateEfileStatus != null) { - // ensure the json data is an array - if (!jsonObj.get("stateEfileStatus").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `stateEfileStatus` to be an array in the JSON string but got `%s`", jsonObj.get("stateEfileStatus").toString())); - } - - // validate the optional field `stateEfileStatus` (array) - for (int i = 0; i < jsonArraystateEfileStatus.size(); i++) { - StateEfileStatusDetail.validateJsonElement(jsonArraystateEfileStatus.get(i)); - }; - } - } - // validate the optional field `postalMailStatus` - if (jsonObj.get("postalMailStatus") != null && !jsonObj.get("postalMailStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("postalMailStatus")); - } - // validate the optional field `tinMatchStatus` - if (jsonObj.get("tinMatchStatus") != null && !jsonObj.get("tinMatchStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("tinMatchStatus")); - } - // validate the optional field `addressVerificationStatus` - if (jsonObj.get("addressVerificationStatus") != null && !jsonObj.get("addressVerificationStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("addressVerificationStatus")); - } - // validate the optional field `eDeliveryStatus` - if (jsonObj.get("eDeliveryStatus") != null && !jsonObj.get("eDeliveryStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("eDeliveryStatus")); - } if ((jsonObj.get("referenceId") != null && !jsonObj.get("referenceId").isJsonNull()) && !jsonObj.get("referenceId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `referenceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("referenceId").toString())); } - if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); - } - if ((jsonObj.get("tinType") != null && !jsonObj.get("tinType").isJsonNull()) && !jsonObj.get("tinType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `tinType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tinType").toString())); - } if ((jsonObj.get("tin") != null && !jsonObj.get("tin").isJsonNull()) && !jsonObj.get("tin").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `tin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tin").toString())); } if ((jsonObj.get("recipientName") != null && !jsonObj.get("recipientName").isJsonNull()) && !jsonObj.get("recipientName").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `recipientName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientName").toString())); } + if ((jsonObj.get("tinType") != null && !jsonObj.get("tinType").isJsonNull()) && !jsonObj.get("tinType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `tinType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tinType").toString())); + } + // validate the optional field `tinType` + if (jsonObj.get("tinType") != null && !jsonObj.get("tinType").isJsonNull()) { + TinTypeEnum.validateJsonElement(jsonObj.get("tinType")); + } if ((jsonObj.get("recipientSecondName") != null && !jsonObj.get("recipientSecondName").isJsonNull()) && !jsonObj.get("recipientSecondName").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `recipientSecondName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientSecondName").toString())); } @@ -1333,17 +1575,58 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("zip") != null && !jsonObj.get("zip").isJsonNull()) && !jsonObj.get("zip").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `zip` to be a primitive type in the JSON string but got `%s`", jsonObj.get("zip").toString())); } + if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if ((jsonObj.get("accountNumber") != null && !jsonObj.get("accountNumber").isJsonNull()) && !jsonObj.get("accountNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); + } + if ((jsonObj.get("officeCode") != null && !jsonObj.get("officeCode").isJsonNull()) && !jsonObj.get("officeCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `officeCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("officeCode").toString())); + } if ((jsonObj.get("nonUsProvince") != null && !jsonObj.get("nonUsProvince").isJsonNull()) && !jsonObj.get("nonUsProvince").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `nonUsProvince` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nonUsProvince").toString())); } if ((jsonObj.get("countryCode") != null && !jsonObj.get("countryCode").isJsonNull()) && !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("accountNumber") != null && !jsonObj.get("accountNumber").isJsonNull()) && !jsonObj.get("accountNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); + // validate the optional field `stateAndLocalWithholding` + if (jsonObj.get("stateAndLocalWithholding") != null && !jsonObj.get("stateAndLocalWithholding").isJsonNull()) { + StateAndLocalWithholding.validateJsonElement(jsonObj.get("stateAndLocalWithholding")); } - if ((jsonObj.get("officeCode") != null && !jsonObj.get("officeCode").isJsonNull()) && !jsonObj.get("officeCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `officeCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("officeCode").toString())); + // validate the optional field `federalEfileStatus` + if (jsonObj.get("federalEfileStatus") != null && !jsonObj.get("federalEfileStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("federalEfileStatus")); + } + if (jsonObj.get("stateEfileStatus") != null && !jsonObj.get("stateEfileStatus").isJsonNull()) { + JsonArray jsonArraystateEfileStatus = jsonObj.getAsJsonArray("stateEfileStatus"); + if (jsonArraystateEfileStatus != null) { + // ensure the json data is an array + if (!jsonObj.get("stateEfileStatus").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `stateEfileStatus` to be an array in the JSON string but got `%s`", jsonObj.get("stateEfileStatus").toString())); + } + + // validate the optional field `stateEfileStatus` (array) + for (int i = 0; i < jsonArraystateEfileStatus.size(); i++) { + StateEfileStatusDetail.validateJsonElement(jsonArraystateEfileStatus.get(i)); + }; + } + } + // validate the optional field `postalMailStatus` + if (jsonObj.get("postalMailStatus") != null && !jsonObj.get("postalMailStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("postalMailStatus")); + } + // validate the optional field `tinMatchStatus` + if (jsonObj.get("tinMatchStatus") != null && !jsonObj.get("tinMatchStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("tinMatchStatus")); + } + // validate the optional field `addressVerificationStatus` + if (jsonObj.get("addressVerificationStatus") != null && !jsonObj.get("addressVerificationStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("addressVerificationStatus")); + } + // validate the optional field `eDeliveryStatus` + if (jsonObj.get("eDeliveryStatus") != null && !jsonObj.get("eDeliveryStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("eDeliveryStatus")); } if (jsonObj.get("validationErrors") != null && !jsonObj.get("validationErrors").isJsonNull()) { JsonArray jsonArrayvalidationErrors = jsonObj.getAsJsonArray("validationErrors"); @@ -1359,10 +1642,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti }; } } - // validate the optional field `stateAndLocalWithholding` - if (jsonObj.get("stateAndLocalWithholding") != null && !jsonObj.get("stateAndLocalWithholding").isJsonNull()) { - StateAndLocalWithholding.validateJsonElement(jsonObj.get("stateAndLocalWithholding")); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/Form1095C.java b/src/main/java/Avalara/SDK/model/A1099/V2/Form1095C.java new file mode 100644 index 0000000..6066c24 --- /dev/null +++ b/src/main/java/Avalara/SDK/model/A1099/V2/Form1095C.java @@ -0,0 +1,1778 @@ +/* + * AvaTax Software Development Kit for Java (JRE) + * + * (c) 2004-2025 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * Avalara 1099 & W-9 API Definition + * + * ## 🔐 Authentication Generate a **license key** from: *[Avalara Portal](https://www.avalara.com/us/en/signin.html) → Settings → License and API Keys*. [More on authentication methods](https://developer.avalara.com/avatax-dm-combined-erp/common-setup/authentication/authentication-methods/) [Test your credentials](https://developer.avalara.com/avatax/test-credentials/) ## 📘 API & SDK Documentation [Avalara SDK (.NET) on GitHub](https://github.com/avadev/Avalara-SDK-DotNet#avalarasdk--the-unified-c-library-for-next-gen-avalara-services) [Code Examples – 1099 API](https://github.com/avadev/Avalara-SDK-DotNet/blob/main/docs/A1099/V2/Class1099IssuersApi.md#call1099issuersget) + * + * @author Sachin Baijal + * @author Jonathan Wenger + * @copyright 2004-2025 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @link https://github.com/avadev/Avalara-SDK-Java + */ + +package Avalara.SDK.model.A1099.V2; + +import java.util.Objects; +import Avalara.SDK.model.A1099.V2.CoveredIndividual; +import Avalara.SDK.model.A1099.V2.Form1099StatusDetail; +import Avalara.SDK.model.A1099.V2.OfferAndCoverage; +import Avalara.SDK.model.A1099.V2.StateAndLocalWithholding; +import Avalara.SDK.model.A1099.V2.StateEfileStatusDetail; +import Avalara.SDK.model.A1099.V2.ValidationError; +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.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +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; + +/** + * Form 1095-C: Employer-Provided Health Insurance Offer and Coverage + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") +public class Form1095C { + public static final String SERIALIZED_NAME_EMPLOYEE_FIRST_NAME = "employeeFirstName"; + @SerializedName(SERIALIZED_NAME_EMPLOYEE_FIRST_NAME) + private String employeeFirstName; + + public static final String SERIALIZED_NAME_EMPLOYEE_MIDDLE_NAME = "employeeMiddleName"; + @SerializedName(SERIALIZED_NAME_EMPLOYEE_MIDDLE_NAME) + private String employeeMiddleName; + + public static final String SERIALIZED_NAME_EMPLOYEE_LAST_NAME = "employeeLastName"; + @SerializedName(SERIALIZED_NAME_EMPLOYEE_LAST_NAME) + private String employeeLastName; + + public static final String SERIALIZED_NAME_EMPLOYEE_NAME_SUFFIX = "employeeNameSuffix"; + @SerializedName(SERIALIZED_NAME_EMPLOYEE_NAME_SUFFIX) + private String employeeNameSuffix; + + public static final String SERIALIZED_NAME_RECIPIENT_DATE_OF_BIRTH = "recipientDateOfBirth"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_DATE_OF_BIRTH) + private LocalDate recipientDateOfBirth; + + /** + * Plan start month. The calendar month during which the plan year begins of the health plan in which the employee is offered coverage (or would be offered coverage if the employee were eligible to participate in the plan). Available values: - 00: None - 01: January - 02: February - 03: March - 04: April - 05: May - 06: June - 07: July - 08: August - 09: September - 10: October - 11: November - 12: December + */ + @JsonAdapter(PlanStartMonthEnum.Adapter.class) + public enum PlanStartMonthEnum { + _00("00"), + + _01("01"), + + _02("02"), + + _03("03"), + + _04("04"), + + _05("05"), + + _06("06"), + + _07("07"), + + _08("08"), + + _09("09"), + + _10("10"), + + _11("11"), + + _12("12"); + + private String value; + + PlanStartMonthEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PlanStartMonthEnum fromValue(String value) { + for (PlanStartMonthEnum b : PlanStartMonthEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PlanStartMonthEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PlanStartMonthEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PlanStartMonthEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PlanStartMonthEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_PLAN_START_MONTH = "planStartMonth"; + @SerializedName(SERIALIZED_NAME_PLAN_START_MONTH) + private PlanStartMonthEnum planStartMonth; + + public static final String SERIALIZED_NAME_EMPLOYER_PROVIDED_SI_COVERAGE = "employerProvidedSiCoverage"; + @SerializedName(SERIALIZED_NAME_EMPLOYER_PROVIDED_SI_COVERAGE) + private Boolean employerProvidedSiCoverage; + + public static final String SERIALIZED_NAME_OFFER_AND_COVERAGES = "offerAndCoverages"; + @SerializedName(SERIALIZED_NAME_OFFER_AND_COVERAGES) + private List offerAndCoverages; + + public static final String SERIALIZED_NAME_COVERED_INDIVIDUALS = "coveredIndividuals"; + @SerializedName(SERIALIZED_NAME_COVERED_INDIVIDUALS) + private List coveredIndividuals; + + /** + * Form type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + _1099_NEC("1099-NEC"), + + _1099_MISC("1099-MISC"), + + _1099_DIV("1099-DIV"), + + _1099_R("1099-R"), + + _1099_K("1099-K"), + + _1095_B("1095-B"), + + _1042_S("1042-S"), + + _1095_C("1095-C"), + + _1099_INT("1099-INT"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.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 TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_ISSUER_ID = "issuerId"; + @SerializedName(SERIALIZED_NAME_ISSUER_ID) + private String issuerId; + + public static final String SERIALIZED_NAME_ISSUER_REFERENCE_ID = "issuerReferenceId"; + @SerializedName(SERIALIZED_NAME_ISSUER_REFERENCE_ID) + private String issuerReferenceId; + + public static final String SERIALIZED_NAME_ISSUER_TIN = "issuerTin"; + @SerializedName(SERIALIZED_NAME_ISSUER_TIN) + private String issuerTin; + + public static final String SERIALIZED_NAME_TAX_YEAR = "taxYear"; + @SerializedName(SERIALIZED_NAME_TAX_YEAR) + private Integer taxYear; + + public static final String SERIALIZED_NAME_REFERENCE_ID = "referenceId"; + @SerializedName(SERIALIZED_NAME_REFERENCE_ID) + private String referenceId; + + public static final String SERIALIZED_NAME_TIN = "tin"; + @SerializedName(SERIALIZED_NAME_TIN) + private String tin; + + public static final String SERIALIZED_NAME_RECIPIENT_NAME = "recipientName"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_NAME) + private String recipientName; + + /** + * Type of TIN (Tax ID Number) + */ + @JsonAdapter(TinTypeEnum.Adapter.class) + public enum TinTypeEnum { + EMPTY("Empty"), + + EIN("EIN"), + + SSN("SSN"), + + ITIN("ITIN"), + + ATIN("ATIN"); + + private String value; + + TinTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TinTypeEnum fromValue(String value) { + for (TinTypeEnum b : TinTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TinTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TinTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TinTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TinTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TIN_TYPE = "tinType"; + @SerializedName(SERIALIZED_NAME_TIN_TYPE) + private TinTypeEnum tinType; + + public static final String SERIALIZED_NAME_RECIPIENT_SECOND_NAME = "recipientSecondName"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_SECOND_NAME) + private String recipientSecondName; + + public static final String SERIALIZED_NAME_ADDRESS = "address"; + @SerializedName(SERIALIZED_NAME_ADDRESS) + private String address; + + public static final String SERIALIZED_NAME_ADDRESS2 = "address2"; + @SerializedName(SERIALIZED_NAME_ADDRESS2) + private String address2; + + 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_ZIP = "zip"; + @SerializedName(SERIALIZED_NAME_ZIP) + private String zip; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) + private String accountNumber; + + public static final String SERIALIZED_NAME_OFFICE_CODE = "officeCode"; + @SerializedName(SERIALIZED_NAME_OFFICE_CODE) + private String officeCode; + + public static final String SERIALIZED_NAME_NON_US_PROVINCE = "nonUsProvince"; + @SerializedName(SERIALIZED_NAME_NON_US_PROVINCE) + private String nonUsProvince; + + public static final String SERIALIZED_NAME_COUNTRY_CODE = "countryCode"; + @SerializedName(SERIALIZED_NAME_COUNTRY_CODE) + private String countryCode; + + public static final String SERIALIZED_NAME_FEDERAL_EFILE_DATE = "federalEfileDate"; + @SerializedName(SERIALIZED_NAME_FEDERAL_EFILE_DATE) + private LocalDate federalEfileDate; + + public static final String SERIALIZED_NAME_POSTAL_MAIL = "postalMail"; + @SerializedName(SERIALIZED_NAME_POSTAL_MAIL) + private Boolean postalMail; + + public static final String SERIALIZED_NAME_STATE_EFILE_DATE = "stateEfileDate"; + @SerializedName(SERIALIZED_NAME_STATE_EFILE_DATE) + private LocalDate stateEfileDate; + + public static final String SERIALIZED_NAME_RECIPIENT_EDELIVERY_DATE = "recipientEdeliveryDate"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_EDELIVERY_DATE) + private LocalDate recipientEdeliveryDate; + + public static final String SERIALIZED_NAME_TIN_MATCH = "tinMatch"; + @SerializedName(SERIALIZED_NAME_TIN_MATCH) + private Boolean tinMatch; + + public static final String SERIALIZED_NAME_NO_TIN = "noTin"; + @SerializedName(SERIALIZED_NAME_NO_TIN) + private Boolean noTin; + + public static final String SERIALIZED_NAME_ADDRESS_VERIFICATION = "addressVerification"; + @SerializedName(SERIALIZED_NAME_ADDRESS_VERIFICATION) + private Boolean addressVerification; + + public static final String SERIALIZED_NAME_STATE_AND_LOCAL_WITHHOLDING = "stateAndLocalWithholding"; + @SerializedName(SERIALIZED_NAME_STATE_AND_LOCAL_WITHHOLDING) + private StateAndLocalWithholding stateAndLocalWithholding; + + public static final String SERIALIZED_NAME_SECOND_TIN_NOTICE = "secondTinNotice"; + @SerializedName(SERIALIZED_NAME_SECOND_TIN_NOTICE) + private Boolean secondTinNotice; + + public static final String SERIALIZED_NAME_FEDERAL_EFILE_STATUS = "federalEfileStatus"; + @SerializedName(SERIALIZED_NAME_FEDERAL_EFILE_STATUS) + private Form1099StatusDetail federalEfileStatus; + + public static final String SERIALIZED_NAME_STATE_EFILE_STATUS = "stateEfileStatus"; + @SerializedName(SERIALIZED_NAME_STATE_EFILE_STATUS) + private List stateEfileStatus; + + public static final String SERIALIZED_NAME_POSTAL_MAIL_STATUS = "postalMailStatus"; + @SerializedName(SERIALIZED_NAME_POSTAL_MAIL_STATUS) + private Form1099StatusDetail postalMailStatus; + + public static final String SERIALIZED_NAME_TIN_MATCH_STATUS = "tinMatchStatus"; + @SerializedName(SERIALIZED_NAME_TIN_MATCH_STATUS) + private Form1099StatusDetail tinMatchStatus; + + public static final String SERIALIZED_NAME_ADDRESS_VERIFICATION_STATUS = "addressVerificationStatus"; + @SerializedName(SERIALIZED_NAME_ADDRESS_VERIFICATION_STATUS) + private Form1099StatusDetail addressVerificationStatus; + + public static final String SERIALIZED_NAME_E_DELIVERY_STATUS = "eDeliveryStatus"; + @SerializedName(SERIALIZED_NAME_E_DELIVERY_STATUS) + private Form1099StatusDetail eDeliveryStatus; + + public static final String SERIALIZED_NAME_VALIDATION_ERRORS = "validationErrors"; + @SerializedName(SERIALIZED_NAME_VALIDATION_ERRORS) + private List validationErrors; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private OffsetDateTime updatedAt; + + public Form1095C() { + } + + public Form1095C( + String id, + Form1099StatusDetail federalEfileStatus, + List stateEfileStatus, + Form1099StatusDetail postalMailStatus, + Form1099StatusDetail tinMatchStatus, + Form1099StatusDetail addressVerificationStatus, + Form1099StatusDetail eDeliveryStatus, + List validationErrors, + OffsetDateTime createdAt, + OffsetDateTime updatedAt + ) { + this(); + this.id = id; + this.federalEfileStatus = federalEfileStatus; + this.stateEfileStatus = stateEfileStatus; + this.postalMailStatus = postalMailStatus; + this.tinMatchStatus = tinMatchStatus; + this.addressVerificationStatus = addressVerificationStatus; + this.eDeliveryStatus = eDeliveryStatus; + this.validationErrors = validationErrors; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + + public Form1095C employeeFirstName(String employeeFirstName) { + this.employeeFirstName = employeeFirstName; + return this; + } + + /** + * Employee's first name + * @return employeeFirstName + */ + @javax.annotation.Nullable + public String getEmployeeFirstName() { + return employeeFirstName; + } + + public void setEmployeeFirstName(String employeeFirstName) { + this.employeeFirstName = employeeFirstName; + } + + + public Form1095C employeeMiddleName(String employeeMiddleName) { + this.employeeMiddleName = employeeMiddleName; + return this; + } + + /** + * Employee's middle name + * @return employeeMiddleName + */ + @javax.annotation.Nullable + public String getEmployeeMiddleName() { + return employeeMiddleName; + } + + public void setEmployeeMiddleName(String employeeMiddleName) { + this.employeeMiddleName = employeeMiddleName; + } + + + public Form1095C employeeLastName(String employeeLastName) { + this.employeeLastName = employeeLastName; + return this; + } + + /** + * Employee's last name + * @return employeeLastName + */ + @javax.annotation.Nullable + public String getEmployeeLastName() { + return employeeLastName; + } + + public void setEmployeeLastName(String employeeLastName) { + this.employeeLastName = employeeLastName; + } + + + public Form1095C employeeNameSuffix(String employeeNameSuffix) { + this.employeeNameSuffix = employeeNameSuffix; + return this; + } + + /** + * Employee's name suffix + * @return employeeNameSuffix + */ + @javax.annotation.Nullable + public String getEmployeeNameSuffix() { + return employeeNameSuffix; + } + + public void setEmployeeNameSuffix(String employeeNameSuffix) { + this.employeeNameSuffix = employeeNameSuffix; + } + + + public Form1095C recipientDateOfBirth(LocalDate recipientDateOfBirth) { + this.recipientDateOfBirth = recipientDateOfBirth; + return this; + } + + /** + * Recipient's date of birth + * @return recipientDateOfBirth + */ + @javax.annotation.Nullable + public LocalDate getRecipientDateOfBirth() { + return recipientDateOfBirth; + } + + public void setRecipientDateOfBirth(LocalDate recipientDateOfBirth) { + this.recipientDateOfBirth = recipientDateOfBirth; + } + + + public Form1095C planStartMonth(PlanStartMonthEnum planStartMonth) { + this.planStartMonth = planStartMonth; + return this; + } + + /** + * Plan start month. The calendar month during which the plan year begins of the health plan in which the employee is offered coverage (or would be offered coverage if the employee were eligible to participate in the plan). Available values: - 00: None - 01: January - 02: February - 03: March - 04: April - 05: May - 06: June - 07: July - 08: August - 09: September - 10: October - 11: November - 12: December + * @return planStartMonth + */ + @javax.annotation.Nullable + public PlanStartMonthEnum getPlanStartMonth() { + return planStartMonth; + } + + public void setPlanStartMonth(PlanStartMonthEnum planStartMonth) { + this.planStartMonth = planStartMonth; + } + + + public Form1095C employerProvidedSiCoverage(Boolean employerProvidedSiCoverage) { + this.employerProvidedSiCoverage = employerProvidedSiCoverage; + return this; + } + + /** + * Employer provided self-insured coverage + * @return employerProvidedSiCoverage + */ + @javax.annotation.Nullable + public Boolean getEmployerProvidedSiCoverage() { + return employerProvidedSiCoverage; + } + + public void setEmployerProvidedSiCoverage(Boolean employerProvidedSiCoverage) { + this.employerProvidedSiCoverage = employerProvidedSiCoverage; + } + + + public Form1095C offerAndCoverages(List offerAndCoverages) { + this.offerAndCoverages = offerAndCoverages; + return this; + } + + public Form1095C addOfferAndCoveragesItem(OfferAndCoverage offerAndCoveragesItem) { + if (this.offerAndCoverages == null) { + this.offerAndCoverages = new ArrayList<>(); + } + this.offerAndCoverages.add(offerAndCoveragesItem); + return this; + } + + /** + * Offer and coverage information + * @return offerAndCoverages + */ + @javax.annotation.Nonnull + public List getOfferAndCoverages() { + return offerAndCoverages; + } + + public void setOfferAndCoverages(List offerAndCoverages) { + this.offerAndCoverages = offerAndCoverages; + } + + + public Form1095C coveredIndividuals(List coveredIndividuals) { + this.coveredIndividuals = coveredIndividuals; + return this; + } + + public Form1095C addCoveredIndividualsItem(CoveredIndividual coveredIndividualsItem) { + if (this.coveredIndividuals == null) { + this.coveredIndividuals = new ArrayList<>(); + } + this.coveredIndividuals.add(coveredIndividualsItem); + return this; + } + + /** + * Covered individuals information + * @return coveredIndividuals + */ + @javax.annotation.Nullable + public List getCoveredIndividuals() { + return coveredIndividuals; + } + + public void setCoveredIndividuals(List coveredIndividuals) { + this.coveredIndividuals = coveredIndividuals; + } + + + public Form1095C type(TypeEnum type) { + this.type = type; + return this; + } + + /** + * Form type + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(TypeEnum type) { + this.type = type; + } + + + /** + * Form ID. Unique identifier set when the record is created. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + + + public Form1095C issuerId(String issuerId) { + this.issuerId = issuerId; + return this; + } + + /** + * Issuer ID - only required when creating forms + * @return issuerId + */ + @javax.annotation.Nullable + public String getIssuerId() { + return issuerId; + } + + public void setIssuerId(String issuerId) { + this.issuerId = issuerId; + } + + + public Form1095C issuerReferenceId(String issuerReferenceId) { + this.issuerReferenceId = issuerReferenceId; + return this; + } + + /** + * Issuer Reference ID - only required when creating forms + * @return issuerReferenceId + */ + @javax.annotation.Nullable + public String getIssuerReferenceId() { + return issuerReferenceId; + } + + public void setIssuerReferenceId(String issuerReferenceId) { + this.issuerReferenceId = issuerReferenceId; + } + + + public Form1095C issuerTin(String issuerTin) { + this.issuerTin = issuerTin; + return this; + } + + /** + * Issuer TIN - readonly + * @return issuerTin + */ + @javax.annotation.Nullable + public String getIssuerTin() { + return issuerTin; + } + + public void setIssuerTin(String issuerTin) { + this.issuerTin = issuerTin; + } + + + public Form1095C taxYear(Integer taxYear) { + this.taxYear = taxYear; + return this; + } + + /** + * Tax Year - only required when creating forms + * @return taxYear + */ + @javax.annotation.Nullable + public Integer getTaxYear() { + return taxYear; + } + + public void setTaxYear(Integer taxYear) { + this.taxYear = taxYear; + } + + + public Form1095C referenceId(String referenceId) { + this.referenceId = referenceId; + return this; + } + + /** + * Internal reference ID. Never shown to any agency or recipient. + * @return referenceId + */ + @javax.annotation.Nullable + public String getReferenceId() { + return referenceId; + } + + public void setReferenceId(String referenceId) { + this.referenceId = referenceId; + } + + + public Form1095C tin(String tin) { + this.tin = tin; + return this; + } + + /** + * Recipient's Federal Tax Identification Number (TIN). + * @return tin + */ + @javax.annotation.Nullable + public String getTin() { + return tin; + } + + public void setTin(String tin) { + this.tin = tin; + } + + + public Form1095C recipientName(String recipientName) { + this.recipientName = recipientName; + return this; + } + + /** + * Recipient name + * @return recipientName + */ + @javax.annotation.Nullable + public String getRecipientName() { + return recipientName; + } + + public void setRecipientName(String recipientName) { + this.recipientName = recipientName; + } + + + public Form1095C tinType(TinTypeEnum tinType) { + this.tinType = tinType; + return this; + } + + /** + * Type of TIN (Tax ID Number) + * @return tinType + */ + @javax.annotation.Nullable + public TinTypeEnum getTinType() { + return tinType; + } + + public void setTinType(TinTypeEnum tinType) { + this.tinType = tinType; + } + + + public Form1095C recipientSecondName(String recipientSecondName) { + this.recipientSecondName = recipientSecondName; + return this; + } + + /** + * Recipient second name + * @return recipientSecondName + */ + @javax.annotation.Nullable + public String getRecipientSecondName() { + return recipientSecondName; + } + + public void setRecipientSecondName(String recipientSecondName) { + this.recipientSecondName = recipientSecondName; + } + + + public Form1095C address(String address) { + this.address = address; + return this; + } + + /** + * Address. + * @return address + */ + @javax.annotation.Nullable + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + + public Form1095C address2(String address2) { + this.address2 = address2; + return this; + } + + /** + * Address line 2. + * @return address2 + */ + @javax.annotation.Nullable + public String getAddress2() { + return address2; + } + + public void setAddress2(String address2) { + this.address2 = address2; + } + + + public Form1095C 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 Form1095C state(String state) { + this.state = state; + return this; + } + + /** + * Two-letter US state or Canadian province code (required for US/CA addresses). + * @return state + */ + @javax.annotation.Nullable + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + + public Form1095C zip(String zip) { + this.zip = zip; + return this; + } + + /** + * ZIP/postal code. + * @return zip + */ + @javax.annotation.Nullable + public String getZip() { + return zip; + } + + public void setZip(String zip) { + this.zip = zip; + } + + + public Form1095C email(String email) { + this.email = email; + return this; + } + + /** + * Recipient's Contact email address. + * @return email + */ + @javax.annotation.Nullable + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + + public Form1095C accountNumber(String accountNumber) { + this.accountNumber = accountNumber; + return this; + } + + /** + * Account number + * @return accountNumber + */ + @javax.annotation.Nullable + public String getAccountNumber() { + return accountNumber; + } + + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + } + + + public Form1095C officeCode(String officeCode) { + this.officeCode = officeCode; + return this; + } + + /** + * Office code + * @return officeCode + */ + @javax.annotation.Nullable + public String getOfficeCode() { + return officeCode; + } + + public void setOfficeCode(String officeCode) { + this.officeCode = officeCode; + } + + + public Form1095C nonUsProvince(String nonUsProvince) { + this.nonUsProvince = nonUsProvince; + return this; + } + + /** + * Province or region for non-US/CA addresses. + * @return nonUsProvince + */ + @javax.annotation.Nullable + public String getNonUsProvince() { + return nonUsProvince; + } + + public void setNonUsProvince(String nonUsProvince) { + this.nonUsProvince = nonUsProvince; + } + + + public Form1095C countryCode(String countryCode) { + this.countryCode = countryCode; + return this; + } + + /** + * Two-letter IRS country code (e.g., 'US', 'CA'), as defined at https://www.irs.gov/e-file-providers/country-codes. + * @return countryCode + */ + @javax.annotation.Nullable + public String getCountryCode() { + return countryCode; + } + + public void setCountryCode(String countryCode) { + this.countryCode = countryCode; + } + + + public Form1095C federalEfileDate(LocalDate federalEfileDate) { + this.federalEfileDate = federalEfileDate; + return this; + } + + /** + * Date when federal e-filing should be scheduled for this form + * @return federalEfileDate + */ + @javax.annotation.Nullable + public LocalDate getFederalEfileDate() { + return federalEfileDate; + } + + public void setFederalEfileDate(LocalDate federalEfileDate) { + this.federalEfileDate = federalEfileDate; + } + + + public Form1095C postalMail(Boolean postalMail) { + this.postalMail = postalMail; + return this; + } + + /** + * Boolean indicating that postal mailing to the recipient should be scheduled for this form + * @return postalMail + */ + @javax.annotation.Nullable + public Boolean getPostalMail() { + return postalMail; + } + + public void setPostalMail(Boolean postalMail) { + this.postalMail = postalMail; + } + + + public Form1095C stateEfileDate(LocalDate stateEfileDate) { + this.stateEfileDate = stateEfileDate; + return this; + } + + /** + * Date when state e-filing should be scheduled for this form + * @return stateEfileDate + */ + @javax.annotation.Nullable + public LocalDate getStateEfileDate() { + return stateEfileDate; + } + + public void setStateEfileDate(LocalDate stateEfileDate) { + this.stateEfileDate = stateEfileDate; + } + + + public Form1095C recipientEdeliveryDate(LocalDate recipientEdeliveryDate) { + this.recipientEdeliveryDate = recipientEdeliveryDate; + return this; + } + + /** + * Date when recipient e-delivery should be scheduled for this form + * @return recipientEdeliveryDate + */ + @javax.annotation.Nullable + public LocalDate getRecipientEdeliveryDate() { + return recipientEdeliveryDate; + } + + public void setRecipientEdeliveryDate(LocalDate recipientEdeliveryDate) { + this.recipientEdeliveryDate = recipientEdeliveryDate; + } + + + public Form1095C tinMatch(Boolean tinMatch) { + this.tinMatch = tinMatch; + return this; + } + + /** + * Boolean indicating that TIN Matching should be scheduled for this form + * @return tinMatch + */ + @javax.annotation.Nullable + public Boolean getTinMatch() { + return tinMatch; + } + + public void setTinMatch(Boolean tinMatch) { + this.tinMatch = tinMatch; + } + + + public Form1095C noTin(Boolean noTin) { + this.noTin = noTin; + return this; + } + + /** + * No TIN indicator + * @return noTin + */ + @javax.annotation.Nullable + public Boolean getNoTin() { + return noTin; + } + + public void setNoTin(Boolean noTin) { + this.noTin = noTin; + } + + + public Form1095C addressVerification(Boolean addressVerification) { + this.addressVerification = addressVerification; + return this; + } + + /** + * Boolean indicating that address verification should be scheduled for this form + * @return addressVerification + */ + @javax.annotation.Nullable + public Boolean getAddressVerification() { + return addressVerification; + } + + public void setAddressVerification(Boolean addressVerification) { + this.addressVerification = addressVerification; + } + + + public Form1095C stateAndLocalWithholding(StateAndLocalWithholding stateAndLocalWithholding) { + this.stateAndLocalWithholding = stateAndLocalWithholding; + return this; + } + + /** + * State and local withholding information + * @return stateAndLocalWithholding + */ + @javax.annotation.Nullable + public StateAndLocalWithholding getStateAndLocalWithholding() { + return stateAndLocalWithholding; + } + + public void setStateAndLocalWithholding(StateAndLocalWithholding stateAndLocalWithholding) { + this.stateAndLocalWithholding = stateAndLocalWithholding; + } + + + public Form1095C secondTinNotice(Boolean secondTinNotice) { + this.secondTinNotice = secondTinNotice; + return this; + } + + /** + * Second TIN notice + * @return secondTinNotice + */ + @javax.annotation.Nullable + public Boolean getSecondTinNotice() { + return secondTinNotice; + } + + public void setSecondTinNotice(Boolean secondTinNotice) { + this.secondTinNotice = secondTinNotice; + } + + + /** + * Federal e-file status + * @return federalEfileStatus + */ + @javax.annotation.Nullable + public Form1099StatusDetail getFederalEfileStatus() { + return federalEfileStatus; + } + + + + /** + * State e-file status + * @return stateEfileStatus + */ + @javax.annotation.Nullable + public List getStateEfileStatus() { + return stateEfileStatus; + } + + + + /** + * Postal mail to recipient status + * @return postalMailStatus + */ + @javax.annotation.Nullable + public Form1099StatusDetail getPostalMailStatus() { + return postalMailStatus; + } + + + + /** + * TIN Match status + * @return tinMatchStatus + */ + @javax.annotation.Nullable + public Form1099StatusDetail getTinMatchStatus() { + return tinMatchStatus; + } + + + + /** + * Address verification status + * @return addressVerificationStatus + */ + @javax.annotation.Nullable + public Form1099StatusDetail getAddressVerificationStatus() { + return addressVerificationStatus; + } + + + + /** + * EDelivery status + * @return eDeliveryStatus + */ + @javax.annotation.Nullable + public Form1099StatusDetail geteDeliveryStatus() { + return eDeliveryStatus; + } + + + + /** + * Validation errors + * @return validationErrors + */ + @javax.annotation.Nullable + public List getValidationErrors() { + return validationErrors; + } + + + + /** + * Date time when the record was created. + * @return createdAt + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + + + /** + * Date time when the record was last updated. + * @return updatedAt + */ + @javax.annotation.Nullable + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Form1095C form1095C = (Form1095C) o; + return Objects.equals(this.employeeFirstName, form1095C.employeeFirstName) && + Objects.equals(this.employeeMiddleName, form1095C.employeeMiddleName) && + Objects.equals(this.employeeLastName, form1095C.employeeLastName) && + Objects.equals(this.employeeNameSuffix, form1095C.employeeNameSuffix) && + Objects.equals(this.recipientDateOfBirth, form1095C.recipientDateOfBirth) && + Objects.equals(this.planStartMonth, form1095C.planStartMonth) && + Objects.equals(this.employerProvidedSiCoverage, form1095C.employerProvidedSiCoverage) && + Objects.equals(this.offerAndCoverages, form1095C.offerAndCoverages) && + Objects.equals(this.coveredIndividuals, form1095C.coveredIndividuals) && + Objects.equals(this.type, form1095C.type) && + Objects.equals(this.id, form1095C.id) && + Objects.equals(this.issuerId, form1095C.issuerId) && + Objects.equals(this.issuerReferenceId, form1095C.issuerReferenceId) && + Objects.equals(this.issuerTin, form1095C.issuerTin) && + Objects.equals(this.taxYear, form1095C.taxYear) && + Objects.equals(this.referenceId, form1095C.referenceId) && + Objects.equals(this.tin, form1095C.tin) && + Objects.equals(this.recipientName, form1095C.recipientName) && + Objects.equals(this.tinType, form1095C.tinType) && + Objects.equals(this.recipientSecondName, form1095C.recipientSecondName) && + Objects.equals(this.address, form1095C.address) && + Objects.equals(this.address2, form1095C.address2) && + Objects.equals(this.city, form1095C.city) && + Objects.equals(this.state, form1095C.state) && + Objects.equals(this.zip, form1095C.zip) && + Objects.equals(this.email, form1095C.email) && + Objects.equals(this.accountNumber, form1095C.accountNumber) && + Objects.equals(this.officeCode, form1095C.officeCode) && + Objects.equals(this.nonUsProvince, form1095C.nonUsProvince) && + Objects.equals(this.countryCode, form1095C.countryCode) && + Objects.equals(this.federalEfileDate, form1095C.federalEfileDate) && + Objects.equals(this.postalMail, form1095C.postalMail) && + Objects.equals(this.stateEfileDate, form1095C.stateEfileDate) && + Objects.equals(this.recipientEdeliveryDate, form1095C.recipientEdeliveryDate) && + Objects.equals(this.tinMatch, form1095C.tinMatch) && + Objects.equals(this.noTin, form1095C.noTin) && + Objects.equals(this.addressVerification, form1095C.addressVerification) && + Objects.equals(this.stateAndLocalWithholding, form1095C.stateAndLocalWithholding) && + Objects.equals(this.secondTinNotice, form1095C.secondTinNotice) && + Objects.equals(this.federalEfileStatus, form1095C.federalEfileStatus) && + Objects.equals(this.stateEfileStatus, form1095C.stateEfileStatus) && + Objects.equals(this.postalMailStatus, form1095C.postalMailStatus) && + Objects.equals(this.tinMatchStatus, form1095C.tinMatchStatus) && + Objects.equals(this.addressVerificationStatus, form1095C.addressVerificationStatus) && + Objects.equals(this.eDeliveryStatus, form1095C.eDeliveryStatus) && + Objects.equals(this.validationErrors, form1095C.validationErrors) && + Objects.equals(this.createdAt, form1095C.createdAt) && + Objects.equals(this.updatedAt, form1095C.updatedAt); + } + + 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(employeeFirstName, employeeMiddleName, employeeLastName, employeeNameSuffix, recipientDateOfBirth, planStartMonth, employerProvidedSiCoverage, offerAndCoverages, coveredIndividuals, type, id, issuerId, issuerReferenceId, issuerTin, taxYear, referenceId, tin, recipientName, tinType, recipientSecondName, address, address2, city, state, zip, email, accountNumber, officeCode, nonUsProvince, countryCode, federalEfileDate, postalMail, stateEfileDate, recipientEdeliveryDate, tinMatch, noTin, addressVerification, stateAndLocalWithholding, secondTinNotice, federalEfileStatus, stateEfileStatus, postalMailStatus, tinMatchStatus, addressVerificationStatus, eDeliveryStatus, validationErrors, createdAt, updatedAt); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Form1095C {\n"); + sb.append(" employeeFirstName: ").append(toIndentedString(employeeFirstName)).append("\n"); + sb.append(" employeeMiddleName: ").append(toIndentedString(employeeMiddleName)).append("\n"); + sb.append(" employeeLastName: ").append(toIndentedString(employeeLastName)).append("\n"); + sb.append(" employeeNameSuffix: ").append(toIndentedString(employeeNameSuffix)).append("\n"); + sb.append(" recipientDateOfBirth: ").append(toIndentedString(recipientDateOfBirth)).append("\n"); + sb.append(" planStartMonth: ").append(toIndentedString(planStartMonth)).append("\n"); + sb.append(" employerProvidedSiCoverage: ").append(toIndentedString(employerProvidedSiCoverage)).append("\n"); + sb.append(" offerAndCoverages: ").append(toIndentedString(offerAndCoverages)).append("\n"); + sb.append(" coveredIndividuals: ").append(toIndentedString(coveredIndividuals)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" issuerId: ").append(toIndentedString(issuerId)).append("\n"); + sb.append(" issuerReferenceId: ").append(toIndentedString(issuerReferenceId)).append("\n"); + sb.append(" issuerTin: ").append(toIndentedString(issuerTin)).append("\n"); + sb.append(" taxYear: ").append(toIndentedString(taxYear)).append("\n"); + sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); + sb.append(" tin: ").append(toIndentedString(tin)).append("\n"); + sb.append(" recipientName: ").append(toIndentedString(recipientName)).append("\n"); + sb.append(" tinType: ").append(toIndentedString(tinType)).append("\n"); + sb.append(" recipientSecondName: ").append(toIndentedString(recipientSecondName)).append("\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" address2: ").append(toIndentedString(address2)).append("\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" zip: ").append(toIndentedString(zip)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" officeCode: ").append(toIndentedString(officeCode)).append("\n"); + sb.append(" nonUsProvince: ").append(toIndentedString(nonUsProvince)).append("\n"); + sb.append(" countryCode: ").append(toIndentedString(countryCode)).append("\n"); + sb.append(" federalEfileDate: ").append(toIndentedString(federalEfileDate)).append("\n"); + sb.append(" postalMail: ").append(toIndentedString(postalMail)).append("\n"); + sb.append(" stateEfileDate: ").append(toIndentedString(stateEfileDate)).append("\n"); + sb.append(" recipientEdeliveryDate: ").append(toIndentedString(recipientEdeliveryDate)).append("\n"); + sb.append(" tinMatch: ").append(toIndentedString(tinMatch)).append("\n"); + sb.append(" noTin: ").append(toIndentedString(noTin)).append("\n"); + sb.append(" addressVerification: ").append(toIndentedString(addressVerification)).append("\n"); + sb.append(" stateAndLocalWithholding: ").append(toIndentedString(stateAndLocalWithholding)).append("\n"); + sb.append(" secondTinNotice: ").append(toIndentedString(secondTinNotice)).append("\n"); + sb.append(" federalEfileStatus: ").append(toIndentedString(federalEfileStatus)).append("\n"); + sb.append(" stateEfileStatus: ").append(toIndentedString(stateEfileStatus)).append("\n"); + sb.append(" postalMailStatus: ").append(toIndentedString(postalMailStatus)).append("\n"); + sb.append(" tinMatchStatus: ").append(toIndentedString(tinMatchStatus)).append("\n"); + sb.append(" addressVerificationStatus: ").append(toIndentedString(addressVerificationStatus)).append("\n"); + sb.append(" eDeliveryStatus: ").append(toIndentedString(eDeliveryStatus)).append("\n"); + sb.append(" validationErrors: ").append(toIndentedString(validationErrors)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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("type"); + openapiFields.add("id"); + openapiFields.add("issuerId"); + openapiFields.add("issuerReferenceId"); + openapiFields.add("issuerTin"); + openapiFields.add("taxYear"); + openapiFields.add("referenceId"); + openapiFields.add("tin"); + openapiFields.add("recipientName"); + openapiFields.add("tinType"); + openapiFields.add("recipientSecondName"); + openapiFields.add("address"); + openapiFields.add("address2"); + openapiFields.add("city"); + openapiFields.add("state"); + openapiFields.add("zip"); + openapiFields.add("email"); + openapiFields.add("accountNumber"); + openapiFields.add("officeCode"); + openapiFields.add("nonUsProvince"); + openapiFields.add("countryCode"); + openapiFields.add("federalEfileDate"); + openapiFields.add("postalMail"); + openapiFields.add("stateEfileDate"); + openapiFields.add("recipientEdeliveryDate"); + openapiFields.add("tinMatch"); + openapiFields.add("noTin"); + openapiFields.add("addressVerification"); + openapiFields.add("stateAndLocalWithholding"); + openapiFields.add("secondTinNotice"); + openapiFields.add("federalEfileStatus"); + openapiFields.add("stateEfileStatus"); + openapiFields.add("postalMailStatus"); + openapiFields.add("tinMatchStatus"); + openapiFields.add("addressVerificationStatus"); + openapiFields.add("eDeliveryStatus"); + openapiFields.add("validationErrors"); + openapiFields.add("createdAt"); + openapiFields.add("updatedAt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("employeeFirstName"); + openapiRequiredFields.add("employeeLastName"); + openapiRequiredFields.add("planStartMonth"); + openapiRequiredFields.add("offerAndCoverages"); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("recipientName"); + openapiRequiredFields.add("address"); + openapiRequiredFields.add("city"); + openapiRequiredFields.add("countryCode"); + } + + /** + * 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 Form1095C + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Form1095C.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Form1095C is not found in the empty JSON string", Form1095C.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Form1095C.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Form1095C` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Form1095C.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("employeeFirstName") != null && !jsonObj.get("employeeFirstName").isJsonNull()) && !jsonObj.get("employeeFirstName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `employeeFirstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("employeeFirstName").toString())); + } + if ((jsonObj.get("employeeMiddleName") != null && !jsonObj.get("employeeMiddleName").isJsonNull()) && !jsonObj.get("employeeMiddleName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `employeeMiddleName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("employeeMiddleName").toString())); + } + if ((jsonObj.get("employeeLastName") != null && !jsonObj.get("employeeLastName").isJsonNull()) && !jsonObj.get("employeeLastName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `employeeLastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("employeeLastName").toString())); + } + if ((jsonObj.get("employeeNameSuffix") != null && !jsonObj.get("employeeNameSuffix").isJsonNull()) && !jsonObj.get("employeeNameSuffix").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `employeeNameSuffix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("employeeNameSuffix").toString())); + } + if ((jsonObj.get("planStartMonth") != null && !jsonObj.get("planStartMonth").isJsonNull()) && !jsonObj.get("planStartMonth").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `planStartMonth` to be a primitive type in the JSON string but got `%s`", jsonObj.get("planStartMonth").toString())); + } + // validate the required field `planStartMonth` + PlanStartMonthEnum.validateJsonElement(jsonObj.get("planStartMonth")); + // ensure the json data is an array + if (!jsonObj.get("offerAndCoverages").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `offerAndCoverages` to be an array in the JSON string but got `%s`", jsonObj.get("offerAndCoverages").toString())); + } + + JsonArray jsonArrayofferAndCoverages = jsonObj.getAsJsonArray("offerAndCoverages"); + // validate the required field `offerAndCoverages` (array) + for (int i = 0; i < jsonArrayofferAndCoverages.size(); i++) { + OfferAndCoverage.validateJsonElement(jsonArrayofferAndCoverages.get(i)); + }; + if (jsonObj.get("coveredIndividuals") != null && !jsonObj.get("coveredIndividuals").isJsonNull()) { + JsonArray jsonArraycoveredIndividuals = jsonObj.getAsJsonArray("coveredIndividuals"); + if (jsonArraycoveredIndividuals != null) { + // ensure the json data is an array + if (!jsonObj.get("coveredIndividuals").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `coveredIndividuals` to be an array in the JSON string but got `%s`", jsonObj.get("coveredIndividuals").toString())); + } + + // validate the optional field `coveredIndividuals` (array) + for (int i = 0; i < jsonArraycoveredIndividuals.size(); i++) { + CoveredIndividual.validateJsonElement(jsonArraycoveredIndividuals.get(i)); + }; + } + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); + 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("issuerId") != null && !jsonObj.get("issuerId").isJsonNull()) && !jsonObj.get("issuerId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `issuerId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerId").toString())); + } + if ((jsonObj.get("issuerReferenceId") != null && !jsonObj.get("issuerReferenceId").isJsonNull()) && !jsonObj.get("issuerReferenceId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `issuerReferenceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerReferenceId").toString())); + } + if ((jsonObj.get("issuerTin") != null && !jsonObj.get("issuerTin").isJsonNull()) && !jsonObj.get("issuerTin").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `issuerTin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerTin").toString())); + } + if ((jsonObj.get("referenceId") != null && !jsonObj.get("referenceId").isJsonNull()) && !jsonObj.get("referenceId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `referenceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("referenceId").toString())); + } + if ((jsonObj.get("tin") != null && !jsonObj.get("tin").isJsonNull()) && !jsonObj.get("tin").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `tin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tin").toString())); + } + if ((jsonObj.get("recipientName") != null && !jsonObj.get("recipientName").isJsonNull()) && !jsonObj.get("recipientName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `recipientName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientName").toString())); + } + if ((jsonObj.get("tinType") != null && !jsonObj.get("tinType").isJsonNull()) && !jsonObj.get("tinType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `tinType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tinType").toString())); + } + // validate the optional field `tinType` + if (jsonObj.get("tinType") != null && !jsonObj.get("tinType").isJsonNull()) { + TinTypeEnum.validateJsonElement(jsonObj.get("tinType")); + } + if ((jsonObj.get("recipientSecondName") != null && !jsonObj.get("recipientSecondName").isJsonNull()) && !jsonObj.get("recipientSecondName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `recipientSecondName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientSecondName").toString())); + } + if ((jsonObj.get("address") != null && !jsonObj.get("address").isJsonNull()) && !jsonObj.get("address").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address").toString())); + } + if ((jsonObj.get("address2") != null && !jsonObj.get("address2").isJsonNull()) && !jsonObj.get("address2").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `address2` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address2").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("zip") != null && !jsonObj.get("zip").isJsonNull()) && !jsonObj.get("zip").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `zip` to be a primitive type in the JSON string but got `%s`", jsonObj.get("zip").toString())); + } + if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if ((jsonObj.get("accountNumber") != null && !jsonObj.get("accountNumber").isJsonNull()) && !jsonObj.get("accountNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); + } + if ((jsonObj.get("officeCode") != null && !jsonObj.get("officeCode").isJsonNull()) && !jsonObj.get("officeCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `officeCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("officeCode").toString())); + } + if ((jsonObj.get("nonUsProvince") != null && !jsonObj.get("nonUsProvince").isJsonNull()) && !jsonObj.get("nonUsProvince").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `nonUsProvince` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nonUsProvince").toString())); + } + if ((jsonObj.get("countryCode") != null && !jsonObj.get("countryCode").isJsonNull()) && !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())); + } + // validate the optional field `stateAndLocalWithholding` + if (jsonObj.get("stateAndLocalWithholding") != null && !jsonObj.get("stateAndLocalWithholding").isJsonNull()) { + StateAndLocalWithholding.validateJsonElement(jsonObj.get("stateAndLocalWithholding")); + } + // validate the optional field `federalEfileStatus` + if (jsonObj.get("federalEfileStatus") != null && !jsonObj.get("federalEfileStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("federalEfileStatus")); + } + if (jsonObj.get("stateEfileStatus") != null && !jsonObj.get("stateEfileStatus").isJsonNull()) { + JsonArray jsonArraystateEfileStatus = jsonObj.getAsJsonArray("stateEfileStatus"); + if (jsonArraystateEfileStatus != null) { + // ensure the json data is an array + if (!jsonObj.get("stateEfileStatus").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `stateEfileStatus` to be an array in the JSON string but got `%s`", jsonObj.get("stateEfileStatus").toString())); + } + + // validate the optional field `stateEfileStatus` (array) + for (int i = 0; i < jsonArraystateEfileStatus.size(); i++) { + StateEfileStatusDetail.validateJsonElement(jsonArraystateEfileStatus.get(i)); + }; + } + } + // validate the optional field `postalMailStatus` + if (jsonObj.get("postalMailStatus") != null && !jsonObj.get("postalMailStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("postalMailStatus")); + } + // validate the optional field `tinMatchStatus` + if (jsonObj.get("tinMatchStatus") != null && !jsonObj.get("tinMatchStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("tinMatchStatus")); + } + // validate the optional field `addressVerificationStatus` + if (jsonObj.get("addressVerificationStatus") != null && !jsonObj.get("addressVerificationStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("addressVerificationStatus")); + } + // validate the optional field `eDeliveryStatus` + if (jsonObj.get("eDeliveryStatus") != null && !jsonObj.get("eDeliveryStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("eDeliveryStatus")); + } + if (jsonObj.get("validationErrors") != null && !jsonObj.get("validationErrors").isJsonNull()) { + JsonArray jsonArrayvalidationErrors = jsonObj.getAsJsonArray("validationErrors"); + if (jsonArrayvalidationErrors != null) { + // ensure the json data is an array + if (!jsonObj.get("validationErrors").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `validationErrors` to be an array in the JSON string but got `%s`", jsonObj.get("validationErrors").toString())); + } + + // validate the optional field `validationErrors` (array) + for (int i = 0; i < jsonArrayvalidationErrors.size(); i++) { + ValidationError.validateJsonElement(jsonArrayvalidationErrors.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Form1095C.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Form1095C' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Form1095C.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Form1095C value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Form1095C read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Form1095C given an JSON string + * + * @param jsonString JSON string + * @return An instance of Form1095C + * @throws IOException if the JSON string is invalid with respect to Form1095C + */ + public static Form1095C fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Form1095C.class); + } + + /** + * Convert an instance of Form1095C to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/Form1099Base.java b/src/main/java/Avalara/SDK/model/A1099/V2/Form1099Base.java index baecd0e..fc7ba62 100644 --- a/src/main/java/Avalara/SDK/model/A1099/V2/Form1099Base.java +++ b/src/main/java/Avalara/SDK/model/A1099/V2/Form1099Base.java @@ -30,6 +30,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.Arrays; @@ -65,17 +66,83 @@ */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class Form1099Base { - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; + /** + * Form type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + _1099_NEC("1099-NEC"), + + _1099_MISC("1099-MISC"), + + _1099_DIV("1099-DIV"), + + _1099_R("1099-R"), + + _1099_K("1099-K"), + + _1095_B("1095-B"), + + _1042_S("1042-S"), + + _1095_C("1095-C"), + + _1099_INT("1099-INT"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.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 TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) - private String type; + private TypeEnum type; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; public static final String SERIALIZED_NAME_ISSUER_ID = "issuerId"; @SerializedName(SERIALIZED_NAME_ISSUER_ID) - private Integer issuerId; + private String issuerId; public static final String SERIALIZED_NAME_ISSUER_REFERENCE_ID = "issuerReferenceId"; @SerializedName(SERIALIZED_NAME_ISSUER_REFERENCE_ID) @@ -89,81 +156,79 @@ public class Form1099Base { @SerializedName(SERIALIZED_NAME_TAX_YEAR) private Integer taxYear; - public static final String SERIALIZED_NAME_FEDERAL_EFILE = "federalEfile"; - @SerializedName(SERIALIZED_NAME_FEDERAL_EFILE) - private Boolean federalEfile; - - public static final String SERIALIZED_NAME_FEDERAL_EFILE_STATUS = "federalEfileStatus"; - @SerializedName(SERIALIZED_NAME_FEDERAL_EFILE_STATUS) - private Form1099StatusDetail federalEfileStatus; - - public static final String SERIALIZED_NAME_STATE_EFILE = "stateEfile"; - @SerializedName(SERIALIZED_NAME_STATE_EFILE) - private Boolean stateEfile; - - public static final String SERIALIZED_NAME_STATE_EFILE_STATUS = "stateEfileStatus"; - @SerializedName(SERIALIZED_NAME_STATE_EFILE_STATUS) - private List stateEfileStatus; + public static final String SERIALIZED_NAME_REFERENCE_ID = "referenceId"; + @SerializedName(SERIALIZED_NAME_REFERENCE_ID) + private String referenceId; - public static final String SERIALIZED_NAME_POSTAL_MAIL = "postalMail"; - @SerializedName(SERIALIZED_NAME_POSTAL_MAIL) - private Boolean postalMail; + public static final String SERIALIZED_NAME_TIN = "tin"; + @SerializedName(SERIALIZED_NAME_TIN) + private String tin; - public static final String SERIALIZED_NAME_POSTAL_MAIL_STATUS = "postalMailStatus"; - @SerializedName(SERIALIZED_NAME_POSTAL_MAIL_STATUS) - private Form1099StatusDetail postalMailStatus; + public static final String SERIALIZED_NAME_RECIPIENT_NAME = "recipientName"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_NAME) + private String recipientName; - public static final String SERIALIZED_NAME_TIN_MATCH = "tinMatch"; - @SerializedName(SERIALIZED_NAME_TIN_MATCH) - private Boolean tinMatch; + /** + * Type of TIN (Tax ID Number) + */ + @JsonAdapter(TinTypeEnum.Adapter.class) + public enum TinTypeEnum { + EMPTY("Empty"), + + EIN("EIN"), + + SSN("SSN"), + + ITIN("ITIN"), + + ATIN("ATIN"); + + private String value; + + TinTypeEnum(String value) { + this.value = value; + } - public static final String SERIALIZED_NAME_TIN_MATCH_STATUS = "tinMatchStatus"; - @SerializedName(SERIALIZED_NAME_TIN_MATCH_STATUS) - private Form1099StatusDetail tinMatchStatus; + public String getValue() { + return value; + } - public static final String SERIALIZED_NAME_ADDRESS_VERIFICATION = "addressVerification"; - @SerializedName(SERIALIZED_NAME_ADDRESS_VERIFICATION) - private Boolean addressVerification; + @Override + public String toString() { + return String.valueOf(value); + } - public static final String SERIALIZED_NAME_ADDRESS_VERIFICATION_STATUS = "addressVerificationStatus"; - @SerializedName(SERIALIZED_NAME_ADDRESS_VERIFICATION_STATUS) - private Form1099StatusDetail addressVerificationStatus; + public static TinTypeEnum fromValue(String value) { + for (TinTypeEnum b : TinTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } - public static final String SERIALIZED_NAME_E_DELIVERY_STATUS = "eDeliveryStatus"; - @SerializedName(SERIALIZED_NAME_E_DELIVERY_STATUS) - private Form1099StatusDetail eDeliveryStatus; + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TinTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } - public static final String SERIALIZED_NAME_REFERENCE_ID = "referenceId"; - @SerializedName(SERIALIZED_NAME_REFERENCE_ID) - private String referenceId; + @Override + public TinTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TinTypeEnum.fromValue(value); + } + } - public static final String SERIALIZED_NAME_EMAIL = "email"; - @SerializedName(SERIALIZED_NAME_EMAIL) - private String email; + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TinTypeEnum.fromValue(value); + } + } public static final String SERIALIZED_NAME_TIN_TYPE = "tinType"; @SerializedName(SERIALIZED_NAME_TIN_TYPE) - private String tinType; - - public static final String SERIALIZED_NAME_FATCA_FILING_REQUIREMENT = "fatcaFilingRequirement"; - @SerializedName(SERIALIZED_NAME_FATCA_FILING_REQUIREMENT) - private Boolean fatcaFilingRequirement; - - public static final String SERIALIZED_NAME_TIN = "tin"; - @SerializedName(SERIALIZED_NAME_TIN) - private String tin; - - public static final String SERIALIZED_NAME_NO_TIN = "noTin"; - @SerializedName(SERIALIZED_NAME_NO_TIN) - private Boolean noTin; - - public static final String SERIALIZED_NAME_SECOND_TIN_NOTICE = "secondTinNotice"; - @SerializedName(SERIALIZED_NAME_SECOND_TIN_NOTICE) - private Boolean secondTinNotice; - - public static final String SERIALIZED_NAME_RECIPIENT_NAME = "recipientName"; - @SerializedName(SERIALIZED_NAME_RECIPIENT_NAME) - private String recipientName; + private TinTypeEnum tinType; public static final String SERIALIZED_NAME_RECIPIENT_SECOND_NAME = "recipientSecondName"; @SerializedName(SERIALIZED_NAME_RECIPIENT_SECOND_NAME) @@ -189,6 +254,18 @@ public class Form1099Base { @SerializedName(SERIALIZED_NAME_ZIP) private String zip; + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) + private String accountNumber; + + public static final String SERIALIZED_NAME_OFFICE_CODE = "officeCode"; + @SerializedName(SERIALIZED_NAME_OFFICE_CODE) + private String officeCode; + public static final String SERIALIZED_NAME_NON_US_PROVINCE = "nonUsProvince"; @SerializedName(SERIALIZED_NAME_NON_US_PROVINCE) private String nonUsProvince; @@ -197,13 +274,65 @@ public class Form1099Base { @SerializedName(SERIALIZED_NAME_COUNTRY_CODE) private String countryCode; - public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; - @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) - private String accountNumber; + public static final String SERIALIZED_NAME_FEDERAL_EFILE_DATE = "federalEfileDate"; + @SerializedName(SERIALIZED_NAME_FEDERAL_EFILE_DATE) + private LocalDate federalEfileDate; - public static final String SERIALIZED_NAME_OFFICE_CODE = "officeCode"; - @SerializedName(SERIALIZED_NAME_OFFICE_CODE) - private String officeCode; + public static final String SERIALIZED_NAME_POSTAL_MAIL = "postalMail"; + @SerializedName(SERIALIZED_NAME_POSTAL_MAIL) + private Boolean postalMail; + + public static final String SERIALIZED_NAME_STATE_EFILE_DATE = "stateEfileDate"; + @SerializedName(SERIALIZED_NAME_STATE_EFILE_DATE) + private LocalDate stateEfileDate; + + public static final String SERIALIZED_NAME_RECIPIENT_EDELIVERY_DATE = "recipientEdeliveryDate"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_EDELIVERY_DATE) + private LocalDate recipientEdeliveryDate; + + public static final String SERIALIZED_NAME_TIN_MATCH = "tinMatch"; + @SerializedName(SERIALIZED_NAME_TIN_MATCH) + private Boolean tinMatch; + + public static final String SERIALIZED_NAME_NO_TIN = "noTin"; + @SerializedName(SERIALIZED_NAME_NO_TIN) + private Boolean noTin; + + public static final String SERIALIZED_NAME_ADDRESS_VERIFICATION = "addressVerification"; + @SerializedName(SERIALIZED_NAME_ADDRESS_VERIFICATION) + private Boolean addressVerification; + + public static final String SERIALIZED_NAME_STATE_AND_LOCAL_WITHHOLDING = "stateAndLocalWithholding"; + @SerializedName(SERIALIZED_NAME_STATE_AND_LOCAL_WITHHOLDING) + private StateAndLocalWithholding stateAndLocalWithholding; + + public static final String SERIALIZED_NAME_SECOND_TIN_NOTICE = "secondTinNotice"; + @SerializedName(SERIALIZED_NAME_SECOND_TIN_NOTICE) + private Boolean secondTinNotice; + + public static final String SERIALIZED_NAME_FEDERAL_EFILE_STATUS = "federalEfileStatus"; + @SerializedName(SERIALIZED_NAME_FEDERAL_EFILE_STATUS) + private Form1099StatusDetail federalEfileStatus; + + public static final String SERIALIZED_NAME_STATE_EFILE_STATUS = "stateEfileStatus"; + @SerializedName(SERIALIZED_NAME_STATE_EFILE_STATUS) + private List stateEfileStatus; + + public static final String SERIALIZED_NAME_POSTAL_MAIL_STATUS = "postalMailStatus"; + @SerializedName(SERIALIZED_NAME_POSTAL_MAIL_STATUS) + private Form1099StatusDetail postalMailStatus; + + public static final String SERIALIZED_NAME_TIN_MATCH_STATUS = "tinMatchStatus"; + @SerializedName(SERIALIZED_NAME_TIN_MATCH_STATUS) + private Form1099StatusDetail tinMatchStatus; + + public static final String SERIALIZED_NAME_ADDRESS_VERIFICATION_STATUS = "addressVerificationStatus"; + @SerializedName(SERIALIZED_NAME_ADDRESS_VERIFICATION_STATUS) + private Form1099StatusDetail addressVerificationStatus; + + public static final String SERIALIZED_NAME_E_DELIVERY_STATUS = "eDeliveryStatus"; + @SerializedName(SERIALIZED_NAME_E_DELIVERY_STATUS) + private Form1099StatusDetail eDeliveryStatus; public static final String SERIALIZED_NAME_VALIDATION_ERRORS = "validationErrors"; @SerializedName(SERIALIZED_NAME_VALIDATION_ERRORS) @@ -217,66 +346,79 @@ public class Form1099Base { @SerializedName(SERIALIZED_NAME_UPDATED_AT) private OffsetDateTime updatedAt; - public static final String SERIALIZED_NAME_STATE_AND_LOCAL_WITHHOLDING = "stateAndLocalWithholding"; - @SerializedName(SERIALIZED_NAME_STATE_AND_LOCAL_WITHHOLDING) - private StateAndLocalWithholding stateAndLocalWithholding; - public Form1099Base() { } - public Form1099Base id(String id) { + public Form1099Base( + String id, + Form1099StatusDetail federalEfileStatus, + List stateEfileStatus, + Form1099StatusDetail postalMailStatus, + Form1099StatusDetail tinMatchStatus, + Form1099StatusDetail addressVerificationStatus, + Form1099StatusDetail eDeliveryStatus, + List validationErrors, + OffsetDateTime createdAt, + OffsetDateTime updatedAt + ) { + this(); this.id = id; + this.federalEfileStatus = federalEfileStatus; + this.stateEfileStatus = stateEfileStatus; + this.postalMailStatus = postalMailStatus; + this.tinMatchStatus = tinMatchStatus; + this.addressVerificationStatus = addressVerificationStatus; + this.eDeliveryStatus = eDeliveryStatus; + this.validationErrors = validationErrors; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + + public Form1099Base type(TypeEnum type) { + this.type = type; return this; } /** - * Get id - * @return id + * Form type + * @return type */ - @javax.annotation.Nullable - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; } - - public Form1099Base type(String type) { + public void setType(TypeEnum type) { this.type = type; - return this; } + /** - * Get type - * @return type + * Form ID. Unique identifier set when the record is created. + * @return id */ @javax.annotation.Nullable - public String getType() { - return type; + public String getId() { + return id; } - public void setType(String type) { - this.type = type; - } - public Form1099Base issuerId(Integer issuerId) { + public Form1099Base issuerId(String issuerId) { this.issuerId = issuerId; return this; } /** - * Get issuerId + * Issuer ID - only required when creating forms * @return issuerId */ @javax.annotation.Nullable - public Integer getIssuerId() { + public String getIssuerId() { return issuerId; } - public void setIssuerId(Integer issuerId) { + public void setIssuerId(String issuerId) { this.issuerId = issuerId; } @@ -287,7 +429,7 @@ public Form1099Base issuerReferenceId(String issuerReferenceId) { } /** - * Get issuerReferenceId + * Issuer Reference ID - only required when creating forms * @return issuerReferenceId */ @javax.annotation.Nullable @@ -306,7 +448,7 @@ public Form1099Base issuerTin(String issuerTin) { } /** - * Get issuerTin + * Issuer TIN - readonly * @return issuerTin */ @javax.annotation.Nullable @@ -325,7 +467,7 @@ public Form1099Base taxYear(Integer taxYear) { } /** - * Get taxYear + * Tax Year - only required when creating forms * @return taxYear */ @javax.annotation.Nullable @@ -338,239 +480,193 @@ public void setTaxYear(Integer taxYear) { } - public Form1099Base federalEfile(Boolean federalEfile) { - this.federalEfile = federalEfile; - return this; - } - - /** - * Get federalEfile - * @return federalEfile - */ - @javax.annotation.Nullable - public Boolean getFederalEfile() { - return federalEfile; - } - - public void setFederalEfile(Boolean federalEfile) { - this.federalEfile = federalEfile; - } - - - public Form1099Base federalEfileStatus(Form1099StatusDetail federalEfileStatus) { - this.federalEfileStatus = federalEfileStatus; - return this; - } - - /** - * Get federalEfileStatus - * @return federalEfileStatus - */ - @javax.annotation.Nullable - public Form1099StatusDetail getFederalEfileStatus() { - return federalEfileStatus; - } - - public void setFederalEfileStatus(Form1099StatusDetail federalEfileStatus) { - this.federalEfileStatus = federalEfileStatus; - } - - - public Form1099Base stateEfile(Boolean stateEfile) { - this.stateEfile = stateEfile; + public Form1099Base referenceId(String referenceId) { + this.referenceId = referenceId; return this; } /** - * Get stateEfile - * @return stateEfile + * Internal reference ID. Never shown to any agency or recipient. + * @return referenceId */ @javax.annotation.Nullable - public Boolean getStateEfile() { - return stateEfile; + public String getReferenceId() { + return referenceId; } - public void setStateEfile(Boolean stateEfile) { - this.stateEfile = stateEfile; + public void setReferenceId(String referenceId) { + this.referenceId = referenceId; } - public Form1099Base stateEfileStatus(List stateEfileStatus) { - this.stateEfileStatus = stateEfileStatus; - return this; - } - - public Form1099Base addStateEfileStatusItem(StateEfileStatusDetail stateEfileStatusItem) { - if (this.stateEfileStatus == null) { - this.stateEfileStatus = new ArrayList<>(); - } - this.stateEfileStatus.add(stateEfileStatusItem); + public Form1099Base tin(String tin) { + this.tin = tin; return this; } /** - * Get stateEfileStatus - * @return stateEfileStatus + * Recipient's Federal Tax Identification Number (TIN). + * @return tin */ @javax.annotation.Nullable - public List getStateEfileStatus() { - return stateEfileStatus; + public String getTin() { + return tin; } - public void setStateEfileStatus(List stateEfileStatus) { - this.stateEfileStatus = stateEfileStatus; + public void setTin(String tin) { + this.tin = tin; } - public Form1099Base postalMail(Boolean postalMail) { - this.postalMail = postalMail; + public Form1099Base recipientName(String recipientName) { + this.recipientName = recipientName; return this; } /** - * Get postalMail - * @return postalMail + * Recipient name + * @return recipientName */ @javax.annotation.Nullable - public Boolean getPostalMail() { - return postalMail; + public String getRecipientName() { + return recipientName; } - public void setPostalMail(Boolean postalMail) { - this.postalMail = postalMail; + public void setRecipientName(String recipientName) { + this.recipientName = recipientName; } - public Form1099Base postalMailStatus(Form1099StatusDetail postalMailStatus) { - this.postalMailStatus = postalMailStatus; + public Form1099Base tinType(TinTypeEnum tinType) { + this.tinType = tinType; return this; } /** - * Get postalMailStatus - * @return postalMailStatus + * Type of TIN (Tax ID Number) + * @return tinType */ @javax.annotation.Nullable - public Form1099StatusDetail getPostalMailStatus() { - return postalMailStatus; + public TinTypeEnum getTinType() { + return tinType; } - public void setPostalMailStatus(Form1099StatusDetail postalMailStatus) { - this.postalMailStatus = postalMailStatus; + public void setTinType(TinTypeEnum tinType) { + this.tinType = tinType; } - public Form1099Base tinMatch(Boolean tinMatch) { - this.tinMatch = tinMatch; + public Form1099Base recipientSecondName(String recipientSecondName) { + this.recipientSecondName = recipientSecondName; return this; } /** - * Get tinMatch - * @return tinMatch + * Recipient second name + * @return recipientSecondName */ @javax.annotation.Nullable - public Boolean getTinMatch() { - return tinMatch; + public String getRecipientSecondName() { + return recipientSecondName; } - public void setTinMatch(Boolean tinMatch) { - this.tinMatch = tinMatch; + public void setRecipientSecondName(String recipientSecondName) { + this.recipientSecondName = recipientSecondName; } - public Form1099Base tinMatchStatus(Form1099StatusDetail tinMatchStatus) { - this.tinMatchStatus = tinMatchStatus; + public Form1099Base address(String address) { + this.address = address; return this; } /** - * Get tinMatchStatus - * @return tinMatchStatus + * Address. + * @return address */ @javax.annotation.Nullable - public Form1099StatusDetail getTinMatchStatus() { - return tinMatchStatus; + public String getAddress() { + return address; } - public void setTinMatchStatus(Form1099StatusDetail tinMatchStatus) { - this.tinMatchStatus = tinMatchStatus; + public void setAddress(String address) { + this.address = address; } - public Form1099Base addressVerification(Boolean addressVerification) { - this.addressVerification = addressVerification; + public Form1099Base address2(String address2) { + this.address2 = address2; return this; } /** - * Get addressVerification - * @return addressVerification + * Address line 2. + * @return address2 */ @javax.annotation.Nullable - public Boolean getAddressVerification() { - return addressVerification; + public String getAddress2() { + return address2; } - public void setAddressVerification(Boolean addressVerification) { - this.addressVerification = addressVerification; + public void setAddress2(String address2) { + this.address2 = address2; } - public Form1099Base addressVerificationStatus(Form1099StatusDetail addressVerificationStatus) { - this.addressVerificationStatus = addressVerificationStatus; + public Form1099Base city(String city) { + this.city = city; return this; } /** - * Get addressVerificationStatus - * @return addressVerificationStatus + * City. + * @return city */ @javax.annotation.Nullable - public Form1099StatusDetail getAddressVerificationStatus() { - return addressVerificationStatus; + public String getCity() { + return city; } - public void setAddressVerificationStatus(Form1099StatusDetail addressVerificationStatus) { - this.addressVerificationStatus = addressVerificationStatus; + public void setCity(String city) { + this.city = city; } - public Form1099Base eDeliveryStatus(Form1099StatusDetail eDeliveryStatus) { - this.eDeliveryStatus = eDeliveryStatus; + public Form1099Base state(String state) { + this.state = state; return this; } /** - * Get eDeliveryStatus - * @return eDeliveryStatus + * Two-letter US state or Canadian province code (required for US/CA addresses). + * @return state */ @javax.annotation.Nullable - public Form1099StatusDetail geteDeliveryStatus() { - return eDeliveryStatus; + public String getState() { + return state; } - public void seteDeliveryStatus(Form1099StatusDetail eDeliveryStatus) { - this.eDeliveryStatus = eDeliveryStatus; + public void setState(String state) { + this.state = state; } - public Form1099Base referenceId(String referenceId) { - this.referenceId = referenceId; + public Form1099Base zip(String zip) { + this.zip = zip; return this; } /** - * Get referenceId - * @return referenceId + * ZIP/postal code. + * @return zip */ @javax.annotation.Nullable - public String getReferenceId() { - return referenceId; + public String getZip() { + return zip; } - public void setReferenceId(String referenceId) { - this.referenceId = referenceId; + public void setZip(String zip) { + this.zip = zip; } @@ -580,7 +676,7 @@ public Form1099Base email(String email) { } /** - * Get email + * Recipient's Contact email address. * @return email */ @javax.annotation.Nullable @@ -593,325 +689,321 @@ public void setEmail(String email) { } - public Form1099Base tinType(String tinType) { - this.tinType = tinType; + public Form1099Base accountNumber(String accountNumber) { + this.accountNumber = accountNumber; return this; } /** - * Get tinType - * @return tinType + * Account number + * @return accountNumber */ @javax.annotation.Nullable - public String getTinType() { - return tinType; + public String getAccountNumber() { + return accountNumber; } - public void setTinType(String tinType) { - this.tinType = tinType; + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; } - public Form1099Base fatcaFilingRequirement(Boolean fatcaFilingRequirement) { - this.fatcaFilingRequirement = fatcaFilingRequirement; + public Form1099Base officeCode(String officeCode) { + this.officeCode = officeCode; return this; } /** - * Get fatcaFilingRequirement - * @return fatcaFilingRequirement + * Office code + * @return officeCode */ @javax.annotation.Nullable - public Boolean getFatcaFilingRequirement() { - return fatcaFilingRequirement; + public String getOfficeCode() { + return officeCode; } - public void setFatcaFilingRequirement(Boolean fatcaFilingRequirement) { - this.fatcaFilingRequirement = fatcaFilingRequirement; + public void setOfficeCode(String officeCode) { + this.officeCode = officeCode; } - public Form1099Base tin(String tin) { - this.tin = tin; + public Form1099Base nonUsProvince(String nonUsProvince) { + this.nonUsProvince = nonUsProvince; return this; } /** - * Get tin - * @return tin + * Province or region for non-US/CA addresses. + * @return nonUsProvince */ @javax.annotation.Nullable - public String getTin() { - return tin; + public String getNonUsProvince() { + return nonUsProvince; } - public void setTin(String tin) { - this.tin = tin; + public void setNonUsProvince(String nonUsProvince) { + this.nonUsProvince = nonUsProvince; } - public Form1099Base noTin(Boolean noTin) { - this.noTin = noTin; + public Form1099Base countryCode(String countryCode) { + this.countryCode = countryCode; return this; } /** - * Get noTin - * @return noTin + * Two-letter IRS country code (e.g., 'US', 'CA'), as defined at https://www.irs.gov/e-file-providers/country-codes. + * @return countryCode */ @javax.annotation.Nullable - public Boolean getNoTin() { - return noTin; + public String getCountryCode() { + return countryCode; } - public void setNoTin(Boolean noTin) { - this.noTin = noTin; + public void setCountryCode(String countryCode) { + this.countryCode = countryCode; } - public Form1099Base secondTinNotice(Boolean secondTinNotice) { - this.secondTinNotice = secondTinNotice; + public Form1099Base federalEfileDate(LocalDate federalEfileDate) { + this.federalEfileDate = federalEfileDate; return this; } /** - * Get secondTinNotice - * @return secondTinNotice + * Date when federal e-filing should be scheduled for this form + * @return federalEfileDate */ @javax.annotation.Nullable - public Boolean getSecondTinNotice() { - return secondTinNotice; + public LocalDate getFederalEfileDate() { + return federalEfileDate; } - public void setSecondTinNotice(Boolean secondTinNotice) { - this.secondTinNotice = secondTinNotice; + public void setFederalEfileDate(LocalDate federalEfileDate) { + this.federalEfileDate = federalEfileDate; } - public Form1099Base recipientName(String recipientName) { - this.recipientName = recipientName; + public Form1099Base postalMail(Boolean postalMail) { + this.postalMail = postalMail; return this; } /** - * Get recipientName - * @return recipientName + * Boolean indicating that postal mailing to the recipient should be scheduled for this form + * @return postalMail */ @javax.annotation.Nullable - public String getRecipientName() { - return recipientName; + public Boolean getPostalMail() { + return postalMail; } - public void setRecipientName(String recipientName) { - this.recipientName = recipientName; + public void setPostalMail(Boolean postalMail) { + this.postalMail = postalMail; } - public Form1099Base recipientSecondName(String recipientSecondName) { - this.recipientSecondName = recipientSecondName; + public Form1099Base stateEfileDate(LocalDate stateEfileDate) { + this.stateEfileDate = stateEfileDate; return this; } /** - * Get recipientSecondName - * @return recipientSecondName + * Date when state e-filing should be scheduled for this form + * @return stateEfileDate */ @javax.annotation.Nullable - public String getRecipientSecondName() { - return recipientSecondName; + public LocalDate getStateEfileDate() { + return stateEfileDate; } - public void setRecipientSecondName(String recipientSecondName) { - this.recipientSecondName = recipientSecondName; + public void setStateEfileDate(LocalDate stateEfileDate) { + this.stateEfileDate = stateEfileDate; } - public Form1099Base address(String address) { - this.address = address; + public Form1099Base recipientEdeliveryDate(LocalDate recipientEdeliveryDate) { + this.recipientEdeliveryDate = recipientEdeliveryDate; return this; } /** - * Get address - * @return address + * Date when recipient e-delivery should be scheduled for this form + * @return recipientEdeliveryDate */ @javax.annotation.Nullable - public String getAddress() { - return address; + public LocalDate getRecipientEdeliveryDate() { + return recipientEdeliveryDate; } - public void setAddress(String address) { - this.address = address; + public void setRecipientEdeliveryDate(LocalDate recipientEdeliveryDate) { + this.recipientEdeliveryDate = recipientEdeliveryDate; } - public Form1099Base address2(String address2) { - this.address2 = address2; + public Form1099Base tinMatch(Boolean tinMatch) { + this.tinMatch = tinMatch; return this; } /** - * Get address2 - * @return address2 + * Boolean indicating that TIN Matching should be scheduled for this form + * @return tinMatch */ @javax.annotation.Nullable - public String getAddress2() { - return address2; + public Boolean getTinMatch() { + return tinMatch; } - public void setAddress2(String address2) { - this.address2 = address2; + public void setTinMatch(Boolean tinMatch) { + this.tinMatch = tinMatch; } - public Form1099Base city(String city) { - this.city = city; + public Form1099Base noTin(Boolean noTin) { + this.noTin = noTin; return this; } /** - * Get city - * @return city + * No TIN indicator + * @return noTin */ @javax.annotation.Nullable - public String getCity() { - return city; + public Boolean getNoTin() { + return noTin; } - public void setCity(String city) { - this.city = city; + public void setNoTin(Boolean noTin) { + this.noTin = noTin; } - public Form1099Base state(String state) { - this.state = state; + public Form1099Base addressVerification(Boolean addressVerification) { + this.addressVerification = addressVerification; return this; } /** - * Get state - * @return state + * Boolean indicating that address verification should be scheduled for this form + * @return addressVerification */ @javax.annotation.Nullable - public String getState() { - return state; + public Boolean getAddressVerification() { + return addressVerification; } - public void setState(String state) { - this.state = state; + public void setAddressVerification(Boolean addressVerification) { + this.addressVerification = addressVerification; } - public Form1099Base zip(String zip) { - this.zip = zip; + public Form1099Base stateAndLocalWithholding(StateAndLocalWithholding stateAndLocalWithholding) { + this.stateAndLocalWithholding = stateAndLocalWithholding; return this; } /** - * Get zip - * @return zip + * State and local withholding information + * @return stateAndLocalWithholding */ @javax.annotation.Nullable - public String getZip() { - return zip; + public StateAndLocalWithholding getStateAndLocalWithholding() { + return stateAndLocalWithholding; } - public void setZip(String zip) { - this.zip = zip; + public void setStateAndLocalWithholding(StateAndLocalWithholding stateAndLocalWithholding) { + this.stateAndLocalWithholding = stateAndLocalWithholding; } - public Form1099Base nonUsProvince(String nonUsProvince) { - this.nonUsProvince = nonUsProvince; + public Form1099Base secondTinNotice(Boolean secondTinNotice) { + this.secondTinNotice = secondTinNotice; return this; } /** - * Get nonUsProvince - * @return nonUsProvince + * Second TIN notice + * @return secondTinNotice */ @javax.annotation.Nullable - public String getNonUsProvince() { - return nonUsProvince; + public Boolean getSecondTinNotice() { + return secondTinNotice; } - public void setNonUsProvince(String nonUsProvince) { - this.nonUsProvince = nonUsProvince; + public void setSecondTinNotice(Boolean secondTinNotice) { + this.secondTinNotice = secondTinNotice; } - public Form1099Base countryCode(String countryCode) { - this.countryCode = countryCode; - return this; - } - /** - * Get countryCode - * @return countryCode + * Federal e-file status + * @return federalEfileStatus */ @javax.annotation.Nullable - public String getCountryCode() { - return countryCode; + public Form1099StatusDetail getFederalEfileStatus() { + return federalEfileStatus; } - public void setCountryCode(String countryCode) { - this.countryCode = countryCode; - } - public Form1099Base accountNumber(String accountNumber) { - this.accountNumber = accountNumber; - return this; + /** + * State e-file status + * @return stateEfileStatus + */ + @javax.annotation.Nullable + public List getStateEfileStatus() { + return stateEfileStatus; } + + /** - * Get accountNumber - * @return accountNumber + * Postal mail to recipient status + * @return postalMailStatus */ @javax.annotation.Nullable - public String getAccountNumber() { - return accountNumber; + public Form1099StatusDetail getPostalMailStatus() { + return postalMailStatus; } - public void setAccountNumber(String accountNumber) { - this.accountNumber = accountNumber; - } - public Form1099Base officeCode(String officeCode) { - this.officeCode = officeCode; - return this; + /** + * TIN Match status + * @return tinMatchStatus + */ + @javax.annotation.Nullable + public Form1099StatusDetail getTinMatchStatus() { + return tinMatchStatus; } + + /** - * Get officeCode - * @return officeCode + * Address verification status + * @return addressVerificationStatus */ @javax.annotation.Nullable - public String getOfficeCode() { - return officeCode; + public Form1099StatusDetail getAddressVerificationStatus() { + return addressVerificationStatus; } - public void setOfficeCode(String officeCode) { - this.officeCode = officeCode; - } - public Form1099Base validationErrors(List validationErrors) { - this.validationErrors = validationErrors; - return this; + /** + * EDelivery status + * @return eDeliveryStatus + */ + @javax.annotation.Nullable + public Form1099StatusDetail geteDeliveryStatus() { + return eDeliveryStatus; } - public Form1099Base addValidationErrorsItem(ValidationError validationErrorsItem) { - if (this.validationErrors == null) { - this.validationErrors = new ArrayList<>(); - } - this.validationErrors.add(validationErrorsItem); - return this; - } + /** - * Get validationErrors + * Validation errors * @return validationErrors */ @javax.annotation.Nullable @@ -919,18 +1011,10 @@ public List getValidationErrors() { return validationErrors; } - public void setValidationErrors(List validationErrors) { - this.validationErrors = validationErrors; - } - - public Form1099Base createdAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - return this; - } /** - * Get createdAt + * Date time when the record was created. * @return createdAt */ @javax.annotation.Nullable @@ -938,18 +1022,10 @@ public OffsetDateTime getCreatedAt() { return createdAt; } - public void setCreatedAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - } - - public Form1099Base updatedAt(OffsetDateTime updatedAt) { - this.updatedAt = updatedAt; - return this; - } /** - * Get updatedAt + * Date time when the record was last updated. * @return updatedAt */ @javax.annotation.Nullable @@ -957,28 +1033,6 @@ public OffsetDateTime getUpdatedAt() { return updatedAt; } - public void setUpdatedAt(OffsetDateTime updatedAt) { - this.updatedAt = updatedAt; - } - - - public Form1099Base stateAndLocalWithholding(StateAndLocalWithholding stateAndLocalWithholding) { - this.stateAndLocalWithholding = stateAndLocalWithholding; - return this; - } - - /** - * Get stateAndLocalWithholding - * @return stateAndLocalWithholding - */ - @javax.annotation.Nullable - public StateAndLocalWithholding getStateAndLocalWithholding() { - return stateAndLocalWithholding; - } - - public void setStateAndLocalWithholding(StateAndLocalWithholding stateAndLocalWithholding) { - this.stateAndLocalWithholding = stateAndLocalWithholding; - } @@ -991,45 +1045,45 @@ public boolean equals(Object o) { return false; } Form1099Base form1099Base = (Form1099Base) o; - return Objects.equals(this.id, form1099Base.id) && - Objects.equals(this.type, form1099Base.type) && + return Objects.equals(this.type, form1099Base.type) && + Objects.equals(this.id, form1099Base.id) && Objects.equals(this.issuerId, form1099Base.issuerId) && Objects.equals(this.issuerReferenceId, form1099Base.issuerReferenceId) && Objects.equals(this.issuerTin, form1099Base.issuerTin) && Objects.equals(this.taxYear, form1099Base.taxYear) && - Objects.equals(this.federalEfile, form1099Base.federalEfile) && - Objects.equals(this.federalEfileStatus, form1099Base.federalEfileStatus) && - Objects.equals(this.stateEfile, form1099Base.stateEfile) && - Objects.equals(this.stateEfileStatus, form1099Base.stateEfileStatus) && - Objects.equals(this.postalMail, form1099Base.postalMail) && - Objects.equals(this.postalMailStatus, form1099Base.postalMailStatus) && - Objects.equals(this.tinMatch, form1099Base.tinMatch) && - Objects.equals(this.tinMatchStatus, form1099Base.tinMatchStatus) && - Objects.equals(this.addressVerification, form1099Base.addressVerification) && - Objects.equals(this.addressVerificationStatus, form1099Base.addressVerificationStatus) && - Objects.equals(this.eDeliveryStatus, form1099Base.eDeliveryStatus) && Objects.equals(this.referenceId, form1099Base.referenceId) && - Objects.equals(this.email, form1099Base.email) && - Objects.equals(this.tinType, form1099Base.tinType) && - Objects.equals(this.fatcaFilingRequirement, form1099Base.fatcaFilingRequirement) && Objects.equals(this.tin, form1099Base.tin) && - Objects.equals(this.noTin, form1099Base.noTin) && - Objects.equals(this.secondTinNotice, form1099Base.secondTinNotice) && Objects.equals(this.recipientName, form1099Base.recipientName) && + Objects.equals(this.tinType, form1099Base.tinType) && Objects.equals(this.recipientSecondName, form1099Base.recipientSecondName) && Objects.equals(this.address, form1099Base.address) && Objects.equals(this.address2, form1099Base.address2) && Objects.equals(this.city, form1099Base.city) && Objects.equals(this.state, form1099Base.state) && Objects.equals(this.zip, form1099Base.zip) && - Objects.equals(this.nonUsProvince, form1099Base.nonUsProvince) && - Objects.equals(this.countryCode, form1099Base.countryCode) && + Objects.equals(this.email, form1099Base.email) && Objects.equals(this.accountNumber, form1099Base.accountNumber) && Objects.equals(this.officeCode, form1099Base.officeCode) && + Objects.equals(this.nonUsProvince, form1099Base.nonUsProvince) && + Objects.equals(this.countryCode, form1099Base.countryCode) && + Objects.equals(this.federalEfileDate, form1099Base.federalEfileDate) && + Objects.equals(this.postalMail, form1099Base.postalMail) && + Objects.equals(this.stateEfileDate, form1099Base.stateEfileDate) && + Objects.equals(this.recipientEdeliveryDate, form1099Base.recipientEdeliveryDate) && + Objects.equals(this.tinMatch, form1099Base.tinMatch) && + Objects.equals(this.noTin, form1099Base.noTin) && + Objects.equals(this.addressVerification, form1099Base.addressVerification) && + Objects.equals(this.stateAndLocalWithholding, form1099Base.stateAndLocalWithholding) && + Objects.equals(this.secondTinNotice, form1099Base.secondTinNotice) && + Objects.equals(this.federalEfileStatus, form1099Base.federalEfileStatus) && + Objects.equals(this.stateEfileStatus, form1099Base.stateEfileStatus) && + Objects.equals(this.postalMailStatus, form1099Base.postalMailStatus) && + Objects.equals(this.tinMatchStatus, form1099Base.tinMatchStatus) && + Objects.equals(this.addressVerificationStatus, form1099Base.addressVerificationStatus) && + Objects.equals(this.eDeliveryStatus, form1099Base.eDeliveryStatus) && Objects.equals(this.validationErrors, form1099Base.validationErrors) && Objects.equals(this.createdAt, form1099Base.createdAt) && - Objects.equals(this.updatedAt, form1099Base.updatedAt) && - Objects.equals(this.stateAndLocalWithholding, form1099Base.stateAndLocalWithholding); + Objects.equals(this.updatedAt, form1099Base.updatedAt); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -1038,7 +1092,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(id, type, issuerId, issuerReferenceId, issuerTin, taxYear, federalEfile, federalEfileStatus, stateEfile, stateEfileStatus, postalMail, postalMailStatus, tinMatch, tinMatchStatus, addressVerification, addressVerificationStatus, eDeliveryStatus, referenceId, email, tinType, fatcaFilingRequirement, tin, noTin, secondTinNotice, recipientName, recipientSecondName, address, address2, city, state, zip, nonUsProvince, countryCode, accountNumber, officeCode, validationErrors, createdAt, updatedAt, stateAndLocalWithholding); + return Objects.hash(type, id, issuerId, issuerReferenceId, issuerTin, taxYear, referenceId, tin, recipientName, tinType, recipientSecondName, address, address2, city, state, zip, email, accountNumber, officeCode, nonUsProvince, countryCode, federalEfileDate, postalMail, stateEfileDate, recipientEdeliveryDate, tinMatch, noTin, addressVerification, stateAndLocalWithholding, secondTinNotice, federalEfileStatus, stateEfileStatus, postalMailStatus, tinMatchStatus, addressVerificationStatus, eDeliveryStatus, validationErrors, createdAt, updatedAt); } private static int hashCodeNullable(JsonNullable a) { @@ -1052,45 +1106,45 @@ private static int hashCodeNullable(JsonNullable a) { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Form1099Base {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" issuerId: ").append(toIndentedString(issuerId)).append("\n"); sb.append(" issuerReferenceId: ").append(toIndentedString(issuerReferenceId)).append("\n"); sb.append(" issuerTin: ").append(toIndentedString(issuerTin)).append("\n"); sb.append(" taxYear: ").append(toIndentedString(taxYear)).append("\n"); - sb.append(" federalEfile: ").append(toIndentedString(federalEfile)).append("\n"); - sb.append(" federalEfileStatus: ").append(toIndentedString(federalEfileStatus)).append("\n"); - sb.append(" stateEfile: ").append(toIndentedString(stateEfile)).append("\n"); - sb.append(" stateEfileStatus: ").append(toIndentedString(stateEfileStatus)).append("\n"); - sb.append(" postalMail: ").append(toIndentedString(postalMail)).append("\n"); - sb.append(" postalMailStatus: ").append(toIndentedString(postalMailStatus)).append("\n"); - sb.append(" tinMatch: ").append(toIndentedString(tinMatch)).append("\n"); - sb.append(" tinMatchStatus: ").append(toIndentedString(tinMatchStatus)).append("\n"); - sb.append(" addressVerification: ").append(toIndentedString(addressVerification)).append("\n"); - sb.append(" addressVerificationStatus: ").append(toIndentedString(addressVerificationStatus)).append("\n"); - sb.append(" eDeliveryStatus: ").append(toIndentedString(eDeliveryStatus)).append("\n"); sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" tinType: ").append(toIndentedString(tinType)).append("\n"); - sb.append(" fatcaFilingRequirement: ").append(toIndentedString(fatcaFilingRequirement)).append("\n"); sb.append(" tin: ").append(toIndentedString(tin)).append("\n"); - sb.append(" noTin: ").append(toIndentedString(noTin)).append("\n"); - sb.append(" secondTinNotice: ").append(toIndentedString(secondTinNotice)).append("\n"); sb.append(" recipientName: ").append(toIndentedString(recipientName)).append("\n"); + sb.append(" tinType: ").append(toIndentedString(tinType)).append("\n"); sb.append(" recipientSecondName: ").append(toIndentedString(recipientSecondName)).append("\n"); sb.append(" address: ").append(toIndentedString(address)).append("\n"); sb.append(" address2: ").append(toIndentedString(address2)).append("\n"); sb.append(" city: ").append(toIndentedString(city)).append("\n"); sb.append(" state: ").append(toIndentedString(state)).append("\n"); sb.append(" zip: ").append(toIndentedString(zip)).append("\n"); - sb.append(" nonUsProvince: ").append(toIndentedString(nonUsProvince)).append("\n"); - sb.append(" countryCode: ").append(toIndentedString(countryCode)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); sb.append(" officeCode: ").append(toIndentedString(officeCode)).append("\n"); + sb.append(" nonUsProvince: ").append(toIndentedString(nonUsProvince)).append("\n"); + sb.append(" countryCode: ").append(toIndentedString(countryCode)).append("\n"); + sb.append(" federalEfileDate: ").append(toIndentedString(federalEfileDate)).append("\n"); + sb.append(" postalMail: ").append(toIndentedString(postalMail)).append("\n"); + sb.append(" stateEfileDate: ").append(toIndentedString(stateEfileDate)).append("\n"); + sb.append(" recipientEdeliveryDate: ").append(toIndentedString(recipientEdeliveryDate)).append("\n"); + sb.append(" tinMatch: ").append(toIndentedString(tinMatch)).append("\n"); + sb.append(" noTin: ").append(toIndentedString(noTin)).append("\n"); + sb.append(" addressVerification: ").append(toIndentedString(addressVerification)).append("\n"); + sb.append(" stateAndLocalWithholding: ").append(toIndentedString(stateAndLocalWithholding)).append("\n"); + sb.append(" secondTinNotice: ").append(toIndentedString(secondTinNotice)).append("\n"); + sb.append(" federalEfileStatus: ").append(toIndentedString(federalEfileStatus)).append("\n"); + sb.append(" stateEfileStatus: ").append(toIndentedString(stateEfileStatus)).append("\n"); + sb.append(" postalMailStatus: ").append(toIndentedString(postalMailStatus)).append("\n"); + sb.append(" tinMatchStatus: ").append(toIndentedString(tinMatchStatus)).append("\n"); + sb.append(" addressVerificationStatus: ").append(toIndentedString(addressVerificationStatus)).append("\n"); + sb.append(" eDeliveryStatus: ").append(toIndentedString(eDeliveryStatus)).append("\n"); sb.append(" validationErrors: ").append(toIndentedString(validationErrors)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append(" stateAndLocalWithholding: ").append(toIndentedString(stateAndLocalWithholding)).append("\n"); sb.append("}"); return sb.toString(); } @@ -1113,48 +1167,53 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("id"); openapiFields.add("type"); + openapiFields.add("id"); openapiFields.add("issuerId"); openapiFields.add("issuerReferenceId"); openapiFields.add("issuerTin"); openapiFields.add("taxYear"); - openapiFields.add("federalEfile"); - openapiFields.add("federalEfileStatus"); - openapiFields.add("stateEfile"); - openapiFields.add("stateEfileStatus"); - openapiFields.add("postalMail"); - openapiFields.add("postalMailStatus"); - openapiFields.add("tinMatch"); - openapiFields.add("tinMatchStatus"); - openapiFields.add("addressVerification"); - openapiFields.add("addressVerificationStatus"); - openapiFields.add("eDeliveryStatus"); openapiFields.add("referenceId"); - openapiFields.add("email"); - openapiFields.add("tinType"); - openapiFields.add("fatcaFilingRequirement"); openapiFields.add("tin"); - openapiFields.add("noTin"); - openapiFields.add("secondTinNotice"); openapiFields.add("recipientName"); + openapiFields.add("tinType"); openapiFields.add("recipientSecondName"); openapiFields.add("address"); openapiFields.add("address2"); openapiFields.add("city"); openapiFields.add("state"); openapiFields.add("zip"); - openapiFields.add("nonUsProvince"); - openapiFields.add("countryCode"); + openapiFields.add("email"); openapiFields.add("accountNumber"); openapiFields.add("officeCode"); + openapiFields.add("nonUsProvince"); + openapiFields.add("countryCode"); + openapiFields.add("federalEfileDate"); + openapiFields.add("postalMail"); + openapiFields.add("stateEfileDate"); + openapiFields.add("recipientEdeliveryDate"); + openapiFields.add("tinMatch"); + openapiFields.add("noTin"); + openapiFields.add("addressVerification"); + openapiFields.add("stateAndLocalWithholding"); + openapiFields.add("secondTinNotice"); + openapiFields.add("federalEfileStatus"); + openapiFields.add("stateEfileStatus"); + openapiFields.add("postalMailStatus"); + openapiFields.add("tinMatchStatus"); + openapiFields.add("addressVerificationStatus"); + openapiFields.add("eDeliveryStatus"); openapiFields.add("validationErrors"); openapiFields.add("createdAt"); openapiFields.add("updatedAt"); - openapiFields.add("stateAndLocalWithholding"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("recipientName"); + openapiRequiredFields.add("address"); + openapiRequiredFields.add("city"); + openapiRequiredFields.add("countryCode"); } /** @@ -1177,12 +1236,24 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Form1099Base` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Form1099Base.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("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); 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("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + if ((jsonObj.get("issuerId") != null && !jsonObj.get("issuerId").isJsonNull()) && !jsonObj.get("issuerId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `issuerId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerId").toString())); } if ((jsonObj.get("issuerReferenceId") != null && !jsonObj.get("issuerReferenceId").isJsonNull()) && !jsonObj.get("issuerReferenceId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `issuerReferenceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerReferenceId").toString())); @@ -1190,55 +1261,22 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("issuerTin") != null && !jsonObj.get("issuerTin").isJsonNull()) && !jsonObj.get("issuerTin").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `issuerTin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerTin").toString())); } - // validate the optional field `federalEfileStatus` - if (jsonObj.get("federalEfileStatus") != null && !jsonObj.get("federalEfileStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("federalEfileStatus")); - } - if (jsonObj.get("stateEfileStatus") != null && !jsonObj.get("stateEfileStatus").isJsonNull()) { - JsonArray jsonArraystateEfileStatus = jsonObj.getAsJsonArray("stateEfileStatus"); - if (jsonArraystateEfileStatus != null) { - // ensure the json data is an array - if (!jsonObj.get("stateEfileStatus").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `stateEfileStatus` to be an array in the JSON string but got `%s`", jsonObj.get("stateEfileStatus").toString())); - } - - // validate the optional field `stateEfileStatus` (array) - for (int i = 0; i < jsonArraystateEfileStatus.size(); i++) { - StateEfileStatusDetail.validateJsonElement(jsonArraystateEfileStatus.get(i)); - }; - } - } - // validate the optional field `postalMailStatus` - if (jsonObj.get("postalMailStatus") != null && !jsonObj.get("postalMailStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("postalMailStatus")); - } - // validate the optional field `tinMatchStatus` - if (jsonObj.get("tinMatchStatus") != null && !jsonObj.get("tinMatchStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("tinMatchStatus")); - } - // validate the optional field `addressVerificationStatus` - if (jsonObj.get("addressVerificationStatus") != null && !jsonObj.get("addressVerificationStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("addressVerificationStatus")); - } - // validate the optional field `eDeliveryStatus` - if (jsonObj.get("eDeliveryStatus") != null && !jsonObj.get("eDeliveryStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("eDeliveryStatus")); - } if ((jsonObj.get("referenceId") != null && !jsonObj.get("referenceId").isJsonNull()) && !jsonObj.get("referenceId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `referenceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("referenceId").toString())); } - if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); - } - if ((jsonObj.get("tinType") != null && !jsonObj.get("tinType").isJsonNull()) && !jsonObj.get("tinType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `tinType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tinType").toString())); - } if ((jsonObj.get("tin") != null && !jsonObj.get("tin").isJsonNull()) && !jsonObj.get("tin").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `tin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tin").toString())); } if ((jsonObj.get("recipientName") != null && !jsonObj.get("recipientName").isJsonNull()) && !jsonObj.get("recipientName").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `recipientName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientName").toString())); } + if ((jsonObj.get("tinType") != null && !jsonObj.get("tinType").isJsonNull()) && !jsonObj.get("tinType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `tinType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tinType").toString())); + } + // validate the optional field `tinType` + if (jsonObj.get("tinType") != null && !jsonObj.get("tinType").isJsonNull()) { + TinTypeEnum.validateJsonElement(jsonObj.get("tinType")); + } if ((jsonObj.get("recipientSecondName") != null && !jsonObj.get("recipientSecondName").isJsonNull()) && !jsonObj.get("recipientSecondName").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `recipientSecondName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientSecondName").toString())); } @@ -1257,17 +1295,58 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("zip") != null && !jsonObj.get("zip").isJsonNull()) && !jsonObj.get("zip").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `zip` to be a primitive type in the JSON string but got `%s`", jsonObj.get("zip").toString())); } + if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if ((jsonObj.get("accountNumber") != null && !jsonObj.get("accountNumber").isJsonNull()) && !jsonObj.get("accountNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); + } + if ((jsonObj.get("officeCode") != null && !jsonObj.get("officeCode").isJsonNull()) && !jsonObj.get("officeCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `officeCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("officeCode").toString())); + } if ((jsonObj.get("nonUsProvince") != null && !jsonObj.get("nonUsProvince").isJsonNull()) && !jsonObj.get("nonUsProvince").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `nonUsProvince` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nonUsProvince").toString())); } if ((jsonObj.get("countryCode") != null && !jsonObj.get("countryCode").isJsonNull()) && !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("accountNumber") != null && !jsonObj.get("accountNumber").isJsonNull()) && !jsonObj.get("accountNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); + // validate the optional field `stateAndLocalWithholding` + if (jsonObj.get("stateAndLocalWithholding") != null && !jsonObj.get("stateAndLocalWithholding").isJsonNull()) { + StateAndLocalWithholding.validateJsonElement(jsonObj.get("stateAndLocalWithholding")); } - if ((jsonObj.get("officeCode") != null && !jsonObj.get("officeCode").isJsonNull()) && !jsonObj.get("officeCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `officeCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("officeCode").toString())); + // validate the optional field `federalEfileStatus` + if (jsonObj.get("federalEfileStatus") != null && !jsonObj.get("federalEfileStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("federalEfileStatus")); + } + if (jsonObj.get("stateEfileStatus") != null && !jsonObj.get("stateEfileStatus").isJsonNull()) { + JsonArray jsonArraystateEfileStatus = jsonObj.getAsJsonArray("stateEfileStatus"); + if (jsonArraystateEfileStatus != null) { + // ensure the json data is an array + if (!jsonObj.get("stateEfileStatus").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `stateEfileStatus` to be an array in the JSON string but got `%s`", jsonObj.get("stateEfileStatus").toString())); + } + + // validate the optional field `stateEfileStatus` (array) + for (int i = 0; i < jsonArraystateEfileStatus.size(); i++) { + StateEfileStatusDetail.validateJsonElement(jsonArraystateEfileStatus.get(i)); + }; + } + } + // validate the optional field `postalMailStatus` + if (jsonObj.get("postalMailStatus") != null && !jsonObj.get("postalMailStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("postalMailStatus")); + } + // validate the optional field `tinMatchStatus` + if (jsonObj.get("tinMatchStatus") != null && !jsonObj.get("tinMatchStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("tinMatchStatus")); + } + // validate the optional field `addressVerificationStatus` + if (jsonObj.get("addressVerificationStatus") != null && !jsonObj.get("addressVerificationStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("addressVerificationStatus")); + } + // validate the optional field `eDeliveryStatus` + if (jsonObj.get("eDeliveryStatus") != null && !jsonObj.get("eDeliveryStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("eDeliveryStatus")); } if (jsonObj.get("validationErrors") != null && !jsonObj.get("validationErrors").isJsonNull()) { JsonArray jsonArrayvalidationErrors = jsonObj.getAsJsonArray("validationErrors"); @@ -1283,10 +1362,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti }; } } - // validate the optional field `stateAndLocalWithholding` - if (jsonObj.get("stateAndLocalWithholding") != null && !jsonObj.get("stateAndLocalWithholding").isJsonNull()) { - StateAndLocalWithholding.validateJsonElement(jsonObj.get("stateAndLocalWithholding")); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/Form1099Div.java b/src/main/java/Avalara/SDK/model/A1099/V2/Form1099Div.java index df98ea0..76ad052 100644 --- a/src/main/java/Avalara/SDK/model/A1099/V2/Form1099Div.java +++ b/src/main/java/Avalara/SDK/model/A1099/V2/Form1099Div.java @@ -30,6 +30,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.Arrays; @@ -61,7 +62,7 @@ import Avalara.SDK.JSON; /** - * Form1099Div + * Form 1099-DIV: Dividends and Distributions */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class Form1099Div { @@ -141,17 +142,83 @@ public class Form1099Div { @SerializedName(SERIALIZED_NAME_FATCA_FILING_REQUIREMENT) private Boolean fatcaFilingRequirement; - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; + /** + * Form type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + _1099_NEC("1099-NEC"), + + _1099_MISC("1099-MISC"), + + _1099_DIV("1099-DIV"), + + _1099_R("1099-R"), + + _1099_K("1099-K"), + + _1095_B("1095-B"), + + _1042_S("1042-S"), + + _1095_C("1095-C"), + + _1099_INT("1099-INT"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.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 TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) - private String type; + private TypeEnum type; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; public static final String SERIALIZED_NAME_ISSUER_ID = "issuerId"; @SerializedName(SERIALIZED_NAME_ISSUER_ID) - private Integer issuerId; + private String issuerId; public static final String SERIALIZED_NAME_ISSUER_REFERENCE_ID = "issuerReferenceId"; @SerializedName(SERIALIZED_NAME_ISSUER_REFERENCE_ID) @@ -165,77 +232,79 @@ public class Form1099Div { @SerializedName(SERIALIZED_NAME_TAX_YEAR) private Integer taxYear; - public static final String SERIALIZED_NAME_FEDERAL_EFILE = "federalEfile"; - @SerializedName(SERIALIZED_NAME_FEDERAL_EFILE) - private Boolean federalEfile; - - public static final String SERIALIZED_NAME_FEDERAL_EFILE_STATUS = "federalEfileStatus"; - @SerializedName(SERIALIZED_NAME_FEDERAL_EFILE_STATUS) - private Form1099StatusDetail federalEfileStatus; - - public static final String SERIALIZED_NAME_STATE_EFILE = "stateEfile"; - @SerializedName(SERIALIZED_NAME_STATE_EFILE) - private Boolean stateEfile; - - public static final String SERIALIZED_NAME_STATE_EFILE_STATUS = "stateEfileStatus"; - @SerializedName(SERIALIZED_NAME_STATE_EFILE_STATUS) - private List stateEfileStatus; + public static final String SERIALIZED_NAME_REFERENCE_ID = "referenceId"; + @SerializedName(SERIALIZED_NAME_REFERENCE_ID) + private String referenceId; - public static final String SERIALIZED_NAME_POSTAL_MAIL = "postalMail"; - @SerializedName(SERIALIZED_NAME_POSTAL_MAIL) - private Boolean postalMail; + public static final String SERIALIZED_NAME_TIN = "tin"; + @SerializedName(SERIALIZED_NAME_TIN) + private String tin; - public static final String SERIALIZED_NAME_POSTAL_MAIL_STATUS = "postalMailStatus"; - @SerializedName(SERIALIZED_NAME_POSTAL_MAIL_STATUS) - private Form1099StatusDetail postalMailStatus; + public static final String SERIALIZED_NAME_RECIPIENT_NAME = "recipientName"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_NAME) + private String recipientName; - public static final String SERIALIZED_NAME_TIN_MATCH = "tinMatch"; - @SerializedName(SERIALIZED_NAME_TIN_MATCH) - private Boolean tinMatch; + /** + * Type of TIN (Tax ID Number) + */ + @JsonAdapter(TinTypeEnum.Adapter.class) + public enum TinTypeEnum { + EMPTY("Empty"), + + EIN("EIN"), + + SSN("SSN"), + + ITIN("ITIN"), + + ATIN("ATIN"); + + private String value; + + TinTypeEnum(String value) { + this.value = value; + } - public static final String SERIALIZED_NAME_TIN_MATCH_STATUS = "tinMatchStatus"; - @SerializedName(SERIALIZED_NAME_TIN_MATCH_STATUS) - private Form1099StatusDetail tinMatchStatus; + public String getValue() { + return value; + } - public static final String SERIALIZED_NAME_ADDRESS_VERIFICATION = "addressVerification"; - @SerializedName(SERIALIZED_NAME_ADDRESS_VERIFICATION) - private Boolean addressVerification; + @Override + public String toString() { + return String.valueOf(value); + } - public static final String SERIALIZED_NAME_ADDRESS_VERIFICATION_STATUS = "addressVerificationStatus"; - @SerializedName(SERIALIZED_NAME_ADDRESS_VERIFICATION_STATUS) - private Form1099StatusDetail addressVerificationStatus; + public static TinTypeEnum fromValue(String value) { + for (TinTypeEnum b : TinTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } - public static final String SERIALIZED_NAME_E_DELIVERY_STATUS = "eDeliveryStatus"; - @SerializedName(SERIALIZED_NAME_E_DELIVERY_STATUS) - private Form1099StatusDetail eDeliveryStatus; + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TinTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } - public static final String SERIALIZED_NAME_REFERENCE_ID = "referenceId"; - @SerializedName(SERIALIZED_NAME_REFERENCE_ID) - private String referenceId; + @Override + public TinTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TinTypeEnum.fromValue(value); + } + } - public static final String SERIALIZED_NAME_EMAIL = "email"; - @SerializedName(SERIALIZED_NAME_EMAIL) - private String email; + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TinTypeEnum.fromValue(value); + } + } public static final String SERIALIZED_NAME_TIN_TYPE = "tinType"; @SerializedName(SERIALIZED_NAME_TIN_TYPE) - private String tinType; - - public static final String SERIALIZED_NAME_TIN = "tin"; - @SerializedName(SERIALIZED_NAME_TIN) - private String tin; - - public static final String SERIALIZED_NAME_NO_TIN = "noTin"; - @SerializedName(SERIALIZED_NAME_NO_TIN) - private Boolean noTin; - - public static final String SERIALIZED_NAME_SECOND_TIN_NOTICE = "secondTinNotice"; - @SerializedName(SERIALIZED_NAME_SECOND_TIN_NOTICE) - private Boolean secondTinNotice; - - public static final String SERIALIZED_NAME_RECIPIENT_NAME = "recipientName"; - @SerializedName(SERIALIZED_NAME_RECIPIENT_NAME) - private String recipientName; + private TinTypeEnum tinType; public static final String SERIALIZED_NAME_RECIPIENT_SECOND_NAME = "recipientSecondName"; @SerializedName(SERIALIZED_NAME_RECIPIENT_SECOND_NAME) @@ -261,6 +330,18 @@ public class Form1099Div { @SerializedName(SERIALIZED_NAME_ZIP) private String zip; + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) + private String accountNumber; + + public static final String SERIALIZED_NAME_OFFICE_CODE = "officeCode"; + @SerializedName(SERIALIZED_NAME_OFFICE_CODE) + private String officeCode; + public static final String SERIALIZED_NAME_NON_US_PROVINCE = "nonUsProvince"; @SerializedName(SERIALIZED_NAME_NON_US_PROVINCE) private String nonUsProvince; @@ -269,13 +350,65 @@ public class Form1099Div { @SerializedName(SERIALIZED_NAME_COUNTRY_CODE) private String countryCode; - public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; - @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) - private String accountNumber; + public static final String SERIALIZED_NAME_FEDERAL_EFILE_DATE = "federalEfileDate"; + @SerializedName(SERIALIZED_NAME_FEDERAL_EFILE_DATE) + private LocalDate federalEfileDate; - public static final String SERIALIZED_NAME_OFFICE_CODE = "officeCode"; - @SerializedName(SERIALIZED_NAME_OFFICE_CODE) - private String officeCode; + public static final String SERIALIZED_NAME_POSTAL_MAIL = "postalMail"; + @SerializedName(SERIALIZED_NAME_POSTAL_MAIL) + private Boolean postalMail; + + public static final String SERIALIZED_NAME_STATE_EFILE_DATE = "stateEfileDate"; + @SerializedName(SERIALIZED_NAME_STATE_EFILE_DATE) + private LocalDate stateEfileDate; + + public static final String SERIALIZED_NAME_RECIPIENT_EDELIVERY_DATE = "recipientEdeliveryDate"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_EDELIVERY_DATE) + private LocalDate recipientEdeliveryDate; + + public static final String SERIALIZED_NAME_TIN_MATCH = "tinMatch"; + @SerializedName(SERIALIZED_NAME_TIN_MATCH) + private Boolean tinMatch; + + public static final String SERIALIZED_NAME_NO_TIN = "noTin"; + @SerializedName(SERIALIZED_NAME_NO_TIN) + private Boolean noTin; + + public static final String SERIALIZED_NAME_ADDRESS_VERIFICATION = "addressVerification"; + @SerializedName(SERIALIZED_NAME_ADDRESS_VERIFICATION) + private Boolean addressVerification; + + public static final String SERIALIZED_NAME_STATE_AND_LOCAL_WITHHOLDING = "stateAndLocalWithholding"; + @SerializedName(SERIALIZED_NAME_STATE_AND_LOCAL_WITHHOLDING) + private StateAndLocalWithholding stateAndLocalWithholding; + + public static final String SERIALIZED_NAME_SECOND_TIN_NOTICE = "secondTinNotice"; + @SerializedName(SERIALIZED_NAME_SECOND_TIN_NOTICE) + private Boolean secondTinNotice; + + public static final String SERIALIZED_NAME_FEDERAL_EFILE_STATUS = "federalEfileStatus"; + @SerializedName(SERIALIZED_NAME_FEDERAL_EFILE_STATUS) + private Form1099StatusDetail federalEfileStatus; + + public static final String SERIALIZED_NAME_STATE_EFILE_STATUS = "stateEfileStatus"; + @SerializedName(SERIALIZED_NAME_STATE_EFILE_STATUS) + private List stateEfileStatus; + + public static final String SERIALIZED_NAME_POSTAL_MAIL_STATUS = "postalMailStatus"; + @SerializedName(SERIALIZED_NAME_POSTAL_MAIL_STATUS) + private Form1099StatusDetail postalMailStatus; + + public static final String SERIALIZED_NAME_TIN_MATCH_STATUS = "tinMatchStatus"; + @SerializedName(SERIALIZED_NAME_TIN_MATCH_STATUS) + private Form1099StatusDetail tinMatchStatus; + + public static final String SERIALIZED_NAME_ADDRESS_VERIFICATION_STATUS = "addressVerificationStatus"; + @SerializedName(SERIALIZED_NAME_ADDRESS_VERIFICATION_STATUS) + private Form1099StatusDetail addressVerificationStatus; + + public static final String SERIALIZED_NAME_E_DELIVERY_STATUS = "eDeliveryStatus"; + @SerializedName(SERIALIZED_NAME_E_DELIVERY_STATUS) + private Form1099StatusDetail eDeliveryStatus; public static final String SERIALIZED_NAME_VALIDATION_ERRORS = "validationErrors"; @SerializedName(SERIALIZED_NAME_VALIDATION_ERRORS) @@ -289,20 +422,41 @@ public class Form1099Div { @SerializedName(SERIALIZED_NAME_UPDATED_AT) private OffsetDateTime updatedAt; - public static final String SERIALIZED_NAME_STATE_AND_LOCAL_WITHHOLDING = "stateAndLocalWithholding"; - @SerializedName(SERIALIZED_NAME_STATE_AND_LOCAL_WITHHOLDING) - private StateAndLocalWithholding stateAndLocalWithholding; - public Form1099Div() { } + public Form1099Div( + String id, + Form1099StatusDetail federalEfileStatus, + List stateEfileStatus, + Form1099StatusDetail postalMailStatus, + Form1099StatusDetail tinMatchStatus, + Form1099StatusDetail addressVerificationStatus, + Form1099StatusDetail eDeliveryStatus, + List validationErrors, + OffsetDateTime createdAt, + OffsetDateTime updatedAt + ) { + this(); + this.id = id; + this.federalEfileStatus = federalEfileStatus; + this.stateEfileStatus = stateEfileStatus; + this.postalMailStatus = postalMailStatus; + this.tinMatchStatus = tinMatchStatus; + this.addressVerificationStatus = addressVerificationStatus; + this.eDeliveryStatus = eDeliveryStatus; + this.validationErrors = validationErrors; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + public Form1099Div totalOrdinaryDividends(Double totalOrdinaryDividends) { this.totalOrdinaryDividends = totalOrdinaryDividends; return this; } /** - * Get totalOrdinaryDividends + * Total ordinary dividends * @return totalOrdinaryDividends */ @javax.annotation.Nullable @@ -321,7 +475,7 @@ public Form1099Div qualifiedDividends(Double qualifiedDividends) { } /** - * Get qualifiedDividends + * Qualified dividends * @return qualifiedDividends */ @javax.annotation.Nullable @@ -340,7 +494,7 @@ public Form1099Div totalCapitalGainDistributions(Double totalCapitalGainDistribu } /** - * Get totalCapitalGainDistributions + * Total capital gain distributions * @return totalCapitalGainDistributions */ @javax.annotation.Nullable @@ -359,7 +513,7 @@ public Form1099Div unrecapturedSection1250Gain(Double unrecapturedSection1250Gai } /** - * Get unrecapturedSection1250Gain + * Unrecaptured Section 1250 gain * @return unrecapturedSection1250Gain */ @javax.annotation.Nullable @@ -378,7 +532,7 @@ public Form1099Div section1202Gain(Double section1202Gain) { } /** - * Get section1202Gain + * Section 1202 gain * @return section1202Gain */ @javax.annotation.Nullable @@ -397,7 +551,7 @@ public Form1099Div collectiblesGain(Double collectiblesGain) { } /** - * Get collectiblesGain + * Collectibles (28%) gain * @return collectiblesGain */ @javax.annotation.Nullable @@ -416,7 +570,7 @@ public Form1099Div section897OrdinaryDividends(Double section897OrdinaryDividend } /** - * Get section897OrdinaryDividends + * Section 897 ordinary dividends * @return section897OrdinaryDividends */ @javax.annotation.Nullable @@ -435,7 +589,7 @@ public Form1099Div section897CapitalGain(Double section897CapitalGain) { } /** - * Get section897CapitalGain + * Section 897 capital gain * @return section897CapitalGain */ @javax.annotation.Nullable @@ -454,7 +608,7 @@ public Form1099Div nondividendDistributions(Double nondividendDistributions) { } /** - * Get nondividendDistributions + * Nondividend distributions * @return nondividendDistributions */ @javax.annotation.Nullable @@ -473,7 +627,7 @@ public Form1099Div federalIncomeTaxWithheld(Double federalIncomeTaxWithheld) { } /** - * Get federalIncomeTaxWithheld + * Federal income tax withheld * @return federalIncomeTaxWithheld */ @javax.annotation.Nullable @@ -492,7 +646,7 @@ public Form1099Div section199ADividends(Double section199ADividends) { } /** - * Get section199ADividends + * Section 199A dividends * @return section199ADividends */ @javax.annotation.Nullable @@ -511,7 +665,7 @@ public Form1099Div investmentExpenses(Double investmentExpenses) { } /** - * Get investmentExpenses + * Investment expenses * @return investmentExpenses */ @javax.annotation.Nullable @@ -530,7 +684,7 @@ public Form1099Div foreignTaxPaid(Double foreignTaxPaid) { } /** - * Get foreignTaxPaid + * Foreign tax paid * @return foreignTaxPaid */ @javax.annotation.Nullable @@ -549,7 +703,7 @@ public Form1099Div foreignCountryOrUSPossession(String foreignCountryOrUSPossess } /** - * Get foreignCountryOrUSPossession + * Foreign country or U.S. possession * @return foreignCountryOrUSPossession */ @javax.annotation.Nullable @@ -568,7 +722,7 @@ public Form1099Div cashLiquidationDistributions(Double cashLiquidationDistributi } /** - * Get cashLiquidationDistributions + * Cash liquidation distributions * @return cashLiquidationDistributions */ @javax.annotation.Nullable @@ -587,7 +741,7 @@ public Form1099Div noncashLiquidationDistributions(Double noncashLiquidationDist } /** - * Get noncashLiquidationDistributions + * Noncash liquidation distributions * @return noncashLiquidationDistributions */ @javax.annotation.Nullable @@ -606,7 +760,7 @@ public Form1099Div exemptInterestDividends(Double exemptInterestDividends) { } /** - * Get exemptInterestDividends + * Exempt-interest dividends * @return exemptInterestDividends */ @javax.annotation.Nullable @@ -625,7 +779,7 @@ public Form1099Div specifiedPrivateActivityBondInterestDividends(Double specifie } /** - * Get specifiedPrivateActivityBondInterestDividends + * Specified private activity bond interest dividends * @return specifiedPrivateActivityBondInterestDividends */ @javax.annotation.Nullable @@ -644,7 +798,7 @@ public Form1099Div fatcaFilingRequirement(Boolean fatcaFilingRequirement) { } /** - * Get fatcaFilingRequirement + * FATCA filing requirement * @return fatcaFilingRequirement */ @javax.annotation.Nullable @@ -657,59 +811,51 @@ public void setFatcaFilingRequirement(Boolean fatcaFilingRequirement) { } - public Form1099Div id(String id) { - this.id = id; + public Form1099Div type(TypeEnum type) { + this.type = type; return this; } /** - * Get id - * @return id + * Form type + * @return type */ - @javax.annotation.Nullable - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; } - - public Form1099Div type(String type) { + public void setType(TypeEnum type) { this.type = type; - return this; } + /** - * Get type - * @return type + * Form ID. Unique identifier set when the record is created. + * @return id */ @javax.annotation.Nullable - public String getType() { - return type; + public String getId() { + return id; } - public void setType(String type) { - this.type = type; - } - public Form1099Div issuerId(Integer issuerId) { + public Form1099Div issuerId(String issuerId) { this.issuerId = issuerId; return this; } /** - * Get issuerId + * Issuer ID - only required when creating forms * @return issuerId */ @javax.annotation.Nullable - public Integer getIssuerId() { + public String getIssuerId() { return issuerId; } - public void setIssuerId(Integer issuerId) { + public void setIssuerId(String issuerId) { this.issuerId = issuerId; } @@ -720,7 +866,7 @@ public Form1099Div issuerReferenceId(String issuerReferenceId) { } /** - * Get issuerReferenceId + * Issuer Reference ID - only required when creating forms * @return issuerReferenceId */ @javax.annotation.Nullable @@ -739,7 +885,7 @@ public Form1099Div issuerTin(String issuerTin) { } /** - * Get issuerTin + * Issuer TIN - readonly * @return issuerTin */ @javax.annotation.Nullable @@ -758,7 +904,7 @@ public Form1099Div taxYear(Integer taxYear) { } /** - * Get taxYear + * Tax Year - only required when creating forms * @return taxYear */ @javax.annotation.Nullable @@ -771,561 +917,530 @@ public void setTaxYear(Integer taxYear) { } - public Form1099Div federalEfile(Boolean federalEfile) { - this.federalEfile = federalEfile; + public Form1099Div referenceId(String referenceId) { + this.referenceId = referenceId; return this; } /** - * Get federalEfile - * @return federalEfile + * Internal reference ID. Never shown to any agency or recipient. + * @return referenceId */ @javax.annotation.Nullable - public Boolean getFederalEfile() { - return federalEfile; + public String getReferenceId() { + return referenceId; } - public void setFederalEfile(Boolean federalEfile) { - this.federalEfile = federalEfile; + public void setReferenceId(String referenceId) { + this.referenceId = referenceId; } - public Form1099Div federalEfileStatus(Form1099StatusDetail federalEfileStatus) { - this.federalEfileStatus = federalEfileStatus; + public Form1099Div tin(String tin) { + this.tin = tin; return this; } /** - * Get federalEfileStatus - * @return federalEfileStatus + * Recipient's Federal Tax Identification Number (TIN). + * @return tin */ @javax.annotation.Nullable - public Form1099StatusDetail getFederalEfileStatus() { - return federalEfileStatus; + public String getTin() { + return tin; } - public void setFederalEfileStatus(Form1099StatusDetail federalEfileStatus) { - this.federalEfileStatus = federalEfileStatus; + public void setTin(String tin) { + this.tin = tin; } - public Form1099Div stateEfile(Boolean stateEfile) { - this.stateEfile = stateEfile; + public Form1099Div recipientName(String recipientName) { + this.recipientName = recipientName; return this; } /** - * Get stateEfile - * @return stateEfile + * Recipient name + * @return recipientName */ @javax.annotation.Nullable - public Boolean getStateEfile() { - return stateEfile; + public String getRecipientName() { + return recipientName; } - public void setStateEfile(Boolean stateEfile) { - this.stateEfile = stateEfile; + public void setRecipientName(String recipientName) { + this.recipientName = recipientName; } - public Form1099Div stateEfileStatus(List stateEfileStatus) { - this.stateEfileStatus = stateEfileStatus; - return this; - } - - public Form1099Div addStateEfileStatusItem(StateEfileStatusDetail stateEfileStatusItem) { - if (this.stateEfileStatus == null) { - this.stateEfileStatus = new ArrayList<>(); - } - this.stateEfileStatus.add(stateEfileStatusItem); + public Form1099Div tinType(TinTypeEnum tinType) { + this.tinType = tinType; return this; } /** - * Get stateEfileStatus - * @return stateEfileStatus + * Type of TIN (Tax ID Number) + * @return tinType */ @javax.annotation.Nullable - public List getStateEfileStatus() { - return stateEfileStatus; + public TinTypeEnum getTinType() { + return tinType; } - public void setStateEfileStatus(List stateEfileStatus) { - this.stateEfileStatus = stateEfileStatus; + public void setTinType(TinTypeEnum tinType) { + this.tinType = tinType; } - public Form1099Div postalMail(Boolean postalMail) { - this.postalMail = postalMail; + public Form1099Div recipientSecondName(String recipientSecondName) { + this.recipientSecondName = recipientSecondName; return this; } /** - * Get postalMail - * @return postalMail + * Recipient second name + * @return recipientSecondName */ @javax.annotation.Nullable - public Boolean getPostalMail() { - return postalMail; + public String getRecipientSecondName() { + return recipientSecondName; } - public void setPostalMail(Boolean postalMail) { - this.postalMail = postalMail; + public void setRecipientSecondName(String recipientSecondName) { + this.recipientSecondName = recipientSecondName; } - public Form1099Div postalMailStatus(Form1099StatusDetail postalMailStatus) { - this.postalMailStatus = postalMailStatus; + public Form1099Div address(String address) { + this.address = address; return this; } /** - * Get postalMailStatus - * @return postalMailStatus + * Address. + * @return address */ @javax.annotation.Nullable - public Form1099StatusDetail getPostalMailStatus() { - return postalMailStatus; + public String getAddress() { + return address; } - public void setPostalMailStatus(Form1099StatusDetail postalMailStatus) { - this.postalMailStatus = postalMailStatus; + public void setAddress(String address) { + this.address = address; } - public Form1099Div tinMatch(Boolean tinMatch) { - this.tinMatch = tinMatch; + public Form1099Div address2(String address2) { + this.address2 = address2; return this; } /** - * Get tinMatch - * @return tinMatch + * Address line 2. + * @return address2 */ @javax.annotation.Nullable - public Boolean getTinMatch() { - return tinMatch; + public String getAddress2() { + return address2; } - public void setTinMatch(Boolean tinMatch) { - this.tinMatch = tinMatch; + public void setAddress2(String address2) { + this.address2 = address2; } - public Form1099Div tinMatchStatus(Form1099StatusDetail tinMatchStatus) { - this.tinMatchStatus = tinMatchStatus; + public Form1099Div city(String city) { + this.city = city; return this; } /** - * Get tinMatchStatus - * @return tinMatchStatus + * City. + * @return city */ @javax.annotation.Nullable - public Form1099StatusDetail getTinMatchStatus() { - return tinMatchStatus; + public String getCity() { + return city; } - public void setTinMatchStatus(Form1099StatusDetail tinMatchStatus) { - this.tinMatchStatus = tinMatchStatus; + public void setCity(String city) { + this.city = city; } - public Form1099Div addressVerification(Boolean addressVerification) { - this.addressVerification = addressVerification; + public Form1099Div state(String state) { + this.state = state; return this; } /** - * Get addressVerification - * @return addressVerification + * Two-letter US state or Canadian province code (required for US/CA addresses). + * @return state */ @javax.annotation.Nullable - public Boolean getAddressVerification() { - return addressVerification; + public String getState() { + return state; } - public void setAddressVerification(Boolean addressVerification) { - this.addressVerification = addressVerification; + public void setState(String state) { + this.state = state; } - public Form1099Div addressVerificationStatus(Form1099StatusDetail addressVerificationStatus) { - this.addressVerificationStatus = addressVerificationStatus; + public Form1099Div zip(String zip) { + this.zip = zip; return this; } /** - * Get addressVerificationStatus - * @return addressVerificationStatus + * ZIP/postal code. + * @return zip */ @javax.annotation.Nullable - public Form1099StatusDetail getAddressVerificationStatus() { - return addressVerificationStatus; + public String getZip() { + return zip; } - public void setAddressVerificationStatus(Form1099StatusDetail addressVerificationStatus) { - this.addressVerificationStatus = addressVerificationStatus; + public void setZip(String zip) { + this.zip = zip; } - public Form1099Div eDeliveryStatus(Form1099StatusDetail eDeliveryStatus) { - this.eDeliveryStatus = eDeliveryStatus; + public Form1099Div email(String email) { + this.email = email; return this; } /** - * Get eDeliveryStatus - * @return eDeliveryStatus + * Recipient's Contact email address. + * @return email */ @javax.annotation.Nullable - public Form1099StatusDetail geteDeliveryStatus() { - return eDeliveryStatus; + public String getEmail() { + return email; } - public void seteDeliveryStatus(Form1099StatusDetail eDeliveryStatus) { - this.eDeliveryStatus = eDeliveryStatus; + public void setEmail(String email) { + this.email = email; } - public Form1099Div referenceId(String referenceId) { - this.referenceId = referenceId; + public Form1099Div accountNumber(String accountNumber) { + this.accountNumber = accountNumber; return this; } /** - * Get referenceId - * @return referenceId + * Account number + * @return accountNumber */ @javax.annotation.Nullable - public String getReferenceId() { - return referenceId; + public String getAccountNumber() { + return accountNumber; } - public void setReferenceId(String referenceId) { - this.referenceId = referenceId; + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; } - public Form1099Div email(String email) { - this.email = email; + public Form1099Div officeCode(String officeCode) { + this.officeCode = officeCode; return this; } /** - * Get email - * @return email + * Office code + * @return officeCode */ @javax.annotation.Nullable - public String getEmail() { - return email; + public String getOfficeCode() { + return officeCode; } - public void setEmail(String email) { - this.email = email; + public void setOfficeCode(String officeCode) { + this.officeCode = officeCode; } - public Form1099Div tinType(String tinType) { - this.tinType = tinType; + public Form1099Div nonUsProvince(String nonUsProvince) { + this.nonUsProvince = nonUsProvince; return this; } /** - * Get tinType - * @return tinType + * Province or region for non-US/CA addresses. + * @return nonUsProvince */ @javax.annotation.Nullable - public String getTinType() { - return tinType; + public String getNonUsProvince() { + return nonUsProvince; } - public void setTinType(String tinType) { - this.tinType = tinType; + public void setNonUsProvince(String nonUsProvince) { + this.nonUsProvince = nonUsProvince; } - public Form1099Div tin(String tin) { - this.tin = tin; + public Form1099Div countryCode(String countryCode) { + this.countryCode = countryCode; return this; } /** - * Get tin - * @return tin + * Two-letter IRS country code (e.g., 'US', 'CA'), as defined at https://www.irs.gov/e-file-providers/country-codes. + * @return countryCode */ @javax.annotation.Nullable - public String getTin() { - return tin; + public String getCountryCode() { + return countryCode; } - public void setTin(String tin) { - this.tin = tin; + public void setCountryCode(String countryCode) { + this.countryCode = countryCode; } - public Form1099Div noTin(Boolean noTin) { - this.noTin = noTin; + public Form1099Div federalEfileDate(LocalDate federalEfileDate) { + this.federalEfileDate = federalEfileDate; return this; } /** - * Get noTin - * @return noTin + * Date when federal e-filing should be scheduled for this form + * @return federalEfileDate */ @javax.annotation.Nullable - public Boolean getNoTin() { - return noTin; + public LocalDate getFederalEfileDate() { + return federalEfileDate; } - public void setNoTin(Boolean noTin) { - this.noTin = noTin; + public void setFederalEfileDate(LocalDate federalEfileDate) { + this.federalEfileDate = federalEfileDate; } - public Form1099Div secondTinNotice(Boolean secondTinNotice) { - this.secondTinNotice = secondTinNotice; + public Form1099Div postalMail(Boolean postalMail) { + this.postalMail = postalMail; return this; } /** - * Get secondTinNotice - * @return secondTinNotice + * Boolean indicating that postal mailing to the recipient should be scheduled for this form + * @return postalMail */ @javax.annotation.Nullable - public Boolean getSecondTinNotice() { - return secondTinNotice; + public Boolean getPostalMail() { + return postalMail; } - public void setSecondTinNotice(Boolean secondTinNotice) { - this.secondTinNotice = secondTinNotice; + public void setPostalMail(Boolean postalMail) { + this.postalMail = postalMail; } - public Form1099Div recipientName(String recipientName) { - this.recipientName = recipientName; + public Form1099Div stateEfileDate(LocalDate stateEfileDate) { + this.stateEfileDate = stateEfileDate; return this; } /** - * Get recipientName - * @return recipientName + * Date when state e-filing should be scheduled for this form + * @return stateEfileDate */ @javax.annotation.Nullable - public String getRecipientName() { - return recipientName; + public LocalDate getStateEfileDate() { + return stateEfileDate; } - public void setRecipientName(String recipientName) { - this.recipientName = recipientName; + public void setStateEfileDate(LocalDate stateEfileDate) { + this.stateEfileDate = stateEfileDate; } - public Form1099Div recipientSecondName(String recipientSecondName) { - this.recipientSecondName = recipientSecondName; + public Form1099Div recipientEdeliveryDate(LocalDate recipientEdeliveryDate) { + this.recipientEdeliveryDate = recipientEdeliveryDate; return this; } /** - * Get recipientSecondName - * @return recipientSecondName + * Date when recipient e-delivery should be scheduled for this form + * @return recipientEdeliveryDate */ @javax.annotation.Nullable - public String getRecipientSecondName() { - return recipientSecondName; + public LocalDate getRecipientEdeliveryDate() { + return recipientEdeliveryDate; } - public void setRecipientSecondName(String recipientSecondName) { - this.recipientSecondName = recipientSecondName; + public void setRecipientEdeliveryDate(LocalDate recipientEdeliveryDate) { + this.recipientEdeliveryDate = recipientEdeliveryDate; } - public Form1099Div address(String address) { - this.address = address; + public Form1099Div tinMatch(Boolean tinMatch) { + this.tinMatch = tinMatch; return this; } /** - * Get address - * @return address + * Boolean indicating that TIN Matching should be scheduled for this form + * @return tinMatch */ @javax.annotation.Nullable - public String getAddress() { - return address; + public Boolean getTinMatch() { + return tinMatch; } - public void setAddress(String address) { - this.address = address; + public void setTinMatch(Boolean tinMatch) { + this.tinMatch = tinMatch; } - public Form1099Div address2(String address2) { - this.address2 = address2; + public Form1099Div noTin(Boolean noTin) { + this.noTin = noTin; return this; } /** - * Get address2 - * @return address2 + * No TIN indicator + * @return noTin */ @javax.annotation.Nullable - public String getAddress2() { - return address2; + public Boolean getNoTin() { + return noTin; } - public void setAddress2(String address2) { - this.address2 = address2; + public void setNoTin(Boolean noTin) { + this.noTin = noTin; } - public Form1099Div city(String city) { - this.city = city; + public Form1099Div addressVerification(Boolean addressVerification) { + this.addressVerification = addressVerification; return this; } /** - * Get city - * @return city + * Boolean indicating that address verification should be scheduled for this form + * @return addressVerification */ @javax.annotation.Nullable - public String getCity() { - return city; + public Boolean getAddressVerification() { + return addressVerification; } - public void setCity(String city) { - this.city = city; + public void setAddressVerification(Boolean addressVerification) { + this.addressVerification = addressVerification; } - public Form1099Div state(String state) { - this.state = state; + public Form1099Div stateAndLocalWithholding(StateAndLocalWithholding stateAndLocalWithholding) { + this.stateAndLocalWithholding = stateAndLocalWithholding; return this; } /** - * Get state - * @return state + * State and local withholding information + * @return stateAndLocalWithholding */ @javax.annotation.Nullable - public String getState() { - return state; + public StateAndLocalWithholding getStateAndLocalWithholding() { + return stateAndLocalWithholding; } - public void setState(String state) { - this.state = state; + public void setStateAndLocalWithholding(StateAndLocalWithholding stateAndLocalWithholding) { + this.stateAndLocalWithholding = stateAndLocalWithholding; } - public Form1099Div zip(String zip) { - this.zip = zip; + public Form1099Div secondTinNotice(Boolean secondTinNotice) { + this.secondTinNotice = secondTinNotice; return this; } /** - * Get zip - * @return zip + * Second TIN notice + * @return secondTinNotice */ @javax.annotation.Nullable - public String getZip() { - return zip; + public Boolean getSecondTinNotice() { + return secondTinNotice; } - public void setZip(String zip) { - this.zip = zip; + public void setSecondTinNotice(Boolean secondTinNotice) { + this.secondTinNotice = secondTinNotice; } - public Form1099Div nonUsProvince(String nonUsProvince) { - this.nonUsProvince = nonUsProvince; - return this; - } - /** - * Get nonUsProvince - * @return nonUsProvince + * Federal e-file status + * @return federalEfileStatus */ @javax.annotation.Nullable - public String getNonUsProvince() { - return nonUsProvince; - } - - public void setNonUsProvince(String nonUsProvince) { - this.nonUsProvince = nonUsProvince; + public Form1099StatusDetail getFederalEfileStatus() { + return federalEfileStatus; } - public Form1099Div countryCode(String countryCode) { - this.countryCode = countryCode; - return this; - } /** - * Get countryCode - * @return countryCode + * State e-file status + * @return stateEfileStatus */ @javax.annotation.Nullable - public String getCountryCode() { - return countryCode; - } - - public void setCountryCode(String countryCode) { - this.countryCode = countryCode; + public List getStateEfileStatus() { + return stateEfileStatus; } - public Form1099Div accountNumber(String accountNumber) { - this.accountNumber = accountNumber; - return this; - } /** - * Get accountNumber - * @return accountNumber + * Postal mail to recipient status + * @return postalMailStatus */ @javax.annotation.Nullable - public String getAccountNumber() { - return accountNumber; + public Form1099StatusDetail getPostalMailStatus() { + return postalMailStatus; } - public void setAccountNumber(String accountNumber) { - this.accountNumber = accountNumber; - } - public Form1099Div officeCode(String officeCode) { - this.officeCode = officeCode; - return this; + /** + * TIN Match status + * @return tinMatchStatus + */ + @javax.annotation.Nullable + public Form1099StatusDetail getTinMatchStatus() { + return tinMatchStatus; } + + /** - * Get officeCode - * @return officeCode + * Address verification status + * @return addressVerificationStatus */ @javax.annotation.Nullable - public String getOfficeCode() { - return officeCode; + public Form1099StatusDetail getAddressVerificationStatus() { + return addressVerificationStatus; } - public void setOfficeCode(String officeCode) { - this.officeCode = officeCode; - } - public Form1099Div validationErrors(List validationErrors) { - this.validationErrors = validationErrors; - return this; + /** + * EDelivery status + * @return eDeliveryStatus + */ + @javax.annotation.Nullable + public Form1099StatusDetail geteDeliveryStatus() { + return eDeliveryStatus; } - public Form1099Div addValidationErrorsItem(ValidationError validationErrorsItem) { - if (this.validationErrors == null) { - this.validationErrors = new ArrayList<>(); - } - this.validationErrors.add(validationErrorsItem); - return this; - } + /** - * Get validationErrors + * Validation errors * @return validationErrors */ @javax.annotation.Nullable @@ -1333,18 +1448,10 @@ public List getValidationErrors() { return validationErrors; } - public void setValidationErrors(List validationErrors) { - this.validationErrors = validationErrors; - } - - public Form1099Div createdAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - return this; - } /** - * Get createdAt + * Date time when the record was created. * @return createdAt */ @javax.annotation.Nullable @@ -1352,18 +1459,10 @@ public OffsetDateTime getCreatedAt() { return createdAt; } - public void setCreatedAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - } - - public Form1099Div updatedAt(OffsetDateTime updatedAt) { - this.updatedAt = updatedAt; - return this; - } /** - * Get updatedAt + * Date time when the record was last updated. * @return updatedAt */ @javax.annotation.Nullable @@ -1371,28 +1470,6 @@ public OffsetDateTime getUpdatedAt() { return updatedAt; } - public void setUpdatedAt(OffsetDateTime updatedAt) { - this.updatedAt = updatedAt; - } - - - public Form1099Div stateAndLocalWithholding(StateAndLocalWithholding stateAndLocalWithholding) { - this.stateAndLocalWithholding = stateAndLocalWithholding; - return this; - } - - /** - * Get stateAndLocalWithholding - * @return stateAndLocalWithholding - */ - @javax.annotation.Nullable - public StateAndLocalWithholding getStateAndLocalWithholding() { - return stateAndLocalWithholding; - } - - public void setStateAndLocalWithholding(StateAndLocalWithholding stateAndLocalWithholding) { - this.stateAndLocalWithholding = stateAndLocalWithholding; - } @@ -1424,44 +1501,45 @@ public boolean equals(Object o) { Objects.equals(this.exemptInterestDividends, form1099Div.exemptInterestDividends) && Objects.equals(this.specifiedPrivateActivityBondInterestDividends, form1099Div.specifiedPrivateActivityBondInterestDividends) && Objects.equals(this.fatcaFilingRequirement, form1099Div.fatcaFilingRequirement) && - Objects.equals(this.id, form1099Div.id) && Objects.equals(this.type, form1099Div.type) && + Objects.equals(this.id, form1099Div.id) && Objects.equals(this.issuerId, form1099Div.issuerId) && Objects.equals(this.issuerReferenceId, form1099Div.issuerReferenceId) && Objects.equals(this.issuerTin, form1099Div.issuerTin) && Objects.equals(this.taxYear, form1099Div.taxYear) && - Objects.equals(this.federalEfile, form1099Div.federalEfile) && - Objects.equals(this.federalEfileStatus, form1099Div.federalEfileStatus) && - Objects.equals(this.stateEfile, form1099Div.stateEfile) && - Objects.equals(this.stateEfileStatus, form1099Div.stateEfileStatus) && - Objects.equals(this.postalMail, form1099Div.postalMail) && - Objects.equals(this.postalMailStatus, form1099Div.postalMailStatus) && - Objects.equals(this.tinMatch, form1099Div.tinMatch) && - Objects.equals(this.tinMatchStatus, form1099Div.tinMatchStatus) && - Objects.equals(this.addressVerification, form1099Div.addressVerification) && - Objects.equals(this.addressVerificationStatus, form1099Div.addressVerificationStatus) && - Objects.equals(this.eDeliveryStatus, form1099Div.eDeliveryStatus) && Objects.equals(this.referenceId, form1099Div.referenceId) && - Objects.equals(this.email, form1099Div.email) && - Objects.equals(this.tinType, form1099Div.tinType) && Objects.equals(this.tin, form1099Div.tin) && - Objects.equals(this.noTin, form1099Div.noTin) && - Objects.equals(this.secondTinNotice, form1099Div.secondTinNotice) && Objects.equals(this.recipientName, form1099Div.recipientName) && + Objects.equals(this.tinType, form1099Div.tinType) && Objects.equals(this.recipientSecondName, form1099Div.recipientSecondName) && Objects.equals(this.address, form1099Div.address) && Objects.equals(this.address2, form1099Div.address2) && Objects.equals(this.city, form1099Div.city) && Objects.equals(this.state, form1099Div.state) && Objects.equals(this.zip, form1099Div.zip) && - Objects.equals(this.nonUsProvince, form1099Div.nonUsProvince) && - Objects.equals(this.countryCode, form1099Div.countryCode) && + Objects.equals(this.email, form1099Div.email) && Objects.equals(this.accountNumber, form1099Div.accountNumber) && Objects.equals(this.officeCode, form1099Div.officeCode) && + Objects.equals(this.nonUsProvince, form1099Div.nonUsProvince) && + Objects.equals(this.countryCode, form1099Div.countryCode) && + Objects.equals(this.federalEfileDate, form1099Div.federalEfileDate) && + Objects.equals(this.postalMail, form1099Div.postalMail) && + Objects.equals(this.stateEfileDate, form1099Div.stateEfileDate) && + Objects.equals(this.recipientEdeliveryDate, form1099Div.recipientEdeliveryDate) && + Objects.equals(this.tinMatch, form1099Div.tinMatch) && + Objects.equals(this.noTin, form1099Div.noTin) && + Objects.equals(this.addressVerification, form1099Div.addressVerification) && + Objects.equals(this.stateAndLocalWithholding, form1099Div.stateAndLocalWithholding) && + Objects.equals(this.secondTinNotice, form1099Div.secondTinNotice) && + Objects.equals(this.federalEfileStatus, form1099Div.federalEfileStatus) && + Objects.equals(this.stateEfileStatus, form1099Div.stateEfileStatus) && + Objects.equals(this.postalMailStatus, form1099Div.postalMailStatus) && + Objects.equals(this.tinMatchStatus, form1099Div.tinMatchStatus) && + Objects.equals(this.addressVerificationStatus, form1099Div.addressVerificationStatus) && + Objects.equals(this.eDeliveryStatus, form1099Div.eDeliveryStatus) && Objects.equals(this.validationErrors, form1099Div.validationErrors) && Objects.equals(this.createdAt, form1099Div.createdAt) && - Objects.equals(this.updatedAt, form1099Div.updatedAt) && - Objects.equals(this.stateAndLocalWithholding, form1099Div.stateAndLocalWithholding); + Objects.equals(this.updatedAt, form1099Div.updatedAt); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -1470,7 +1548,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(totalOrdinaryDividends, qualifiedDividends, totalCapitalGainDistributions, unrecapturedSection1250Gain, section1202Gain, collectiblesGain, section897OrdinaryDividends, section897CapitalGain, nondividendDistributions, federalIncomeTaxWithheld, section199ADividends, investmentExpenses, foreignTaxPaid, foreignCountryOrUSPossession, cashLiquidationDistributions, noncashLiquidationDistributions, exemptInterestDividends, specifiedPrivateActivityBondInterestDividends, fatcaFilingRequirement, id, type, issuerId, issuerReferenceId, issuerTin, taxYear, federalEfile, federalEfileStatus, stateEfile, stateEfileStatus, postalMail, postalMailStatus, tinMatch, tinMatchStatus, addressVerification, addressVerificationStatus, eDeliveryStatus, referenceId, email, tinType, tin, noTin, secondTinNotice, recipientName, recipientSecondName, address, address2, city, state, zip, nonUsProvince, countryCode, accountNumber, officeCode, validationErrors, createdAt, updatedAt, stateAndLocalWithholding); + return Objects.hash(totalOrdinaryDividends, qualifiedDividends, totalCapitalGainDistributions, unrecapturedSection1250Gain, section1202Gain, collectiblesGain, section897OrdinaryDividends, section897CapitalGain, nondividendDistributions, federalIncomeTaxWithheld, section199ADividends, investmentExpenses, foreignTaxPaid, foreignCountryOrUSPossession, cashLiquidationDistributions, noncashLiquidationDistributions, exemptInterestDividends, specifiedPrivateActivityBondInterestDividends, fatcaFilingRequirement, type, id, issuerId, issuerReferenceId, issuerTin, taxYear, referenceId, tin, recipientName, tinType, recipientSecondName, address, address2, city, state, zip, email, accountNumber, officeCode, nonUsProvince, countryCode, federalEfileDate, postalMail, stateEfileDate, recipientEdeliveryDate, tinMatch, noTin, addressVerification, stateAndLocalWithholding, secondTinNotice, federalEfileStatus, stateEfileStatus, postalMailStatus, tinMatchStatus, addressVerificationStatus, eDeliveryStatus, validationErrors, createdAt, updatedAt); } private static int hashCodeNullable(JsonNullable a) { @@ -1503,44 +1581,45 @@ public String toString() { sb.append(" exemptInterestDividends: ").append(toIndentedString(exemptInterestDividends)).append("\n"); sb.append(" specifiedPrivateActivityBondInterestDividends: ").append(toIndentedString(specifiedPrivateActivityBondInterestDividends)).append("\n"); sb.append(" fatcaFilingRequirement: ").append(toIndentedString(fatcaFilingRequirement)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" issuerId: ").append(toIndentedString(issuerId)).append("\n"); sb.append(" issuerReferenceId: ").append(toIndentedString(issuerReferenceId)).append("\n"); sb.append(" issuerTin: ").append(toIndentedString(issuerTin)).append("\n"); sb.append(" taxYear: ").append(toIndentedString(taxYear)).append("\n"); - sb.append(" federalEfile: ").append(toIndentedString(federalEfile)).append("\n"); - sb.append(" federalEfileStatus: ").append(toIndentedString(federalEfileStatus)).append("\n"); - sb.append(" stateEfile: ").append(toIndentedString(stateEfile)).append("\n"); - sb.append(" stateEfileStatus: ").append(toIndentedString(stateEfileStatus)).append("\n"); - sb.append(" postalMail: ").append(toIndentedString(postalMail)).append("\n"); - sb.append(" postalMailStatus: ").append(toIndentedString(postalMailStatus)).append("\n"); - sb.append(" tinMatch: ").append(toIndentedString(tinMatch)).append("\n"); - sb.append(" tinMatchStatus: ").append(toIndentedString(tinMatchStatus)).append("\n"); - sb.append(" addressVerification: ").append(toIndentedString(addressVerification)).append("\n"); - sb.append(" addressVerificationStatus: ").append(toIndentedString(addressVerificationStatus)).append("\n"); - sb.append(" eDeliveryStatus: ").append(toIndentedString(eDeliveryStatus)).append("\n"); sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" tinType: ").append(toIndentedString(tinType)).append("\n"); sb.append(" tin: ").append(toIndentedString(tin)).append("\n"); - sb.append(" noTin: ").append(toIndentedString(noTin)).append("\n"); - sb.append(" secondTinNotice: ").append(toIndentedString(secondTinNotice)).append("\n"); sb.append(" recipientName: ").append(toIndentedString(recipientName)).append("\n"); + sb.append(" tinType: ").append(toIndentedString(tinType)).append("\n"); sb.append(" recipientSecondName: ").append(toIndentedString(recipientSecondName)).append("\n"); sb.append(" address: ").append(toIndentedString(address)).append("\n"); sb.append(" address2: ").append(toIndentedString(address2)).append("\n"); sb.append(" city: ").append(toIndentedString(city)).append("\n"); sb.append(" state: ").append(toIndentedString(state)).append("\n"); sb.append(" zip: ").append(toIndentedString(zip)).append("\n"); - sb.append(" nonUsProvince: ").append(toIndentedString(nonUsProvince)).append("\n"); - sb.append(" countryCode: ").append(toIndentedString(countryCode)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); sb.append(" officeCode: ").append(toIndentedString(officeCode)).append("\n"); + sb.append(" nonUsProvince: ").append(toIndentedString(nonUsProvince)).append("\n"); + sb.append(" countryCode: ").append(toIndentedString(countryCode)).append("\n"); + sb.append(" federalEfileDate: ").append(toIndentedString(federalEfileDate)).append("\n"); + sb.append(" postalMail: ").append(toIndentedString(postalMail)).append("\n"); + sb.append(" stateEfileDate: ").append(toIndentedString(stateEfileDate)).append("\n"); + sb.append(" recipientEdeliveryDate: ").append(toIndentedString(recipientEdeliveryDate)).append("\n"); + sb.append(" tinMatch: ").append(toIndentedString(tinMatch)).append("\n"); + sb.append(" noTin: ").append(toIndentedString(noTin)).append("\n"); + sb.append(" addressVerification: ").append(toIndentedString(addressVerification)).append("\n"); + sb.append(" stateAndLocalWithholding: ").append(toIndentedString(stateAndLocalWithholding)).append("\n"); + sb.append(" secondTinNotice: ").append(toIndentedString(secondTinNotice)).append("\n"); + sb.append(" federalEfileStatus: ").append(toIndentedString(federalEfileStatus)).append("\n"); + sb.append(" stateEfileStatus: ").append(toIndentedString(stateEfileStatus)).append("\n"); + sb.append(" postalMailStatus: ").append(toIndentedString(postalMailStatus)).append("\n"); + sb.append(" tinMatchStatus: ").append(toIndentedString(tinMatchStatus)).append("\n"); + sb.append(" addressVerificationStatus: ").append(toIndentedString(addressVerificationStatus)).append("\n"); + sb.append(" eDeliveryStatus: ").append(toIndentedString(eDeliveryStatus)).append("\n"); sb.append(" validationErrors: ").append(toIndentedString(validationErrors)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append(" stateAndLocalWithholding: ").append(toIndentedString(stateAndLocalWithholding)).append("\n"); sb.append("}"); return sb.toString(); } @@ -1563,48 +1642,53 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("id"); openapiFields.add("type"); + openapiFields.add("id"); openapiFields.add("issuerId"); openapiFields.add("issuerReferenceId"); openapiFields.add("issuerTin"); openapiFields.add("taxYear"); - openapiFields.add("federalEfile"); - openapiFields.add("federalEfileStatus"); - openapiFields.add("stateEfile"); - openapiFields.add("stateEfileStatus"); - openapiFields.add("postalMail"); - openapiFields.add("postalMailStatus"); - openapiFields.add("tinMatch"); - openapiFields.add("tinMatchStatus"); - openapiFields.add("addressVerification"); - openapiFields.add("addressVerificationStatus"); - openapiFields.add("eDeliveryStatus"); openapiFields.add("referenceId"); - openapiFields.add("email"); - openapiFields.add("tinType"); - openapiFields.add("fatcaFilingRequirement"); openapiFields.add("tin"); - openapiFields.add("noTin"); - openapiFields.add("secondTinNotice"); openapiFields.add("recipientName"); + openapiFields.add("tinType"); openapiFields.add("recipientSecondName"); openapiFields.add("address"); openapiFields.add("address2"); openapiFields.add("city"); openapiFields.add("state"); openapiFields.add("zip"); - openapiFields.add("nonUsProvince"); - openapiFields.add("countryCode"); + openapiFields.add("email"); openapiFields.add("accountNumber"); openapiFields.add("officeCode"); + openapiFields.add("nonUsProvince"); + openapiFields.add("countryCode"); + openapiFields.add("federalEfileDate"); + openapiFields.add("postalMail"); + openapiFields.add("stateEfileDate"); + openapiFields.add("recipientEdeliveryDate"); + openapiFields.add("tinMatch"); + openapiFields.add("noTin"); + openapiFields.add("addressVerification"); + openapiFields.add("stateAndLocalWithholding"); + openapiFields.add("secondTinNotice"); + openapiFields.add("federalEfileStatus"); + openapiFields.add("stateEfileStatus"); + openapiFields.add("postalMailStatus"); + openapiFields.add("tinMatchStatus"); + openapiFields.add("addressVerificationStatus"); + openapiFields.add("eDeliveryStatus"); openapiFields.add("validationErrors"); openapiFields.add("createdAt"); openapiFields.add("updatedAt"); - openapiFields.add("stateAndLocalWithholding"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("recipientName"); + openapiRequiredFields.add("address"); + openapiRequiredFields.add("city"); + openapiRequiredFields.add("countryCode"); } /** @@ -1627,15 +1711,27 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Form1099Div` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Form1099Div.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("foreignCountryOrUSPossession") != null && !jsonObj.get("foreignCountryOrUSPossession").isJsonNull()) && !jsonObj.get("foreignCountryOrUSPossession").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `foreignCountryOrUSPossession` to be a primitive type in the JSON string but got `%s`", jsonObj.get("foreignCountryOrUSPossession").toString())); } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); 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("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + if ((jsonObj.get("issuerId") != null && !jsonObj.get("issuerId").isJsonNull()) && !jsonObj.get("issuerId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `issuerId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerId").toString())); } if ((jsonObj.get("issuerReferenceId") != null && !jsonObj.get("issuerReferenceId").isJsonNull()) && !jsonObj.get("issuerReferenceId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `issuerReferenceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerReferenceId").toString())); @@ -1643,55 +1739,22 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("issuerTin") != null && !jsonObj.get("issuerTin").isJsonNull()) && !jsonObj.get("issuerTin").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `issuerTin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerTin").toString())); } - // validate the optional field `federalEfileStatus` - if (jsonObj.get("federalEfileStatus") != null && !jsonObj.get("federalEfileStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("federalEfileStatus")); - } - if (jsonObj.get("stateEfileStatus") != null && !jsonObj.get("stateEfileStatus").isJsonNull()) { - JsonArray jsonArraystateEfileStatus = jsonObj.getAsJsonArray("stateEfileStatus"); - if (jsonArraystateEfileStatus != null) { - // ensure the json data is an array - if (!jsonObj.get("stateEfileStatus").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `stateEfileStatus` to be an array in the JSON string but got `%s`", jsonObj.get("stateEfileStatus").toString())); - } - - // validate the optional field `stateEfileStatus` (array) - for (int i = 0; i < jsonArraystateEfileStatus.size(); i++) { - StateEfileStatusDetail.validateJsonElement(jsonArraystateEfileStatus.get(i)); - }; - } - } - // validate the optional field `postalMailStatus` - if (jsonObj.get("postalMailStatus") != null && !jsonObj.get("postalMailStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("postalMailStatus")); - } - // validate the optional field `tinMatchStatus` - if (jsonObj.get("tinMatchStatus") != null && !jsonObj.get("tinMatchStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("tinMatchStatus")); - } - // validate the optional field `addressVerificationStatus` - if (jsonObj.get("addressVerificationStatus") != null && !jsonObj.get("addressVerificationStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("addressVerificationStatus")); - } - // validate the optional field `eDeliveryStatus` - if (jsonObj.get("eDeliveryStatus") != null && !jsonObj.get("eDeliveryStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("eDeliveryStatus")); - } if ((jsonObj.get("referenceId") != null && !jsonObj.get("referenceId").isJsonNull()) && !jsonObj.get("referenceId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `referenceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("referenceId").toString())); } - if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); - } - if ((jsonObj.get("tinType") != null && !jsonObj.get("tinType").isJsonNull()) && !jsonObj.get("tinType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `tinType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tinType").toString())); - } if ((jsonObj.get("tin") != null && !jsonObj.get("tin").isJsonNull()) && !jsonObj.get("tin").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `tin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tin").toString())); } if ((jsonObj.get("recipientName") != null && !jsonObj.get("recipientName").isJsonNull()) && !jsonObj.get("recipientName").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `recipientName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientName").toString())); } + if ((jsonObj.get("tinType") != null && !jsonObj.get("tinType").isJsonNull()) && !jsonObj.get("tinType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `tinType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tinType").toString())); + } + // validate the optional field `tinType` + if (jsonObj.get("tinType") != null && !jsonObj.get("tinType").isJsonNull()) { + TinTypeEnum.validateJsonElement(jsonObj.get("tinType")); + } if ((jsonObj.get("recipientSecondName") != null && !jsonObj.get("recipientSecondName").isJsonNull()) && !jsonObj.get("recipientSecondName").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `recipientSecondName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientSecondName").toString())); } @@ -1710,17 +1773,58 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("zip") != null && !jsonObj.get("zip").isJsonNull()) && !jsonObj.get("zip").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `zip` to be a primitive type in the JSON string but got `%s`", jsonObj.get("zip").toString())); } + if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if ((jsonObj.get("accountNumber") != null && !jsonObj.get("accountNumber").isJsonNull()) && !jsonObj.get("accountNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); + } + if ((jsonObj.get("officeCode") != null && !jsonObj.get("officeCode").isJsonNull()) && !jsonObj.get("officeCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `officeCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("officeCode").toString())); + } if ((jsonObj.get("nonUsProvince") != null && !jsonObj.get("nonUsProvince").isJsonNull()) && !jsonObj.get("nonUsProvince").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `nonUsProvince` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nonUsProvince").toString())); } if ((jsonObj.get("countryCode") != null && !jsonObj.get("countryCode").isJsonNull()) && !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("accountNumber") != null && !jsonObj.get("accountNumber").isJsonNull()) && !jsonObj.get("accountNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); + // validate the optional field `stateAndLocalWithholding` + if (jsonObj.get("stateAndLocalWithholding") != null && !jsonObj.get("stateAndLocalWithholding").isJsonNull()) { + StateAndLocalWithholding.validateJsonElement(jsonObj.get("stateAndLocalWithholding")); } - if ((jsonObj.get("officeCode") != null && !jsonObj.get("officeCode").isJsonNull()) && !jsonObj.get("officeCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `officeCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("officeCode").toString())); + // validate the optional field `federalEfileStatus` + if (jsonObj.get("federalEfileStatus") != null && !jsonObj.get("federalEfileStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("federalEfileStatus")); + } + if (jsonObj.get("stateEfileStatus") != null && !jsonObj.get("stateEfileStatus").isJsonNull()) { + JsonArray jsonArraystateEfileStatus = jsonObj.getAsJsonArray("stateEfileStatus"); + if (jsonArraystateEfileStatus != null) { + // ensure the json data is an array + if (!jsonObj.get("stateEfileStatus").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `stateEfileStatus` to be an array in the JSON string but got `%s`", jsonObj.get("stateEfileStatus").toString())); + } + + // validate the optional field `stateEfileStatus` (array) + for (int i = 0; i < jsonArraystateEfileStatus.size(); i++) { + StateEfileStatusDetail.validateJsonElement(jsonArraystateEfileStatus.get(i)); + }; + } + } + // validate the optional field `postalMailStatus` + if (jsonObj.get("postalMailStatus") != null && !jsonObj.get("postalMailStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("postalMailStatus")); + } + // validate the optional field `tinMatchStatus` + if (jsonObj.get("tinMatchStatus") != null && !jsonObj.get("tinMatchStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("tinMatchStatus")); + } + // validate the optional field `addressVerificationStatus` + if (jsonObj.get("addressVerificationStatus") != null && !jsonObj.get("addressVerificationStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("addressVerificationStatus")); + } + // validate the optional field `eDeliveryStatus` + if (jsonObj.get("eDeliveryStatus") != null && !jsonObj.get("eDeliveryStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("eDeliveryStatus")); } if (jsonObj.get("validationErrors") != null && !jsonObj.get("validationErrors").isJsonNull()) { JsonArray jsonArrayvalidationErrors = jsonObj.getAsJsonArray("validationErrors"); @@ -1736,10 +1840,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti }; } } - // validate the optional field `stateAndLocalWithholding` - if (jsonObj.get("stateAndLocalWithholding") != null && !jsonObj.get("stateAndLocalWithholding").isJsonNull()) { - StateAndLocalWithholding.validateJsonElement(jsonObj.get("stateAndLocalWithholding")); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/Form1099Int.java b/src/main/java/Avalara/SDK/model/A1099/V2/Form1099Int.java index c5ac517..70140b8 100644 --- a/src/main/java/Avalara/SDK/model/A1099/V2/Form1099Int.java +++ b/src/main/java/Avalara/SDK/model/A1099/V2/Form1099Int.java @@ -30,6 +30,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.Arrays; @@ -121,17 +122,87 @@ public class Form1099Int { @SerializedName(SERIALIZED_NAME_TAX_EXEMPT_BOND_CUSIP_NUMBER) private String taxExemptBondCusipNumber; - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; + public static final String SERIALIZED_NAME_FATCA_FILING_REQUIREMENT = "fatcaFilingRequirement"; + @SerializedName(SERIALIZED_NAME_FATCA_FILING_REQUIREMENT) + private Boolean fatcaFilingRequirement; + + /** + * Form type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + _1099_NEC("1099-NEC"), + + _1099_MISC("1099-MISC"), + + _1099_DIV("1099-DIV"), + + _1099_R("1099-R"), + + _1099_K("1099-K"), + + _1095_B("1095-B"), + + _1042_S("1042-S"), + + _1095_C("1095-C"), + + _1099_INT("1099-INT"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.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 TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) - private String type; + private TypeEnum type; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; public static final String SERIALIZED_NAME_ISSUER_ID = "issuerId"; @SerializedName(SERIALIZED_NAME_ISSUER_ID) - private Integer issuerId; + private String issuerId; public static final String SERIALIZED_NAME_ISSUER_REFERENCE_ID = "issuerReferenceId"; @SerializedName(SERIALIZED_NAME_ISSUER_REFERENCE_ID) @@ -145,81 +216,79 @@ public class Form1099Int { @SerializedName(SERIALIZED_NAME_TAX_YEAR) private Integer taxYear; - public static final String SERIALIZED_NAME_FEDERAL_EFILE = "federalEfile"; - @SerializedName(SERIALIZED_NAME_FEDERAL_EFILE) - private Boolean federalEfile; - - public static final String SERIALIZED_NAME_FEDERAL_EFILE_STATUS = "federalEfileStatus"; - @SerializedName(SERIALIZED_NAME_FEDERAL_EFILE_STATUS) - private Form1099StatusDetail federalEfileStatus; - - public static final String SERIALIZED_NAME_STATE_EFILE = "stateEfile"; - @SerializedName(SERIALIZED_NAME_STATE_EFILE) - private Boolean stateEfile; - - public static final String SERIALIZED_NAME_STATE_EFILE_STATUS = "stateEfileStatus"; - @SerializedName(SERIALIZED_NAME_STATE_EFILE_STATUS) - private List stateEfileStatus; + public static final String SERIALIZED_NAME_REFERENCE_ID = "referenceId"; + @SerializedName(SERIALIZED_NAME_REFERENCE_ID) + private String referenceId; - public static final String SERIALIZED_NAME_POSTAL_MAIL = "postalMail"; - @SerializedName(SERIALIZED_NAME_POSTAL_MAIL) - private Boolean postalMail; + public static final String SERIALIZED_NAME_TIN = "tin"; + @SerializedName(SERIALIZED_NAME_TIN) + private String tin; - public static final String SERIALIZED_NAME_POSTAL_MAIL_STATUS = "postalMailStatus"; - @SerializedName(SERIALIZED_NAME_POSTAL_MAIL_STATUS) - private Form1099StatusDetail postalMailStatus; + public static final String SERIALIZED_NAME_RECIPIENT_NAME = "recipientName"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_NAME) + private String recipientName; - public static final String SERIALIZED_NAME_TIN_MATCH = "tinMatch"; - @SerializedName(SERIALIZED_NAME_TIN_MATCH) - private Boolean tinMatch; + /** + * Type of TIN (Tax ID Number) + */ + @JsonAdapter(TinTypeEnum.Adapter.class) + public enum TinTypeEnum { + EMPTY("Empty"), + + EIN("EIN"), + + SSN("SSN"), + + ITIN("ITIN"), + + ATIN("ATIN"); + + private String value; + + TinTypeEnum(String value) { + this.value = value; + } - public static final String SERIALIZED_NAME_TIN_MATCH_STATUS = "tinMatchStatus"; - @SerializedName(SERIALIZED_NAME_TIN_MATCH_STATUS) - private Form1099StatusDetail tinMatchStatus; + public String getValue() { + return value; + } - public static final String SERIALIZED_NAME_ADDRESS_VERIFICATION = "addressVerification"; - @SerializedName(SERIALIZED_NAME_ADDRESS_VERIFICATION) - private Boolean addressVerification; + @Override + public String toString() { + return String.valueOf(value); + } - public static final String SERIALIZED_NAME_ADDRESS_VERIFICATION_STATUS = "addressVerificationStatus"; - @SerializedName(SERIALIZED_NAME_ADDRESS_VERIFICATION_STATUS) - private Form1099StatusDetail addressVerificationStatus; + public static TinTypeEnum fromValue(String value) { + for (TinTypeEnum b : TinTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } - public static final String SERIALIZED_NAME_E_DELIVERY_STATUS = "eDeliveryStatus"; - @SerializedName(SERIALIZED_NAME_E_DELIVERY_STATUS) - private Form1099StatusDetail eDeliveryStatus; + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TinTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } - public static final String SERIALIZED_NAME_REFERENCE_ID = "referenceId"; - @SerializedName(SERIALIZED_NAME_REFERENCE_ID) - private String referenceId; + @Override + public TinTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TinTypeEnum.fromValue(value); + } + } - public static final String SERIALIZED_NAME_EMAIL = "email"; - @SerializedName(SERIALIZED_NAME_EMAIL) - private String email; + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TinTypeEnum.fromValue(value); + } + } public static final String SERIALIZED_NAME_TIN_TYPE = "tinType"; @SerializedName(SERIALIZED_NAME_TIN_TYPE) - private String tinType; - - public static final String SERIALIZED_NAME_FATCA_FILING_REQUIREMENT = "fatcaFilingRequirement"; - @SerializedName(SERIALIZED_NAME_FATCA_FILING_REQUIREMENT) - private Boolean fatcaFilingRequirement; - - public static final String SERIALIZED_NAME_TIN = "tin"; - @SerializedName(SERIALIZED_NAME_TIN) - private String tin; - - public static final String SERIALIZED_NAME_NO_TIN = "noTin"; - @SerializedName(SERIALIZED_NAME_NO_TIN) - private Boolean noTin; - - public static final String SERIALIZED_NAME_SECOND_TIN_NOTICE = "secondTinNotice"; - @SerializedName(SERIALIZED_NAME_SECOND_TIN_NOTICE) - private Boolean secondTinNotice; - - public static final String SERIALIZED_NAME_RECIPIENT_NAME = "recipientName"; - @SerializedName(SERIALIZED_NAME_RECIPIENT_NAME) - private String recipientName; + private TinTypeEnum tinType; public static final String SERIALIZED_NAME_RECIPIENT_SECOND_NAME = "recipientSecondName"; @SerializedName(SERIALIZED_NAME_RECIPIENT_SECOND_NAME) @@ -245,6 +314,18 @@ public class Form1099Int { @SerializedName(SERIALIZED_NAME_ZIP) private String zip; + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) + private String accountNumber; + + public static final String SERIALIZED_NAME_OFFICE_CODE = "officeCode"; + @SerializedName(SERIALIZED_NAME_OFFICE_CODE) + private String officeCode; + public static final String SERIALIZED_NAME_NON_US_PROVINCE = "nonUsProvince"; @SerializedName(SERIALIZED_NAME_NON_US_PROVINCE) private String nonUsProvince; @@ -253,13 +334,65 @@ public class Form1099Int { @SerializedName(SERIALIZED_NAME_COUNTRY_CODE) private String countryCode; - public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; - @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) - private String accountNumber; + public static final String SERIALIZED_NAME_FEDERAL_EFILE_DATE = "federalEfileDate"; + @SerializedName(SERIALIZED_NAME_FEDERAL_EFILE_DATE) + private LocalDate federalEfileDate; - public static final String SERIALIZED_NAME_OFFICE_CODE = "officeCode"; - @SerializedName(SERIALIZED_NAME_OFFICE_CODE) - private String officeCode; + public static final String SERIALIZED_NAME_POSTAL_MAIL = "postalMail"; + @SerializedName(SERIALIZED_NAME_POSTAL_MAIL) + private Boolean postalMail; + + public static final String SERIALIZED_NAME_STATE_EFILE_DATE = "stateEfileDate"; + @SerializedName(SERIALIZED_NAME_STATE_EFILE_DATE) + private LocalDate stateEfileDate; + + public static final String SERIALIZED_NAME_RECIPIENT_EDELIVERY_DATE = "recipientEdeliveryDate"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_EDELIVERY_DATE) + private LocalDate recipientEdeliveryDate; + + public static final String SERIALIZED_NAME_TIN_MATCH = "tinMatch"; + @SerializedName(SERIALIZED_NAME_TIN_MATCH) + private Boolean tinMatch; + + public static final String SERIALIZED_NAME_NO_TIN = "noTin"; + @SerializedName(SERIALIZED_NAME_NO_TIN) + private Boolean noTin; + + public static final String SERIALIZED_NAME_ADDRESS_VERIFICATION = "addressVerification"; + @SerializedName(SERIALIZED_NAME_ADDRESS_VERIFICATION) + private Boolean addressVerification; + + public static final String SERIALIZED_NAME_STATE_AND_LOCAL_WITHHOLDING = "stateAndLocalWithholding"; + @SerializedName(SERIALIZED_NAME_STATE_AND_LOCAL_WITHHOLDING) + private StateAndLocalWithholding stateAndLocalWithholding; + + public static final String SERIALIZED_NAME_SECOND_TIN_NOTICE = "secondTinNotice"; + @SerializedName(SERIALIZED_NAME_SECOND_TIN_NOTICE) + private Boolean secondTinNotice; + + public static final String SERIALIZED_NAME_FEDERAL_EFILE_STATUS = "federalEfileStatus"; + @SerializedName(SERIALIZED_NAME_FEDERAL_EFILE_STATUS) + private Form1099StatusDetail federalEfileStatus; + + public static final String SERIALIZED_NAME_STATE_EFILE_STATUS = "stateEfileStatus"; + @SerializedName(SERIALIZED_NAME_STATE_EFILE_STATUS) + private List stateEfileStatus; + + public static final String SERIALIZED_NAME_POSTAL_MAIL_STATUS = "postalMailStatus"; + @SerializedName(SERIALIZED_NAME_POSTAL_MAIL_STATUS) + private Form1099StatusDetail postalMailStatus; + + public static final String SERIALIZED_NAME_TIN_MATCH_STATUS = "tinMatchStatus"; + @SerializedName(SERIALIZED_NAME_TIN_MATCH_STATUS) + private Form1099StatusDetail tinMatchStatus; + + public static final String SERIALIZED_NAME_ADDRESS_VERIFICATION_STATUS = "addressVerificationStatus"; + @SerializedName(SERIALIZED_NAME_ADDRESS_VERIFICATION_STATUS) + private Form1099StatusDetail addressVerificationStatus; + + public static final String SERIALIZED_NAME_E_DELIVERY_STATUS = "eDeliveryStatus"; + @SerializedName(SERIALIZED_NAME_E_DELIVERY_STATUS) + private Form1099StatusDetail eDeliveryStatus; public static final String SERIALIZED_NAME_VALIDATION_ERRORS = "validationErrors"; @SerializedName(SERIALIZED_NAME_VALIDATION_ERRORS) @@ -273,20 +406,41 @@ public class Form1099Int { @SerializedName(SERIALIZED_NAME_UPDATED_AT) private OffsetDateTime updatedAt; - public static final String SERIALIZED_NAME_STATE_AND_LOCAL_WITHHOLDING = "stateAndLocalWithholding"; - @SerializedName(SERIALIZED_NAME_STATE_AND_LOCAL_WITHHOLDING) - private StateAndLocalWithholding stateAndLocalWithholding; - public Form1099Int() { } + public Form1099Int( + String id, + Form1099StatusDetail federalEfileStatus, + List stateEfileStatus, + Form1099StatusDetail postalMailStatus, + Form1099StatusDetail tinMatchStatus, + Form1099StatusDetail addressVerificationStatus, + Form1099StatusDetail eDeliveryStatus, + List validationErrors, + OffsetDateTime createdAt, + OffsetDateTime updatedAt + ) { + this(); + this.id = id; + this.federalEfileStatus = federalEfileStatus; + this.stateEfileStatus = stateEfileStatus; + this.postalMailStatus = postalMailStatus; + this.tinMatchStatus = tinMatchStatus; + this.addressVerificationStatus = addressVerificationStatus; + this.eDeliveryStatus = eDeliveryStatus; + this.validationErrors = validationErrors; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + public Form1099Int interestIncome(Double interestIncome) { this.interestIncome = interestIncome; return this; } /** - * Get interestIncome + * Interest Income * @return interestIncome */ @javax.annotation.Nullable @@ -305,7 +459,7 @@ public Form1099Int earlyWithdrawalPenalty(Double earlyWithdrawalPenalty) { } /** - * Get earlyWithdrawalPenalty + * Early Withdrawal Penalty * @return earlyWithdrawalPenalty */ @javax.annotation.Nullable @@ -324,7 +478,7 @@ public Form1099Int usSavingsBondsInterest(Double usSavingsBondsInterest) { } /** - * Get usSavingsBondsInterest + * Interest on U.S. Savings Bonds and Treasury obligations * @return usSavingsBondsInterest */ @javax.annotation.Nullable @@ -343,7 +497,7 @@ public Form1099Int federalIncomeTaxWithheld(Double federalIncomeTaxWithheld) { } /** - * Get federalIncomeTaxWithheld + * Federal income tax withheld * @return federalIncomeTaxWithheld */ @javax.annotation.Nullable @@ -362,7 +516,7 @@ public Form1099Int investmentExpenses(Double investmentExpenses) { } /** - * Get investmentExpenses + * Investment Expenses * @return investmentExpenses */ @javax.annotation.Nullable @@ -381,7 +535,7 @@ public Form1099Int foreignTaxPaid(Double foreignTaxPaid) { } /** - * Get foreignTaxPaid + * Foreign tax paid * @return foreignTaxPaid */ @javax.annotation.Nullable @@ -400,7 +554,7 @@ public Form1099Int foreignCountry(String foreignCountry) { } /** - * Get foreignCountry + * Foreign country or U.S. possession * @return foreignCountry */ @javax.annotation.Nullable @@ -419,7 +573,7 @@ public Form1099Int taxExemptInterest(Double taxExemptInterest) { } /** - * Get taxExemptInterest + * Tax-Exempt Interest * @return taxExemptInterest */ @javax.annotation.Nullable @@ -438,7 +592,7 @@ public Form1099Int specifiedPrivateActivityBondInterest(Double specifiedPrivateA } /** - * Get specifiedPrivateActivityBondInterest + * Specified Private activity * @return specifiedPrivateActivityBondInterest */ @javax.annotation.Nullable @@ -457,7 +611,7 @@ public Form1099Int marketDiscount(Double marketDiscount) { } /** - * Get marketDiscount + * Market Discount * @return marketDiscount */ @javax.annotation.Nullable @@ -476,7 +630,7 @@ public Form1099Int bondPremium(Double bondPremium) { } /** - * Get bondPremium + * Bond Premium * @return bondPremium */ @javax.annotation.Nullable @@ -495,7 +649,7 @@ public Form1099Int bondPremiumOnTreasuryObligations(Double bondPremiumOnTreasury } /** - * Get bondPremiumOnTreasuryObligations + * Bond Premium on Treasury obligations * @return bondPremiumOnTreasuryObligations */ @javax.annotation.Nullable @@ -514,7 +668,7 @@ public Form1099Int bondPremiumOnTaxExemptBond(Double bondPremiumOnTaxExemptBond) } /** - * Get bondPremiumOnTaxExemptBond + * Bond Premium on tax exempt bond * @return bondPremiumOnTaxExemptBond */ @javax.annotation.Nullable @@ -533,7 +687,7 @@ public Form1099Int taxExemptBondCusipNumber(String taxExemptBondCusipNumber) { } /** - * Get taxExemptBondCusipNumber + * Tax exempt bond CUSIP no. * @return taxExemptBondCusipNumber */ @javax.annotation.Nullable @@ -546,59 +700,70 @@ public void setTaxExemptBondCusipNumber(String taxExemptBondCusipNumber) { } - public Form1099Int id(String id) { - this.id = id; + public Form1099Int fatcaFilingRequirement(Boolean fatcaFilingRequirement) { + this.fatcaFilingRequirement = fatcaFilingRequirement; return this; } /** - * Get id - * @return id + * FATCA filing requirement + * @return fatcaFilingRequirement */ @javax.annotation.Nullable - public String getId() { - return id; + public Boolean getFatcaFilingRequirement() { + return fatcaFilingRequirement; } - public void setId(String id) { - this.id = id; + public void setFatcaFilingRequirement(Boolean fatcaFilingRequirement) { + this.fatcaFilingRequirement = fatcaFilingRequirement; } - public Form1099Int type(String type) { + public Form1099Int type(TypeEnum type) { this.type = type; return this; } /** - * Get type + * Form type * @return type */ - @javax.annotation.Nullable - public String getType() { + @javax.annotation.Nonnull + public TypeEnum getType() { return type; } - public void setType(String type) { + public void setType(TypeEnum type) { this.type = type; } - public Form1099Int issuerId(Integer issuerId) { + /** + * Form ID. Unique identifier set when the record is created. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + + + public Form1099Int issuerId(String issuerId) { this.issuerId = issuerId; return this; } /** - * Get issuerId + * Issuer ID - only required when creating forms * @return issuerId */ @javax.annotation.Nullable - public Integer getIssuerId() { + public String getIssuerId() { return issuerId; } - public void setIssuerId(Integer issuerId) { + public void setIssuerId(String issuerId) { this.issuerId = issuerId; } @@ -609,7 +774,7 @@ public Form1099Int issuerReferenceId(String issuerReferenceId) { } /** - * Get issuerReferenceId + * Issuer Reference ID - only required when creating forms * @return issuerReferenceId */ @javax.annotation.Nullable @@ -628,7 +793,7 @@ public Form1099Int issuerTin(String issuerTin) { } /** - * Get issuerTin + * Issuer TIN - readonly * @return issuerTin */ @javax.annotation.Nullable @@ -647,7 +812,7 @@ public Form1099Int taxYear(Integer taxYear) { } /** - * Get taxYear + * Tax Year - only required when creating forms * @return taxYear */ @javax.annotation.Nullable @@ -660,580 +825,530 @@ public void setTaxYear(Integer taxYear) { } - public Form1099Int federalEfile(Boolean federalEfile) { - this.federalEfile = federalEfile; + public Form1099Int referenceId(String referenceId) { + this.referenceId = referenceId; return this; } /** - * Get federalEfile - * @return federalEfile + * Internal reference ID. Never shown to any agency or recipient. + * @return referenceId */ @javax.annotation.Nullable - public Boolean getFederalEfile() { - return federalEfile; + public String getReferenceId() { + return referenceId; } - public void setFederalEfile(Boolean federalEfile) { - this.federalEfile = federalEfile; + public void setReferenceId(String referenceId) { + this.referenceId = referenceId; } - public Form1099Int federalEfileStatus(Form1099StatusDetail federalEfileStatus) { - this.federalEfileStatus = federalEfileStatus; + public Form1099Int tin(String tin) { + this.tin = tin; return this; } /** - * Get federalEfileStatus - * @return federalEfileStatus + * Recipient's Federal Tax Identification Number (TIN). + * @return tin */ @javax.annotation.Nullable - public Form1099StatusDetail getFederalEfileStatus() { - return federalEfileStatus; + public String getTin() { + return tin; } - public void setFederalEfileStatus(Form1099StatusDetail federalEfileStatus) { - this.federalEfileStatus = federalEfileStatus; + public void setTin(String tin) { + this.tin = tin; } - public Form1099Int stateEfile(Boolean stateEfile) { - this.stateEfile = stateEfile; + public Form1099Int recipientName(String recipientName) { + this.recipientName = recipientName; return this; } /** - * Get stateEfile - * @return stateEfile + * Recipient name + * @return recipientName */ @javax.annotation.Nullable - public Boolean getStateEfile() { - return stateEfile; + public String getRecipientName() { + return recipientName; } - public void setStateEfile(Boolean stateEfile) { - this.stateEfile = stateEfile; + public void setRecipientName(String recipientName) { + this.recipientName = recipientName; } - public Form1099Int stateEfileStatus(List stateEfileStatus) { - this.stateEfileStatus = stateEfileStatus; - return this; - } - - public Form1099Int addStateEfileStatusItem(StateEfileStatusDetail stateEfileStatusItem) { - if (this.stateEfileStatus == null) { - this.stateEfileStatus = new ArrayList<>(); - } - this.stateEfileStatus.add(stateEfileStatusItem); + public Form1099Int tinType(TinTypeEnum tinType) { + this.tinType = tinType; return this; } /** - * Get stateEfileStatus - * @return stateEfileStatus + * Type of TIN (Tax ID Number) + * @return tinType */ @javax.annotation.Nullable - public List getStateEfileStatus() { - return stateEfileStatus; + public TinTypeEnum getTinType() { + return tinType; } - public void setStateEfileStatus(List stateEfileStatus) { - this.stateEfileStatus = stateEfileStatus; + public void setTinType(TinTypeEnum tinType) { + this.tinType = tinType; } - public Form1099Int postalMail(Boolean postalMail) { - this.postalMail = postalMail; + public Form1099Int recipientSecondName(String recipientSecondName) { + this.recipientSecondName = recipientSecondName; return this; } /** - * Get postalMail - * @return postalMail + * Recipient second name + * @return recipientSecondName */ @javax.annotation.Nullable - public Boolean getPostalMail() { - return postalMail; + public String getRecipientSecondName() { + return recipientSecondName; } - public void setPostalMail(Boolean postalMail) { - this.postalMail = postalMail; + public void setRecipientSecondName(String recipientSecondName) { + this.recipientSecondName = recipientSecondName; } - public Form1099Int postalMailStatus(Form1099StatusDetail postalMailStatus) { - this.postalMailStatus = postalMailStatus; + public Form1099Int address(String address) { + this.address = address; return this; } /** - * Get postalMailStatus - * @return postalMailStatus + * Address. + * @return address */ @javax.annotation.Nullable - public Form1099StatusDetail getPostalMailStatus() { - return postalMailStatus; + public String getAddress() { + return address; } - public void setPostalMailStatus(Form1099StatusDetail postalMailStatus) { - this.postalMailStatus = postalMailStatus; + public void setAddress(String address) { + this.address = address; } - public Form1099Int tinMatch(Boolean tinMatch) { - this.tinMatch = tinMatch; + public Form1099Int address2(String address2) { + this.address2 = address2; return this; } /** - * Get tinMatch - * @return tinMatch + * Address line 2. + * @return address2 */ @javax.annotation.Nullable - public Boolean getTinMatch() { - return tinMatch; + public String getAddress2() { + return address2; } - public void setTinMatch(Boolean tinMatch) { - this.tinMatch = tinMatch; + public void setAddress2(String address2) { + this.address2 = address2; } - public Form1099Int tinMatchStatus(Form1099StatusDetail tinMatchStatus) { - this.tinMatchStatus = tinMatchStatus; + public Form1099Int city(String city) { + this.city = city; return this; } /** - * Get tinMatchStatus - * @return tinMatchStatus + * City. + * @return city */ @javax.annotation.Nullable - public Form1099StatusDetail getTinMatchStatus() { - return tinMatchStatus; + public String getCity() { + return city; } - public void setTinMatchStatus(Form1099StatusDetail tinMatchStatus) { - this.tinMatchStatus = tinMatchStatus; + public void setCity(String city) { + this.city = city; } - public Form1099Int addressVerification(Boolean addressVerification) { - this.addressVerification = addressVerification; + public Form1099Int state(String state) { + this.state = state; return this; } /** - * Get addressVerification - * @return addressVerification + * Two-letter US state or Canadian province code (required for US/CA addresses). + * @return state */ @javax.annotation.Nullable - public Boolean getAddressVerification() { - return addressVerification; + public String getState() { + return state; } - public void setAddressVerification(Boolean addressVerification) { - this.addressVerification = addressVerification; + public void setState(String state) { + this.state = state; } - public Form1099Int addressVerificationStatus(Form1099StatusDetail addressVerificationStatus) { - this.addressVerificationStatus = addressVerificationStatus; + public Form1099Int zip(String zip) { + this.zip = zip; return this; } /** - * Get addressVerificationStatus - * @return addressVerificationStatus + * ZIP/postal code. + * @return zip */ @javax.annotation.Nullable - public Form1099StatusDetail getAddressVerificationStatus() { - return addressVerificationStatus; + public String getZip() { + return zip; } - public void setAddressVerificationStatus(Form1099StatusDetail addressVerificationStatus) { - this.addressVerificationStatus = addressVerificationStatus; + public void setZip(String zip) { + this.zip = zip; } - public Form1099Int eDeliveryStatus(Form1099StatusDetail eDeliveryStatus) { - this.eDeliveryStatus = eDeliveryStatus; + public Form1099Int email(String email) { + this.email = email; return this; } /** - * Get eDeliveryStatus - * @return eDeliveryStatus + * Recipient's Contact email address. + * @return email */ @javax.annotation.Nullable - public Form1099StatusDetail geteDeliveryStatus() { - return eDeliveryStatus; + public String getEmail() { + return email; } - public void seteDeliveryStatus(Form1099StatusDetail eDeliveryStatus) { - this.eDeliveryStatus = eDeliveryStatus; + public void setEmail(String email) { + this.email = email; } - public Form1099Int referenceId(String referenceId) { - this.referenceId = referenceId; + public Form1099Int accountNumber(String accountNumber) { + this.accountNumber = accountNumber; return this; } /** - * Get referenceId - * @return referenceId + * Account number + * @return accountNumber */ @javax.annotation.Nullable - public String getReferenceId() { - return referenceId; + public String getAccountNumber() { + return accountNumber; } - public void setReferenceId(String referenceId) { - this.referenceId = referenceId; + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; } - public Form1099Int email(String email) { - this.email = email; + public Form1099Int officeCode(String officeCode) { + this.officeCode = officeCode; return this; } /** - * Get email - * @return email + * Office code + * @return officeCode */ @javax.annotation.Nullable - public String getEmail() { - return email; + public String getOfficeCode() { + return officeCode; } - public void setEmail(String email) { - this.email = email; + public void setOfficeCode(String officeCode) { + this.officeCode = officeCode; } - public Form1099Int tinType(String tinType) { - this.tinType = tinType; + public Form1099Int nonUsProvince(String nonUsProvince) { + this.nonUsProvince = nonUsProvince; return this; } /** - * Get tinType - * @return tinType + * Province or region for non-US/CA addresses. + * @return nonUsProvince */ @javax.annotation.Nullable - public String getTinType() { - return tinType; + public String getNonUsProvince() { + return nonUsProvince; } - public void setTinType(String tinType) { - this.tinType = tinType; + public void setNonUsProvince(String nonUsProvince) { + this.nonUsProvince = nonUsProvince; } - public Form1099Int fatcaFilingRequirement(Boolean fatcaFilingRequirement) { - this.fatcaFilingRequirement = fatcaFilingRequirement; + public Form1099Int countryCode(String countryCode) { + this.countryCode = countryCode; return this; } /** - * Get fatcaFilingRequirement - * @return fatcaFilingRequirement + * Two-letter IRS country code (e.g., 'US', 'CA'), as defined at https://www.irs.gov/e-file-providers/country-codes. + * @return countryCode */ @javax.annotation.Nullable - public Boolean getFatcaFilingRequirement() { - return fatcaFilingRequirement; + public String getCountryCode() { + return countryCode; } - public void setFatcaFilingRequirement(Boolean fatcaFilingRequirement) { - this.fatcaFilingRequirement = fatcaFilingRequirement; + public void setCountryCode(String countryCode) { + this.countryCode = countryCode; } - public Form1099Int tin(String tin) { - this.tin = tin; + public Form1099Int federalEfileDate(LocalDate federalEfileDate) { + this.federalEfileDate = federalEfileDate; return this; } /** - * Get tin - * @return tin + * Date when federal e-filing should be scheduled for this form + * @return federalEfileDate */ @javax.annotation.Nullable - public String getTin() { - return tin; + public LocalDate getFederalEfileDate() { + return federalEfileDate; } - public void setTin(String tin) { - this.tin = tin; + public void setFederalEfileDate(LocalDate federalEfileDate) { + this.federalEfileDate = federalEfileDate; } - public Form1099Int noTin(Boolean noTin) { - this.noTin = noTin; + public Form1099Int postalMail(Boolean postalMail) { + this.postalMail = postalMail; return this; } /** - * Get noTin - * @return noTin + * Boolean indicating that postal mailing to the recipient should be scheduled for this form + * @return postalMail */ @javax.annotation.Nullable - public Boolean getNoTin() { - return noTin; + public Boolean getPostalMail() { + return postalMail; } - public void setNoTin(Boolean noTin) { - this.noTin = noTin; + public void setPostalMail(Boolean postalMail) { + this.postalMail = postalMail; } - public Form1099Int secondTinNotice(Boolean secondTinNotice) { - this.secondTinNotice = secondTinNotice; + public Form1099Int stateEfileDate(LocalDate stateEfileDate) { + this.stateEfileDate = stateEfileDate; return this; } /** - * Get secondTinNotice - * @return secondTinNotice + * Date when state e-filing should be scheduled for this form + * @return stateEfileDate */ @javax.annotation.Nullable - public Boolean getSecondTinNotice() { - return secondTinNotice; + public LocalDate getStateEfileDate() { + return stateEfileDate; } - public void setSecondTinNotice(Boolean secondTinNotice) { - this.secondTinNotice = secondTinNotice; + public void setStateEfileDate(LocalDate stateEfileDate) { + this.stateEfileDate = stateEfileDate; } - public Form1099Int recipientName(String recipientName) { - this.recipientName = recipientName; + public Form1099Int recipientEdeliveryDate(LocalDate recipientEdeliveryDate) { + this.recipientEdeliveryDate = recipientEdeliveryDate; return this; } /** - * Get recipientName - * @return recipientName + * Date when recipient e-delivery should be scheduled for this form + * @return recipientEdeliveryDate */ @javax.annotation.Nullable - public String getRecipientName() { - return recipientName; + public LocalDate getRecipientEdeliveryDate() { + return recipientEdeliveryDate; } - public void setRecipientName(String recipientName) { - this.recipientName = recipientName; + public void setRecipientEdeliveryDate(LocalDate recipientEdeliveryDate) { + this.recipientEdeliveryDate = recipientEdeliveryDate; } - public Form1099Int recipientSecondName(String recipientSecondName) { - this.recipientSecondName = recipientSecondName; + public Form1099Int tinMatch(Boolean tinMatch) { + this.tinMatch = tinMatch; return this; } /** - * Get recipientSecondName - * @return recipientSecondName + * Boolean indicating that TIN Matching should be scheduled for this form + * @return tinMatch */ @javax.annotation.Nullable - public String getRecipientSecondName() { - return recipientSecondName; + public Boolean getTinMatch() { + return tinMatch; } - public void setRecipientSecondName(String recipientSecondName) { - this.recipientSecondName = recipientSecondName; + public void setTinMatch(Boolean tinMatch) { + this.tinMatch = tinMatch; } - public Form1099Int address(String address) { - this.address = address; + public Form1099Int noTin(Boolean noTin) { + this.noTin = noTin; return this; } /** - * Get address - * @return address + * No TIN indicator + * @return noTin */ @javax.annotation.Nullable - public String getAddress() { - return address; + public Boolean getNoTin() { + return noTin; } - public void setAddress(String address) { - this.address = address; + public void setNoTin(Boolean noTin) { + this.noTin = noTin; } - public Form1099Int address2(String address2) { - this.address2 = address2; + public Form1099Int addressVerification(Boolean addressVerification) { + this.addressVerification = addressVerification; return this; } /** - * Get address2 - * @return address2 + * Boolean indicating that address verification should be scheduled for this form + * @return addressVerification */ @javax.annotation.Nullable - public String getAddress2() { - return address2; + public Boolean getAddressVerification() { + return addressVerification; } - public void setAddress2(String address2) { - this.address2 = address2; + public void setAddressVerification(Boolean addressVerification) { + this.addressVerification = addressVerification; } - public Form1099Int city(String city) { - this.city = city; + public Form1099Int stateAndLocalWithholding(StateAndLocalWithholding stateAndLocalWithholding) { + this.stateAndLocalWithholding = stateAndLocalWithholding; return this; } /** - * Get city - * @return city + * State and local withholding information + * @return stateAndLocalWithholding */ @javax.annotation.Nullable - public String getCity() { - return city; + public StateAndLocalWithholding getStateAndLocalWithholding() { + return stateAndLocalWithholding; } - public void setCity(String city) { - this.city = city; + public void setStateAndLocalWithholding(StateAndLocalWithholding stateAndLocalWithholding) { + this.stateAndLocalWithholding = stateAndLocalWithholding; } - public Form1099Int state(String state) { - this.state = state; + public Form1099Int secondTinNotice(Boolean secondTinNotice) { + this.secondTinNotice = secondTinNotice; return this; } /** - * Get state - * @return state + * Second TIN notice + * @return secondTinNotice */ @javax.annotation.Nullable - public String getState() { - return state; + public Boolean getSecondTinNotice() { + return secondTinNotice; } - public void setState(String state) { - this.state = state; + public void setSecondTinNotice(Boolean secondTinNotice) { + this.secondTinNotice = secondTinNotice; } - public Form1099Int zip(String zip) { - this.zip = zip; - return this; - } - /** - * Get zip - * @return zip + * Federal e-file status + * @return federalEfileStatus */ @javax.annotation.Nullable - public String getZip() { - return zip; - } - - public void setZip(String zip) { - this.zip = zip; + public Form1099StatusDetail getFederalEfileStatus() { + return federalEfileStatus; } - public Form1099Int nonUsProvince(String nonUsProvince) { - this.nonUsProvince = nonUsProvince; - return this; - } /** - * Get nonUsProvince - * @return nonUsProvince + * State e-file status + * @return stateEfileStatus */ @javax.annotation.Nullable - public String getNonUsProvince() { - return nonUsProvince; - } - - public void setNonUsProvince(String nonUsProvince) { - this.nonUsProvince = nonUsProvince; + public List getStateEfileStatus() { + return stateEfileStatus; } - public Form1099Int countryCode(String countryCode) { - this.countryCode = countryCode; - return this; - } /** - * Get countryCode - * @return countryCode + * Postal mail to recipient status + * @return postalMailStatus */ @javax.annotation.Nullable - public String getCountryCode() { - return countryCode; - } - - public void setCountryCode(String countryCode) { - this.countryCode = countryCode; + public Form1099StatusDetail getPostalMailStatus() { + return postalMailStatus; } - public Form1099Int accountNumber(String accountNumber) { - this.accountNumber = accountNumber; - return this; - } /** - * Get accountNumber - * @return accountNumber + * TIN Match status + * @return tinMatchStatus */ @javax.annotation.Nullable - public String getAccountNumber() { - return accountNumber; + public Form1099StatusDetail getTinMatchStatus() { + return tinMatchStatus; } - public void setAccountNumber(String accountNumber) { - this.accountNumber = accountNumber; - } - public Form1099Int officeCode(String officeCode) { - this.officeCode = officeCode; - return this; + /** + * Address verification status + * @return addressVerificationStatus + */ + @javax.annotation.Nullable + public Form1099StatusDetail getAddressVerificationStatus() { + return addressVerificationStatus; } + + /** - * Get officeCode - * @return officeCode + * EDelivery status + * @return eDeliveryStatus */ @javax.annotation.Nullable - public String getOfficeCode() { - return officeCode; - } - - public void setOfficeCode(String officeCode) { - this.officeCode = officeCode; + public Form1099StatusDetail geteDeliveryStatus() { + return eDeliveryStatus; } - public Form1099Int validationErrors(List validationErrors) { - this.validationErrors = validationErrors; - return this; - } - - public Form1099Int addValidationErrorsItem(ValidationError validationErrorsItem) { - if (this.validationErrors == null) { - this.validationErrors = new ArrayList<>(); - } - this.validationErrors.add(validationErrorsItem); - return this; - } /** - * Get validationErrors + * Validation errors * @return validationErrors */ @javax.annotation.Nullable @@ -1241,18 +1356,10 @@ public List getValidationErrors() { return validationErrors; } - public void setValidationErrors(List validationErrors) { - this.validationErrors = validationErrors; - } - - public Form1099Int createdAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - return this; - } /** - * Get createdAt + * Date time when the record was created. * @return createdAt */ @javax.annotation.Nullable @@ -1260,18 +1367,10 @@ public OffsetDateTime getCreatedAt() { return createdAt; } - public void setCreatedAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - } - - public Form1099Int updatedAt(OffsetDateTime updatedAt) { - this.updatedAt = updatedAt; - return this; - } /** - * Get updatedAt + * Date time when the record was last updated. * @return updatedAt */ @javax.annotation.Nullable @@ -1279,28 +1378,6 @@ public OffsetDateTime getUpdatedAt() { return updatedAt; } - public void setUpdatedAt(OffsetDateTime updatedAt) { - this.updatedAt = updatedAt; - } - - - public Form1099Int stateAndLocalWithholding(StateAndLocalWithholding stateAndLocalWithholding) { - this.stateAndLocalWithholding = stateAndLocalWithholding; - return this; - } - - /** - * Get stateAndLocalWithholding - * @return stateAndLocalWithholding - */ - @javax.annotation.Nullable - public StateAndLocalWithholding getStateAndLocalWithholding() { - return stateAndLocalWithholding; - } - - public void setStateAndLocalWithholding(StateAndLocalWithholding stateAndLocalWithholding) { - this.stateAndLocalWithholding = stateAndLocalWithholding; - } @@ -1327,45 +1404,46 @@ public boolean equals(Object o) { Objects.equals(this.bondPremiumOnTreasuryObligations, form1099Int.bondPremiumOnTreasuryObligations) && Objects.equals(this.bondPremiumOnTaxExemptBond, form1099Int.bondPremiumOnTaxExemptBond) && Objects.equals(this.taxExemptBondCusipNumber, form1099Int.taxExemptBondCusipNumber) && - Objects.equals(this.id, form1099Int.id) && + Objects.equals(this.fatcaFilingRequirement, form1099Int.fatcaFilingRequirement) && Objects.equals(this.type, form1099Int.type) && + Objects.equals(this.id, form1099Int.id) && Objects.equals(this.issuerId, form1099Int.issuerId) && Objects.equals(this.issuerReferenceId, form1099Int.issuerReferenceId) && Objects.equals(this.issuerTin, form1099Int.issuerTin) && Objects.equals(this.taxYear, form1099Int.taxYear) && - Objects.equals(this.federalEfile, form1099Int.federalEfile) && - Objects.equals(this.federalEfileStatus, form1099Int.federalEfileStatus) && - Objects.equals(this.stateEfile, form1099Int.stateEfile) && - Objects.equals(this.stateEfileStatus, form1099Int.stateEfileStatus) && - Objects.equals(this.postalMail, form1099Int.postalMail) && - Objects.equals(this.postalMailStatus, form1099Int.postalMailStatus) && - Objects.equals(this.tinMatch, form1099Int.tinMatch) && - Objects.equals(this.tinMatchStatus, form1099Int.tinMatchStatus) && - Objects.equals(this.addressVerification, form1099Int.addressVerification) && - Objects.equals(this.addressVerificationStatus, form1099Int.addressVerificationStatus) && - Objects.equals(this.eDeliveryStatus, form1099Int.eDeliveryStatus) && Objects.equals(this.referenceId, form1099Int.referenceId) && - Objects.equals(this.email, form1099Int.email) && - Objects.equals(this.tinType, form1099Int.tinType) && - Objects.equals(this.fatcaFilingRequirement, form1099Int.fatcaFilingRequirement) && Objects.equals(this.tin, form1099Int.tin) && - Objects.equals(this.noTin, form1099Int.noTin) && - Objects.equals(this.secondTinNotice, form1099Int.secondTinNotice) && Objects.equals(this.recipientName, form1099Int.recipientName) && + Objects.equals(this.tinType, form1099Int.tinType) && Objects.equals(this.recipientSecondName, form1099Int.recipientSecondName) && Objects.equals(this.address, form1099Int.address) && Objects.equals(this.address2, form1099Int.address2) && Objects.equals(this.city, form1099Int.city) && Objects.equals(this.state, form1099Int.state) && Objects.equals(this.zip, form1099Int.zip) && - Objects.equals(this.nonUsProvince, form1099Int.nonUsProvince) && - Objects.equals(this.countryCode, form1099Int.countryCode) && + Objects.equals(this.email, form1099Int.email) && Objects.equals(this.accountNumber, form1099Int.accountNumber) && Objects.equals(this.officeCode, form1099Int.officeCode) && + Objects.equals(this.nonUsProvince, form1099Int.nonUsProvince) && + Objects.equals(this.countryCode, form1099Int.countryCode) && + Objects.equals(this.federalEfileDate, form1099Int.federalEfileDate) && + Objects.equals(this.postalMail, form1099Int.postalMail) && + Objects.equals(this.stateEfileDate, form1099Int.stateEfileDate) && + Objects.equals(this.recipientEdeliveryDate, form1099Int.recipientEdeliveryDate) && + Objects.equals(this.tinMatch, form1099Int.tinMatch) && + Objects.equals(this.noTin, form1099Int.noTin) && + Objects.equals(this.addressVerification, form1099Int.addressVerification) && + Objects.equals(this.stateAndLocalWithholding, form1099Int.stateAndLocalWithholding) && + Objects.equals(this.secondTinNotice, form1099Int.secondTinNotice) && + Objects.equals(this.federalEfileStatus, form1099Int.federalEfileStatus) && + Objects.equals(this.stateEfileStatus, form1099Int.stateEfileStatus) && + Objects.equals(this.postalMailStatus, form1099Int.postalMailStatus) && + Objects.equals(this.tinMatchStatus, form1099Int.tinMatchStatus) && + Objects.equals(this.addressVerificationStatus, form1099Int.addressVerificationStatus) && + Objects.equals(this.eDeliveryStatus, form1099Int.eDeliveryStatus) && Objects.equals(this.validationErrors, form1099Int.validationErrors) && Objects.equals(this.createdAt, form1099Int.createdAt) && - Objects.equals(this.updatedAt, form1099Int.updatedAt) && - Objects.equals(this.stateAndLocalWithholding, form1099Int.stateAndLocalWithholding); + Objects.equals(this.updatedAt, form1099Int.updatedAt); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -1374,7 +1452,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(interestIncome, earlyWithdrawalPenalty, usSavingsBondsInterest, federalIncomeTaxWithheld, investmentExpenses, foreignTaxPaid, foreignCountry, taxExemptInterest, specifiedPrivateActivityBondInterest, marketDiscount, bondPremium, bondPremiumOnTreasuryObligations, bondPremiumOnTaxExemptBond, taxExemptBondCusipNumber, id, type, issuerId, issuerReferenceId, issuerTin, taxYear, federalEfile, federalEfileStatus, stateEfile, stateEfileStatus, postalMail, postalMailStatus, tinMatch, tinMatchStatus, addressVerification, addressVerificationStatus, eDeliveryStatus, referenceId, email, tinType, fatcaFilingRequirement, tin, noTin, secondTinNotice, recipientName, recipientSecondName, address, address2, city, state, zip, nonUsProvince, countryCode, accountNumber, officeCode, validationErrors, createdAt, updatedAt, stateAndLocalWithholding); + return Objects.hash(interestIncome, earlyWithdrawalPenalty, usSavingsBondsInterest, federalIncomeTaxWithheld, investmentExpenses, foreignTaxPaid, foreignCountry, taxExemptInterest, specifiedPrivateActivityBondInterest, marketDiscount, bondPremium, bondPremiumOnTreasuryObligations, bondPremiumOnTaxExemptBond, taxExemptBondCusipNumber, fatcaFilingRequirement, type, id, issuerId, issuerReferenceId, issuerTin, taxYear, referenceId, tin, recipientName, tinType, recipientSecondName, address, address2, city, state, zip, email, accountNumber, officeCode, nonUsProvince, countryCode, federalEfileDate, postalMail, stateEfileDate, recipientEdeliveryDate, tinMatch, noTin, addressVerification, stateAndLocalWithholding, secondTinNotice, federalEfileStatus, stateEfileStatus, postalMailStatus, tinMatchStatus, addressVerificationStatus, eDeliveryStatus, validationErrors, createdAt, updatedAt); } private static int hashCodeNullable(JsonNullable a) { @@ -1402,45 +1480,46 @@ public String toString() { sb.append(" bondPremiumOnTreasuryObligations: ").append(toIndentedString(bondPremiumOnTreasuryObligations)).append("\n"); sb.append(" bondPremiumOnTaxExemptBond: ").append(toIndentedString(bondPremiumOnTaxExemptBond)).append("\n"); sb.append(" taxExemptBondCusipNumber: ").append(toIndentedString(taxExemptBondCusipNumber)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" fatcaFilingRequirement: ").append(toIndentedString(fatcaFilingRequirement)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" issuerId: ").append(toIndentedString(issuerId)).append("\n"); sb.append(" issuerReferenceId: ").append(toIndentedString(issuerReferenceId)).append("\n"); sb.append(" issuerTin: ").append(toIndentedString(issuerTin)).append("\n"); sb.append(" taxYear: ").append(toIndentedString(taxYear)).append("\n"); - sb.append(" federalEfile: ").append(toIndentedString(federalEfile)).append("\n"); - sb.append(" federalEfileStatus: ").append(toIndentedString(federalEfileStatus)).append("\n"); - sb.append(" stateEfile: ").append(toIndentedString(stateEfile)).append("\n"); - sb.append(" stateEfileStatus: ").append(toIndentedString(stateEfileStatus)).append("\n"); - sb.append(" postalMail: ").append(toIndentedString(postalMail)).append("\n"); - sb.append(" postalMailStatus: ").append(toIndentedString(postalMailStatus)).append("\n"); - sb.append(" tinMatch: ").append(toIndentedString(tinMatch)).append("\n"); - sb.append(" tinMatchStatus: ").append(toIndentedString(tinMatchStatus)).append("\n"); - sb.append(" addressVerification: ").append(toIndentedString(addressVerification)).append("\n"); - sb.append(" addressVerificationStatus: ").append(toIndentedString(addressVerificationStatus)).append("\n"); - sb.append(" eDeliveryStatus: ").append(toIndentedString(eDeliveryStatus)).append("\n"); sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" tinType: ").append(toIndentedString(tinType)).append("\n"); - sb.append(" fatcaFilingRequirement: ").append(toIndentedString(fatcaFilingRequirement)).append("\n"); sb.append(" tin: ").append(toIndentedString(tin)).append("\n"); - sb.append(" noTin: ").append(toIndentedString(noTin)).append("\n"); - sb.append(" secondTinNotice: ").append(toIndentedString(secondTinNotice)).append("\n"); sb.append(" recipientName: ").append(toIndentedString(recipientName)).append("\n"); + sb.append(" tinType: ").append(toIndentedString(tinType)).append("\n"); sb.append(" recipientSecondName: ").append(toIndentedString(recipientSecondName)).append("\n"); sb.append(" address: ").append(toIndentedString(address)).append("\n"); sb.append(" address2: ").append(toIndentedString(address2)).append("\n"); sb.append(" city: ").append(toIndentedString(city)).append("\n"); sb.append(" state: ").append(toIndentedString(state)).append("\n"); sb.append(" zip: ").append(toIndentedString(zip)).append("\n"); - sb.append(" nonUsProvince: ").append(toIndentedString(nonUsProvince)).append("\n"); - sb.append(" countryCode: ").append(toIndentedString(countryCode)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); sb.append(" officeCode: ").append(toIndentedString(officeCode)).append("\n"); + sb.append(" nonUsProvince: ").append(toIndentedString(nonUsProvince)).append("\n"); + sb.append(" countryCode: ").append(toIndentedString(countryCode)).append("\n"); + sb.append(" federalEfileDate: ").append(toIndentedString(federalEfileDate)).append("\n"); + sb.append(" postalMail: ").append(toIndentedString(postalMail)).append("\n"); + sb.append(" stateEfileDate: ").append(toIndentedString(stateEfileDate)).append("\n"); + sb.append(" recipientEdeliveryDate: ").append(toIndentedString(recipientEdeliveryDate)).append("\n"); + sb.append(" tinMatch: ").append(toIndentedString(tinMatch)).append("\n"); + sb.append(" noTin: ").append(toIndentedString(noTin)).append("\n"); + sb.append(" addressVerification: ").append(toIndentedString(addressVerification)).append("\n"); + sb.append(" stateAndLocalWithholding: ").append(toIndentedString(stateAndLocalWithholding)).append("\n"); + sb.append(" secondTinNotice: ").append(toIndentedString(secondTinNotice)).append("\n"); + sb.append(" federalEfileStatus: ").append(toIndentedString(federalEfileStatus)).append("\n"); + sb.append(" stateEfileStatus: ").append(toIndentedString(stateEfileStatus)).append("\n"); + sb.append(" postalMailStatus: ").append(toIndentedString(postalMailStatus)).append("\n"); + sb.append(" tinMatchStatus: ").append(toIndentedString(tinMatchStatus)).append("\n"); + sb.append(" addressVerificationStatus: ").append(toIndentedString(addressVerificationStatus)).append("\n"); + sb.append(" eDeliveryStatus: ").append(toIndentedString(eDeliveryStatus)).append("\n"); sb.append(" validationErrors: ").append(toIndentedString(validationErrors)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append(" stateAndLocalWithholding: ").append(toIndentedString(stateAndLocalWithholding)).append("\n"); sb.append("}"); return sb.toString(); } @@ -1463,48 +1542,53 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("id"); openapiFields.add("type"); + openapiFields.add("id"); openapiFields.add("issuerId"); openapiFields.add("issuerReferenceId"); openapiFields.add("issuerTin"); openapiFields.add("taxYear"); - openapiFields.add("federalEfile"); - openapiFields.add("federalEfileStatus"); - openapiFields.add("stateEfile"); - openapiFields.add("stateEfileStatus"); - openapiFields.add("postalMail"); - openapiFields.add("postalMailStatus"); - openapiFields.add("tinMatch"); - openapiFields.add("tinMatchStatus"); - openapiFields.add("addressVerification"); - openapiFields.add("addressVerificationStatus"); - openapiFields.add("eDeliveryStatus"); openapiFields.add("referenceId"); - openapiFields.add("email"); - openapiFields.add("tinType"); - openapiFields.add("fatcaFilingRequirement"); openapiFields.add("tin"); - openapiFields.add("noTin"); - openapiFields.add("secondTinNotice"); openapiFields.add("recipientName"); + openapiFields.add("tinType"); openapiFields.add("recipientSecondName"); openapiFields.add("address"); openapiFields.add("address2"); openapiFields.add("city"); openapiFields.add("state"); openapiFields.add("zip"); - openapiFields.add("nonUsProvince"); - openapiFields.add("countryCode"); + openapiFields.add("email"); openapiFields.add("accountNumber"); openapiFields.add("officeCode"); + openapiFields.add("nonUsProvince"); + openapiFields.add("countryCode"); + openapiFields.add("federalEfileDate"); + openapiFields.add("postalMail"); + openapiFields.add("stateEfileDate"); + openapiFields.add("recipientEdeliveryDate"); + openapiFields.add("tinMatch"); + openapiFields.add("noTin"); + openapiFields.add("addressVerification"); + openapiFields.add("stateAndLocalWithholding"); + openapiFields.add("secondTinNotice"); + openapiFields.add("federalEfileStatus"); + openapiFields.add("stateEfileStatus"); + openapiFields.add("postalMailStatus"); + openapiFields.add("tinMatchStatus"); + openapiFields.add("addressVerificationStatus"); + openapiFields.add("eDeliveryStatus"); openapiFields.add("validationErrors"); openapiFields.add("createdAt"); openapiFields.add("updatedAt"); - openapiFields.add("stateAndLocalWithholding"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("recipientName"); + openapiRequiredFields.add("address"); + openapiRequiredFields.add("city"); + openapiRequiredFields.add("countryCode"); } /** @@ -1527,6 +1611,13 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Form1099Int` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Form1099Int.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("foreignCountry") != null && !jsonObj.get("foreignCountry").isJsonNull()) && !jsonObj.get("foreignCountry").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `foreignCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("foreignCountry").toString())); @@ -1534,11 +1625,16 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("taxExemptBondCusipNumber") != null && !jsonObj.get("taxExemptBondCusipNumber").isJsonNull()) && !jsonObj.get("taxExemptBondCusipNumber").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `taxExemptBondCusipNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("taxExemptBondCusipNumber").toString())); } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); 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("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + if ((jsonObj.get("issuerId") != null && !jsonObj.get("issuerId").isJsonNull()) && !jsonObj.get("issuerId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `issuerId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerId").toString())); } if ((jsonObj.get("issuerReferenceId") != null && !jsonObj.get("issuerReferenceId").isJsonNull()) && !jsonObj.get("issuerReferenceId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `issuerReferenceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerReferenceId").toString())); @@ -1546,55 +1642,22 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("issuerTin") != null && !jsonObj.get("issuerTin").isJsonNull()) && !jsonObj.get("issuerTin").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `issuerTin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerTin").toString())); } - // validate the optional field `federalEfileStatus` - if (jsonObj.get("federalEfileStatus") != null && !jsonObj.get("federalEfileStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("federalEfileStatus")); - } - if (jsonObj.get("stateEfileStatus") != null && !jsonObj.get("stateEfileStatus").isJsonNull()) { - JsonArray jsonArraystateEfileStatus = jsonObj.getAsJsonArray("stateEfileStatus"); - if (jsonArraystateEfileStatus != null) { - // ensure the json data is an array - if (!jsonObj.get("stateEfileStatus").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `stateEfileStatus` to be an array in the JSON string but got `%s`", jsonObj.get("stateEfileStatus").toString())); - } - - // validate the optional field `stateEfileStatus` (array) - for (int i = 0; i < jsonArraystateEfileStatus.size(); i++) { - StateEfileStatusDetail.validateJsonElement(jsonArraystateEfileStatus.get(i)); - }; - } - } - // validate the optional field `postalMailStatus` - if (jsonObj.get("postalMailStatus") != null && !jsonObj.get("postalMailStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("postalMailStatus")); - } - // validate the optional field `tinMatchStatus` - if (jsonObj.get("tinMatchStatus") != null && !jsonObj.get("tinMatchStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("tinMatchStatus")); - } - // validate the optional field `addressVerificationStatus` - if (jsonObj.get("addressVerificationStatus") != null && !jsonObj.get("addressVerificationStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("addressVerificationStatus")); - } - // validate the optional field `eDeliveryStatus` - if (jsonObj.get("eDeliveryStatus") != null && !jsonObj.get("eDeliveryStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("eDeliveryStatus")); - } if ((jsonObj.get("referenceId") != null && !jsonObj.get("referenceId").isJsonNull()) && !jsonObj.get("referenceId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `referenceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("referenceId").toString())); } - if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); - } - if ((jsonObj.get("tinType") != null && !jsonObj.get("tinType").isJsonNull()) && !jsonObj.get("tinType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `tinType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tinType").toString())); - } if ((jsonObj.get("tin") != null && !jsonObj.get("tin").isJsonNull()) && !jsonObj.get("tin").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `tin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tin").toString())); } if ((jsonObj.get("recipientName") != null && !jsonObj.get("recipientName").isJsonNull()) && !jsonObj.get("recipientName").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `recipientName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientName").toString())); } + if ((jsonObj.get("tinType") != null && !jsonObj.get("tinType").isJsonNull()) && !jsonObj.get("tinType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `tinType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tinType").toString())); + } + // validate the optional field `tinType` + if (jsonObj.get("tinType") != null && !jsonObj.get("tinType").isJsonNull()) { + TinTypeEnum.validateJsonElement(jsonObj.get("tinType")); + } if ((jsonObj.get("recipientSecondName") != null && !jsonObj.get("recipientSecondName").isJsonNull()) && !jsonObj.get("recipientSecondName").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `recipientSecondName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientSecondName").toString())); } @@ -1613,17 +1676,58 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("zip") != null && !jsonObj.get("zip").isJsonNull()) && !jsonObj.get("zip").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `zip` to be a primitive type in the JSON string but got `%s`", jsonObj.get("zip").toString())); } + if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if ((jsonObj.get("accountNumber") != null && !jsonObj.get("accountNumber").isJsonNull()) && !jsonObj.get("accountNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); + } + if ((jsonObj.get("officeCode") != null && !jsonObj.get("officeCode").isJsonNull()) && !jsonObj.get("officeCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `officeCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("officeCode").toString())); + } if ((jsonObj.get("nonUsProvince") != null && !jsonObj.get("nonUsProvince").isJsonNull()) && !jsonObj.get("nonUsProvince").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `nonUsProvince` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nonUsProvince").toString())); } if ((jsonObj.get("countryCode") != null && !jsonObj.get("countryCode").isJsonNull()) && !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("accountNumber") != null && !jsonObj.get("accountNumber").isJsonNull()) && !jsonObj.get("accountNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); + // validate the optional field `stateAndLocalWithholding` + if (jsonObj.get("stateAndLocalWithholding") != null && !jsonObj.get("stateAndLocalWithholding").isJsonNull()) { + StateAndLocalWithholding.validateJsonElement(jsonObj.get("stateAndLocalWithholding")); } - if ((jsonObj.get("officeCode") != null && !jsonObj.get("officeCode").isJsonNull()) && !jsonObj.get("officeCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `officeCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("officeCode").toString())); + // validate the optional field `federalEfileStatus` + if (jsonObj.get("federalEfileStatus") != null && !jsonObj.get("federalEfileStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("federalEfileStatus")); + } + if (jsonObj.get("stateEfileStatus") != null && !jsonObj.get("stateEfileStatus").isJsonNull()) { + JsonArray jsonArraystateEfileStatus = jsonObj.getAsJsonArray("stateEfileStatus"); + if (jsonArraystateEfileStatus != null) { + // ensure the json data is an array + if (!jsonObj.get("stateEfileStatus").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `stateEfileStatus` to be an array in the JSON string but got `%s`", jsonObj.get("stateEfileStatus").toString())); + } + + // validate the optional field `stateEfileStatus` (array) + for (int i = 0; i < jsonArraystateEfileStatus.size(); i++) { + StateEfileStatusDetail.validateJsonElement(jsonArraystateEfileStatus.get(i)); + }; + } + } + // validate the optional field `postalMailStatus` + if (jsonObj.get("postalMailStatus") != null && !jsonObj.get("postalMailStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("postalMailStatus")); + } + // validate the optional field `tinMatchStatus` + if (jsonObj.get("tinMatchStatus") != null && !jsonObj.get("tinMatchStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("tinMatchStatus")); + } + // validate the optional field `addressVerificationStatus` + if (jsonObj.get("addressVerificationStatus") != null && !jsonObj.get("addressVerificationStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("addressVerificationStatus")); + } + // validate the optional field `eDeliveryStatus` + if (jsonObj.get("eDeliveryStatus") != null && !jsonObj.get("eDeliveryStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("eDeliveryStatus")); } if (jsonObj.get("validationErrors") != null && !jsonObj.get("validationErrors").isJsonNull()) { JsonArray jsonArrayvalidationErrors = jsonObj.getAsJsonArray("validationErrors"); @@ -1639,10 +1743,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti }; } } - // validate the optional field `stateAndLocalWithholding` - if (jsonObj.get("stateAndLocalWithholding") != null && !jsonObj.get("stateAndLocalWithholding").isJsonNull()) { - StateAndLocalWithholding.validateJsonElement(jsonObj.get("stateAndLocalWithholding")); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/Form1099K.java b/src/main/java/Avalara/SDK/model/A1099/V2/Form1099K.java index 954679f..04b891b 100644 --- a/src/main/java/Avalara/SDK/model/A1099/V2/Form1099K.java +++ b/src/main/java/Avalara/SDK/model/A1099/V2/Form1099K.java @@ -30,6 +30,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.Arrays; @@ -61,12 +62,12 @@ import Avalara.SDK.JSON; /** - * Form1099K + * Form 1099-K: Payment Card and Third Party Network Transactions */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class Form1099K { /** - * Gets or Sets filerType + * Filer type (PSE or EPF) */ @JsonAdapter(FilerTypeEnum.Adapter.class) public enum FilerTypeEnum { @@ -97,7 +98,7 @@ public static FilerTypeEnum fromValue(String value) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + return null; } public static class Adapter extends TypeAdapter { @@ -124,7 +125,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti private FilerTypeEnum filerType; /** - * Gets or Sets paymentType + * Payment type (payment card or third party network) */ @JsonAdapter(PaymentTypeEnum.Adapter.class) public enum PaymentTypeEnum { @@ -153,7 +154,7 @@ public static PaymentTypeEnum fromValue(String value) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + return null; } public static class Adapter extends TypeAdapter { @@ -235,9 +236,9 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @SerializedName(SERIALIZED_NAME_AUGUST) private Double august; - public static final String SERIALIZED_NAME_SEPT = "sept"; - @SerializedName(SERIALIZED_NAME_SEPT) - private Double sept; + public static final String SERIALIZED_NAME_SEPTEMBER = "september"; + @SerializedName(SERIALIZED_NAME_SEPTEMBER) + private Double september; public static final String SERIALIZED_NAME_OCTOBER = "october"; @SerializedName(SERIALIZED_NAME_OCTOBER) @@ -251,17 +252,83 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @SerializedName(SERIALIZED_NAME_DECEMBER) private Double december; - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; + /** + * Form type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + _1099_NEC("1099-NEC"), + + _1099_MISC("1099-MISC"), + + _1099_DIV("1099-DIV"), + + _1099_R("1099-R"), + + _1099_K("1099-K"), + + _1095_B("1095-B"), + + _1042_S("1042-S"), + + _1095_C("1095-C"), + + _1099_INT("1099-INT"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.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 TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) - private String type; + private TypeEnum type; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; public static final String SERIALIZED_NAME_ISSUER_ID = "issuerId"; @SerializedName(SERIALIZED_NAME_ISSUER_ID) - private Integer issuerId; + private String issuerId; public static final String SERIALIZED_NAME_ISSUER_REFERENCE_ID = "issuerReferenceId"; @SerializedName(SERIALIZED_NAME_ISSUER_REFERENCE_ID) @@ -275,81 +342,79 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @SerializedName(SERIALIZED_NAME_TAX_YEAR) private Integer taxYear; - public static final String SERIALIZED_NAME_FEDERAL_EFILE = "federalEfile"; - @SerializedName(SERIALIZED_NAME_FEDERAL_EFILE) - private Boolean federalEfile; - - public static final String SERIALIZED_NAME_FEDERAL_EFILE_STATUS = "federalEfileStatus"; - @SerializedName(SERIALIZED_NAME_FEDERAL_EFILE_STATUS) - private Form1099StatusDetail federalEfileStatus; + public static final String SERIALIZED_NAME_REFERENCE_ID = "referenceId"; + @SerializedName(SERIALIZED_NAME_REFERENCE_ID) + private String referenceId; - public static final String SERIALIZED_NAME_STATE_EFILE = "stateEfile"; - @SerializedName(SERIALIZED_NAME_STATE_EFILE) - private Boolean stateEfile; + public static final String SERIALIZED_NAME_TIN = "tin"; + @SerializedName(SERIALIZED_NAME_TIN) + private String tin; - public static final String SERIALIZED_NAME_STATE_EFILE_STATUS = "stateEfileStatus"; - @SerializedName(SERIALIZED_NAME_STATE_EFILE_STATUS) - private List stateEfileStatus; + public static final String SERIALIZED_NAME_RECIPIENT_NAME = "recipientName"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_NAME) + private String recipientName; - public static final String SERIALIZED_NAME_POSTAL_MAIL = "postalMail"; - @SerializedName(SERIALIZED_NAME_POSTAL_MAIL) - private Boolean postalMail; + /** + * Type of TIN (Tax ID Number) + */ + @JsonAdapter(TinTypeEnum.Adapter.class) + public enum TinTypeEnum { + EMPTY("Empty"), + + EIN("EIN"), + + SSN("SSN"), + + ITIN("ITIN"), + + ATIN("ATIN"); - public static final String SERIALIZED_NAME_POSTAL_MAIL_STATUS = "postalMailStatus"; - @SerializedName(SERIALIZED_NAME_POSTAL_MAIL_STATUS) - private Form1099StatusDetail postalMailStatus; + private String value; - public static final String SERIALIZED_NAME_TIN_MATCH = "tinMatch"; - @SerializedName(SERIALIZED_NAME_TIN_MATCH) - private Boolean tinMatch; + TinTypeEnum(String value) { + this.value = value; + } - public static final String SERIALIZED_NAME_TIN_MATCH_STATUS = "tinMatchStatus"; - @SerializedName(SERIALIZED_NAME_TIN_MATCH_STATUS) - private Form1099StatusDetail tinMatchStatus; + public String getValue() { + return value; + } - public static final String SERIALIZED_NAME_ADDRESS_VERIFICATION = "addressVerification"; - @SerializedName(SERIALIZED_NAME_ADDRESS_VERIFICATION) - private Boolean addressVerification; + @Override + public String toString() { + return String.valueOf(value); + } - public static final String SERIALIZED_NAME_ADDRESS_VERIFICATION_STATUS = "addressVerificationStatus"; - @SerializedName(SERIALIZED_NAME_ADDRESS_VERIFICATION_STATUS) - private Form1099StatusDetail addressVerificationStatus; + public static TinTypeEnum fromValue(String value) { + for (TinTypeEnum b : TinTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } - public static final String SERIALIZED_NAME_E_DELIVERY_STATUS = "eDeliveryStatus"; - @SerializedName(SERIALIZED_NAME_E_DELIVERY_STATUS) - private Form1099StatusDetail eDeliveryStatus; + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TinTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } - public static final String SERIALIZED_NAME_REFERENCE_ID = "referenceId"; - @SerializedName(SERIALIZED_NAME_REFERENCE_ID) - private String referenceId; + @Override + public TinTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TinTypeEnum.fromValue(value); + } + } - public static final String SERIALIZED_NAME_EMAIL = "email"; - @SerializedName(SERIALIZED_NAME_EMAIL) - private String email; + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TinTypeEnum.fromValue(value); + } + } public static final String SERIALIZED_NAME_TIN_TYPE = "tinType"; @SerializedName(SERIALIZED_NAME_TIN_TYPE) - private String tinType; - - public static final String SERIALIZED_NAME_FATCA_FILING_REQUIREMENT = "fatcaFilingRequirement"; - @SerializedName(SERIALIZED_NAME_FATCA_FILING_REQUIREMENT) - private Boolean fatcaFilingRequirement; - - public static final String SERIALIZED_NAME_TIN = "tin"; - @SerializedName(SERIALIZED_NAME_TIN) - private String tin; - - public static final String SERIALIZED_NAME_NO_TIN = "noTin"; - @SerializedName(SERIALIZED_NAME_NO_TIN) - private Boolean noTin; - - public static final String SERIALIZED_NAME_SECOND_TIN_NOTICE = "secondTinNotice"; - @SerializedName(SERIALIZED_NAME_SECOND_TIN_NOTICE) - private Boolean secondTinNotice; - - public static final String SERIALIZED_NAME_RECIPIENT_NAME = "recipientName"; - @SerializedName(SERIALIZED_NAME_RECIPIENT_NAME) - private String recipientName; + private TinTypeEnum tinType; public static final String SERIALIZED_NAME_RECIPIENT_SECOND_NAME = "recipientSecondName"; @SerializedName(SERIALIZED_NAME_RECIPIENT_SECOND_NAME) @@ -375,6 +440,18 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @SerializedName(SERIALIZED_NAME_ZIP) private String zip; + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) + private String accountNumber; + + public static final String SERIALIZED_NAME_OFFICE_CODE = "officeCode"; + @SerializedName(SERIALIZED_NAME_OFFICE_CODE) + private String officeCode; + public static final String SERIALIZED_NAME_NON_US_PROVINCE = "nonUsProvince"; @SerializedName(SERIALIZED_NAME_NON_US_PROVINCE) private String nonUsProvince; @@ -383,13 +460,65 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @SerializedName(SERIALIZED_NAME_COUNTRY_CODE) private String countryCode; - public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; - @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) - private String accountNumber; + public static final String SERIALIZED_NAME_FEDERAL_EFILE_DATE = "federalEfileDate"; + @SerializedName(SERIALIZED_NAME_FEDERAL_EFILE_DATE) + private LocalDate federalEfileDate; - public static final String SERIALIZED_NAME_OFFICE_CODE = "officeCode"; - @SerializedName(SERIALIZED_NAME_OFFICE_CODE) - private String officeCode; + public static final String SERIALIZED_NAME_POSTAL_MAIL = "postalMail"; + @SerializedName(SERIALIZED_NAME_POSTAL_MAIL) + private Boolean postalMail; + + public static final String SERIALIZED_NAME_STATE_EFILE_DATE = "stateEfileDate"; + @SerializedName(SERIALIZED_NAME_STATE_EFILE_DATE) + private LocalDate stateEfileDate; + + public static final String SERIALIZED_NAME_RECIPIENT_EDELIVERY_DATE = "recipientEdeliveryDate"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_EDELIVERY_DATE) + private LocalDate recipientEdeliveryDate; + + public static final String SERIALIZED_NAME_TIN_MATCH = "tinMatch"; + @SerializedName(SERIALIZED_NAME_TIN_MATCH) + private Boolean tinMatch; + + public static final String SERIALIZED_NAME_NO_TIN = "noTin"; + @SerializedName(SERIALIZED_NAME_NO_TIN) + private Boolean noTin; + + public static final String SERIALIZED_NAME_ADDRESS_VERIFICATION = "addressVerification"; + @SerializedName(SERIALIZED_NAME_ADDRESS_VERIFICATION) + private Boolean addressVerification; + + public static final String SERIALIZED_NAME_STATE_AND_LOCAL_WITHHOLDING = "stateAndLocalWithholding"; + @SerializedName(SERIALIZED_NAME_STATE_AND_LOCAL_WITHHOLDING) + private StateAndLocalWithholding stateAndLocalWithholding; + + public static final String SERIALIZED_NAME_SECOND_TIN_NOTICE = "secondTinNotice"; + @SerializedName(SERIALIZED_NAME_SECOND_TIN_NOTICE) + private Boolean secondTinNotice; + + public static final String SERIALIZED_NAME_FEDERAL_EFILE_STATUS = "federalEfileStatus"; + @SerializedName(SERIALIZED_NAME_FEDERAL_EFILE_STATUS) + private Form1099StatusDetail federalEfileStatus; + + public static final String SERIALIZED_NAME_STATE_EFILE_STATUS = "stateEfileStatus"; + @SerializedName(SERIALIZED_NAME_STATE_EFILE_STATUS) + private List stateEfileStatus; + + public static final String SERIALIZED_NAME_POSTAL_MAIL_STATUS = "postalMailStatus"; + @SerializedName(SERIALIZED_NAME_POSTAL_MAIL_STATUS) + private Form1099StatusDetail postalMailStatus; + + public static final String SERIALIZED_NAME_TIN_MATCH_STATUS = "tinMatchStatus"; + @SerializedName(SERIALIZED_NAME_TIN_MATCH_STATUS) + private Form1099StatusDetail tinMatchStatus; + + public static final String SERIALIZED_NAME_ADDRESS_VERIFICATION_STATUS = "addressVerificationStatus"; + @SerializedName(SERIALIZED_NAME_ADDRESS_VERIFICATION_STATUS) + private Form1099StatusDetail addressVerificationStatus; + + public static final String SERIALIZED_NAME_E_DELIVERY_STATUS = "eDeliveryStatus"; + @SerializedName(SERIALIZED_NAME_E_DELIVERY_STATUS) + private Form1099StatusDetail eDeliveryStatus; public static final String SERIALIZED_NAME_VALIDATION_ERRORS = "validationErrors"; @SerializedName(SERIALIZED_NAME_VALIDATION_ERRORS) @@ -403,20 +532,41 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @SerializedName(SERIALIZED_NAME_UPDATED_AT) private OffsetDateTime updatedAt; - public static final String SERIALIZED_NAME_STATE_AND_LOCAL_WITHHOLDING = "stateAndLocalWithholding"; - @SerializedName(SERIALIZED_NAME_STATE_AND_LOCAL_WITHHOLDING) - private StateAndLocalWithholding stateAndLocalWithholding; - public Form1099K() { } + public Form1099K( + String id, + Form1099StatusDetail federalEfileStatus, + List stateEfileStatus, + Form1099StatusDetail postalMailStatus, + Form1099StatusDetail tinMatchStatus, + Form1099StatusDetail addressVerificationStatus, + Form1099StatusDetail eDeliveryStatus, + List validationErrors, + OffsetDateTime createdAt, + OffsetDateTime updatedAt + ) { + this(); + this.id = id; + this.federalEfileStatus = federalEfileStatus; + this.stateEfileStatus = stateEfileStatus; + this.postalMailStatus = postalMailStatus; + this.tinMatchStatus = tinMatchStatus; + this.addressVerificationStatus = addressVerificationStatus; + this.eDeliveryStatus = eDeliveryStatus; + this.validationErrors = validationErrors; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + public Form1099K filerType(FilerTypeEnum filerType) { this.filerType = filerType; return this; } /** - * Get filerType + * Filer type (PSE or EPF) * @return filerType */ @javax.annotation.Nullable @@ -435,7 +585,7 @@ public Form1099K paymentType(PaymentTypeEnum paymentType) { } /** - * Get paymentType + * Payment type (payment card or third party network) * @return paymentType */ @javax.annotation.Nullable @@ -454,7 +604,7 @@ public Form1099K paymentSettlementEntityNamePhoneNumber(String paymentSettlement } /** - * Get paymentSettlementEntityNamePhoneNumber + * Payment settlement entity name and phone number * @return paymentSettlementEntityNamePhoneNumber */ @javax.annotation.Nullable @@ -473,7 +623,7 @@ public Form1099K grossAmountPaymentCard(Double grossAmountPaymentCard) { } /** - * Get grossAmountPaymentCard + * Gross amount of payment card/third party network transactions * @return grossAmountPaymentCard */ @javax.annotation.Nullable @@ -492,7 +642,7 @@ public Form1099K cardNotPresentTransactions(Double cardNotPresentTransactions) { } /** - * Get cardNotPresentTransactions + * Card not present transactions * @return cardNotPresentTransactions */ @javax.annotation.Nullable @@ -511,7 +661,7 @@ public Form1099K merchantCategoryCode(String merchantCategoryCode) { } /** - * Get merchantCategoryCode + * Merchant category code * @return merchantCategoryCode */ @javax.annotation.Nullable @@ -530,7 +680,7 @@ public Form1099K paymentTransactionNumber(Double paymentTransactionNumber) { } /** - * Get paymentTransactionNumber + * Number of payment transactions * @return paymentTransactionNumber */ @javax.annotation.Nullable @@ -549,7 +699,7 @@ public Form1099K federalIncomeTaxWithheld(Double federalIncomeTaxWithheld) { } /** - * Get federalIncomeTaxWithheld + * Federal income tax withheld * @return federalIncomeTaxWithheld */ @javax.annotation.Nullable @@ -568,7 +718,7 @@ public Form1099K january(Double january) { } /** - * Get january + * January gross payments * @return january */ @javax.annotation.Nullable @@ -587,7 +737,7 @@ public Form1099K february(Double february) { } /** - * Get february + * February gross payments * @return february */ @javax.annotation.Nullable @@ -606,7 +756,7 @@ public Form1099K march(Double march) { } /** - * Get march + * March gross payments * @return march */ @javax.annotation.Nullable @@ -625,7 +775,7 @@ public Form1099K april(Double april) { } /** - * Get april + * April gross payments * @return april */ @javax.annotation.Nullable @@ -644,7 +794,7 @@ public Form1099K may(Double may) { } /** - * Get may + * May gross payments * @return may */ @javax.annotation.Nullable @@ -663,7 +813,7 @@ public Form1099K june(Double june) { } /** - * Get june + * June gross payments * @return june */ @javax.annotation.Nullable @@ -682,7 +832,7 @@ public Form1099K july(Double july) { } /** - * Get july + * July gross payments * @return july */ @javax.annotation.Nullable @@ -701,7 +851,7 @@ public Form1099K august(Double august) { } /** - * Get august + * August gross payments * @return august */ @javax.annotation.Nullable @@ -714,22 +864,22 @@ public void setAugust(Double august) { } - public Form1099K sept(Double sept) { - this.sept = sept; + public Form1099K september(Double september) { + this.september = september; return this; } /** - * Get sept - * @return sept + * September gross payments + * @return september */ @javax.annotation.Nullable - public Double getSept() { - return sept; + public Double getSeptember() { + return september; } - public void setSept(Double sept) { - this.sept = sept; + public void setSeptember(Double september) { + this.september = september; } @@ -739,7 +889,7 @@ public Form1099K october(Double october) { } /** - * Get october + * October gross payments * @return october */ @javax.annotation.Nullable @@ -758,7 +908,7 @@ public Form1099K november(Double november) { } /** - * Get november + * November gross payments * @return november */ @javax.annotation.Nullable @@ -777,7 +927,7 @@ public Form1099K december(Double december) { } /** - * Get december + * December gross payments * @return december */ @javax.annotation.Nullable @@ -790,59 +940,51 @@ public void setDecember(Double december) { } - public Form1099K id(String id) { - this.id = id; + public Form1099K type(TypeEnum type) { + this.type = type; return this; } /** - * Get id - * @return id + * Form type + * @return type */ - @javax.annotation.Nullable - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; } - - public Form1099K type(String type) { + public void setType(TypeEnum type) { this.type = type; - return this; } + /** - * Get type - * @return type + * Form ID. Unique identifier set when the record is created. + * @return id */ @javax.annotation.Nullable - public String getType() { - return type; + public String getId() { + return id; } - public void setType(String type) { - this.type = type; - } - public Form1099K issuerId(Integer issuerId) { + public Form1099K issuerId(String issuerId) { this.issuerId = issuerId; return this; } /** - * Get issuerId + * Issuer ID - only required when creating forms * @return issuerId */ @javax.annotation.Nullable - public Integer getIssuerId() { + public String getIssuerId() { return issuerId; } - public void setIssuerId(Integer issuerId) { + public void setIssuerId(String issuerId) { this.issuerId = issuerId; } @@ -853,7 +995,7 @@ public Form1099K issuerReferenceId(String issuerReferenceId) { } /** - * Get issuerReferenceId + * Issuer Reference ID - only required when creating forms * @return issuerReferenceId */ @javax.annotation.Nullable @@ -872,7 +1014,7 @@ public Form1099K issuerTin(String issuerTin) { } /** - * Get issuerTin + * Issuer TIN - readonly * @return issuerTin */ @javax.annotation.Nullable @@ -891,7 +1033,7 @@ public Form1099K taxYear(Integer taxYear) { } /** - * Get taxYear + * Tax Year - only required when creating forms * @return taxYear */ @javax.annotation.Nullable @@ -904,580 +1046,530 @@ public void setTaxYear(Integer taxYear) { } - public Form1099K federalEfile(Boolean federalEfile) { - this.federalEfile = federalEfile; + public Form1099K referenceId(String referenceId) { + this.referenceId = referenceId; return this; } /** - * Get federalEfile - * @return federalEfile + * Internal reference ID. Never shown to any agency or recipient. + * @return referenceId */ @javax.annotation.Nullable - public Boolean getFederalEfile() { - return federalEfile; + public String getReferenceId() { + return referenceId; } - public void setFederalEfile(Boolean federalEfile) { - this.federalEfile = federalEfile; - } + public void setReferenceId(String referenceId) { + this.referenceId = referenceId; + } - public Form1099K federalEfileStatus(Form1099StatusDetail federalEfileStatus) { - this.federalEfileStatus = federalEfileStatus; + public Form1099K tin(String tin) { + this.tin = tin; return this; } /** - * Get federalEfileStatus - * @return federalEfileStatus + * Recipient's Federal Tax Identification Number (TIN). + * @return tin */ @javax.annotation.Nullable - public Form1099StatusDetail getFederalEfileStatus() { - return federalEfileStatus; + public String getTin() { + return tin; } - public void setFederalEfileStatus(Form1099StatusDetail federalEfileStatus) { - this.federalEfileStatus = federalEfileStatus; + public void setTin(String tin) { + this.tin = tin; } - public Form1099K stateEfile(Boolean stateEfile) { - this.stateEfile = stateEfile; + public Form1099K recipientName(String recipientName) { + this.recipientName = recipientName; return this; } /** - * Get stateEfile - * @return stateEfile + * Recipient name + * @return recipientName */ @javax.annotation.Nullable - public Boolean getStateEfile() { - return stateEfile; + public String getRecipientName() { + return recipientName; } - public void setStateEfile(Boolean stateEfile) { - this.stateEfile = stateEfile; + public void setRecipientName(String recipientName) { + this.recipientName = recipientName; } - public Form1099K stateEfileStatus(List stateEfileStatus) { - this.stateEfileStatus = stateEfileStatus; - return this; - } - - public Form1099K addStateEfileStatusItem(StateEfileStatusDetail stateEfileStatusItem) { - if (this.stateEfileStatus == null) { - this.stateEfileStatus = new ArrayList<>(); - } - this.stateEfileStatus.add(stateEfileStatusItem); + public Form1099K tinType(TinTypeEnum tinType) { + this.tinType = tinType; return this; } /** - * Get stateEfileStatus - * @return stateEfileStatus + * Type of TIN (Tax ID Number) + * @return tinType */ @javax.annotation.Nullable - public List getStateEfileStatus() { - return stateEfileStatus; + public TinTypeEnum getTinType() { + return tinType; } - public void setStateEfileStatus(List stateEfileStatus) { - this.stateEfileStatus = stateEfileStatus; + public void setTinType(TinTypeEnum tinType) { + this.tinType = tinType; } - public Form1099K postalMail(Boolean postalMail) { - this.postalMail = postalMail; + public Form1099K recipientSecondName(String recipientSecondName) { + this.recipientSecondName = recipientSecondName; return this; } /** - * Get postalMail - * @return postalMail + * Recipient second name + * @return recipientSecondName */ @javax.annotation.Nullable - public Boolean getPostalMail() { - return postalMail; + public String getRecipientSecondName() { + return recipientSecondName; } - public void setPostalMail(Boolean postalMail) { - this.postalMail = postalMail; + public void setRecipientSecondName(String recipientSecondName) { + this.recipientSecondName = recipientSecondName; } - public Form1099K postalMailStatus(Form1099StatusDetail postalMailStatus) { - this.postalMailStatus = postalMailStatus; + public Form1099K address(String address) { + this.address = address; return this; } /** - * Get postalMailStatus - * @return postalMailStatus + * Address. + * @return address */ @javax.annotation.Nullable - public Form1099StatusDetail getPostalMailStatus() { - return postalMailStatus; + public String getAddress() { + return address; } - public void setPostalMailStatus(Form1099StatusDetail postalMailStatus) { - this.postalMailStatus = postalMailStatus; + public void setAddress(String address) { + this.address = address; } - public Form1099K tinMatch(Boolean tinMatch) { - this.tinMatch = tinMatch; + public Form1099K address2(String address2) { + this.address2 = address2; return this; } /** - * Get tinMatch - * @return tinMatch + * Address line 2. + * @return address2 */ @javax.annotation.Nullable - public Boolean getTinMatch() { - return tinMatch; + public String getAddress2() { + return address2; } - public void setTinMatch(Boolean tinMatch) { - this.tinMatch = tinMatch; + public void setAddress2(String address2) { + this.address2 = address2; } - public Form1099K tinMatchStatus(Form1099StatusDetail tinMatchStatus) { - this.tinMatchStatus = tinMatchStatus; + public Form1099K city(String city) { + this.city = city; return this; } /** - * Get tinMatchStatus - * @return tinMatchStatus + * City. + * @return city */ @javax.annotation.Nullable - public Form1099StatusDetail getTinMatchStatus() { - return tinMatchStatus; + public String getCity() { + return city; } - public void setTinMatchStatus(Form1099StatusDetail tinMatchStatus) { - this.tinMatchStatus = tinMatchStatus; + public void setCity(String city) { + this.city = city; } - public Form1099K addressVerification(Boolean addressVerification) { - this.addressVerification = addressVerification; + public Form1099K state(String state) { + this.state = state; return this; } /** - * Get addressVerification - * @return addressVerification + * Two-letter US state or Canadian province code (required for US/CA addresses). + * @return state */ @javax.annotation.Nullable - public Boolean getAddressVerification() { - return addressVerification; + public String getState() { + return state; } - public void setAddressVerification(Boolean addressVerification) { - this.addressVerification = addressVerification; + public void setState(String state) { + this.state = state; } - public Form1099K addressVerificationStatus(Form1099StatusDetail addressVerificationStatus) { - this.addressVerificationStatus = addressVerificationStatus; + public Form1099K zip(String zip) { + this.zip = zip; return this; } /** - * Get addressVerificationStatus - * @return addressVerificationStatus + * ZIP/postal code. + * @return zip */ @javax.annotation.Nullable - public Form1099StatusDetail getAddressVerificationStatus() { - return addressVerificationStatus; + public String getZip() { + return zip; } - public void setAddressVerificationStatus(Form1099StatusDetail addressVerificationStatus) { - this.addressVerificationStatus = addressVerificationStatus; + public void setZip(String zip) { + this.zip = zip; } - public Form1099K eDeliveryStatus(Form1099StatusDetail eDeliveryStatus) { - this.eDeliveryStatus = eDeliveryStatus; + public Form1099K email(String email) { + this.email = email; return this; } /** - * Get eDeliveryStatus - * @return eDeliveryStatus + * Recipient's Contact email address. + * @return email */ @javax.annotation.Nullable - public Form1099StatusDetail geteDeliveryStatus() { - return eDeliveryStatus; + public String getEmail() { + return email; } - public void seteDeliveryStatus(Form1099StatusDetail eDeliveryStatus) { - this.eDeliveryStatus = eDeliveryStatus; + public void setEmail(String email) { + this.email = email; } - public Form1099K referenceId(String referenceId) { - this.referenceId = referenceId; + public Form1099K accountNumber(String accountNumber) { + this.accountNumber = accountNumber; return this; } /** - * Get referenceId - * @return referenceId + * Account number + * @return accountNumber */ @javax.annotation.Nullable - public String getReferenceId() { - return referenceId; + public String getAccountNumber() { + return accountNumber; } - public void setReferenceId(String referenceId) { - this.referenceId = referenceId; + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; } - public Form1099K email(String email) { - this.email = email; + public Form1099K officeCode(String officeCode) { + this.officeCode = officeCode; return this; } /** - * Get email - * @return email + * Office code + * @return officeCode */ @javax.annotation.Nullable - public String getEmail() { - return email; + public String getOfficeCode() { + return officeCode; } - public void setEmail(String email) { - this.email = email; + public void setOfficeCode(String officeCode) { + this.officeCode = officeCode; } - public Form1099K tinType(String tinType) { - this.tinType = tinType; + public Form1099K nonUsProvince(String nonUsProvince) { + this.nonUsProvince = nonUsProvince; return this; } /** - * Get tinType - * @return tinType + * Province or region for non-US/CA addresses. + * @return nonUsProvince */ @javax.annotation.Nullable - public String getTinType() { - return tinType; + public String getNonUsProvince() { + return nonUsProvince; } - public void setTinType(String tinType) { - this.tinType = tinType; + public void setNonUsProvince(String nonUsProvince) { + this.nonUsProvince = nonUsProvince; } - public Form1099K fatcaFilingRequirement(Boolean fatcaFilingRequirement) { - this.fatcaFilingRequirement = fatcaFilingRequirement; + public Form1099K countryCode(String countryCode) { + this.countryCode = countryCode; return this; } /** - * Get fatcaFilingRequirement - * @return fatcaFilingRequirement + * Two-letter IRS country code (e.g., 'US', 'CA'), as defined at https://www.irs.gov/e-file-providers/country-codes. + * @return countryCode */ @javax.annotation.Nullable - public Boolean getFatcaFilingRequirement() { - return fatcaFilingRequirement; + public String getCountryCode() { + return countryCode; } - public void setFatcaFilingRequirement(Boolean fatcaFilingRequirement) { - this.fatcaFilingRequirement = fatcaFilingRequirement; + public void setCountryCode(String countryCode) { + this.countryCode = countryCode; } - public Form1099K tin(String tin) { - this.tin = tin; + public Form1099K federalEfileDate(LocalDate federalEfileDate) { + this.federalEfileDate = federalEfileDate; return this; } /** - * Get tin - * @return tin + * Date when federal e-filing should be scheduled for this form + * @return federalEfileDate */ @javax.annotation.Nullable - public String getTin() { - return tin; + public LocalDate getFederalEfileDate() { + return federalEfileDate; } - public void setTin(String tin) { - this.tin = tin; + public void setFederalEfileDate(LocalDate federalEfileDate) { + this.federalEfileDate = federalEfileDate; } - public Form1099K noTin(Boolean noTin) { - this.noTin = noTin; + public Form1099K postalMail(Boolean postalMail) { + this.postalMail = postalMail; return this; } /** - * Get noTin - * @return noTin + * Boolean indicating that postal mailing to the recipient should be scheduled for this form + * @return postalMail */ @javax.annotation.Nullable - public Boolean getNoTin() { - return noTin; + public Boolean getPostalMail() { + return postalMail; } - public void setNoTin(Boolean noTin) { - this.noTin = noTin; + public void setPostalMail(Boolean postalMail) { + this.postalMail = postalMail; } - public Form1099K secondTinNotice(Boolean secondTinNotice) { - this.secondTinNotice = secondTinNotice; + public Form1099K stateEfileDate(LocalDate stateEfileDate) { + this.stateEfileDate = stateEfileDate; return this; } /** - * Get secondTinNotice - * @return secondTinNotice + * Date when state e-filing should be scheduled for this form + * @return stateEfileDate */ @javax.annotation.Nullable - public Boolean getSecondTinNotice() { - return secondTinNotice; + public LocalDate getStateEfileDate() { + return stateEfileDate; } - public void setSecondTinNotice(Boolean secondTinNotice) { - this.secondTinNotice = secondTinNotice; + public void setStateEfileDate(LocalDate stateEfileDate) { + this.stateEfileDate = stateEfileDate; } - public Form1099K recipientName(String recipientName) { - this.recipientName = recipientName; + public Form1099K recipientEdeliveryDate(LocalDate recipientEdeliveryDate) { + this.recipientEdeliveryDate = recipientEdeliveryDate; return this; } /** - * Get recipientName - * @return recipientName + * Date when recipient e-delivery should be scheduled for this form + * @return recipientEdeliveryDate */ @javax.annotation.Nullable - public String getRecipientName() { - return recipientName; + public LocalDate getRecipientEdeliveryDate() { + return recipientEdeliveryDate; } - public void setRecipientName(String recipientName) { - this.recipientName = recipientName; + public void setRecipientEdeliveryDate(LocalDate recipientEdeliveryDate) { + this.recipientEdeliveryDate = recipientEdeliveryDate; } - public Form1099K recipientSecondName(String recipientSecondName) { - this.recipientSecondName = recipientSecondName; + public Form1099K tinMatch(Boolean tinMatch) { + this.tinMatch = tinMatch; return this; } /** - * Get recipientSecondName - * @return recipientSecondName + * Boolean indicating that TIN Matching should be scheduled for this form + * @return tinMatch */ @javax.annotation.Nullable - public String getRecipientSecondName() { - return recipientSecondName; + public Boolean getTinMatch() { + return tinMatch; } - public void setRecipientSecondName(String recipientSecondName) { - this.recipientSecondName = recipientSecondName; + public void setTinMatch(Boolean tinMatch) { + this.tinMatch = tinMatch; } - public Form1099K address(String address) { - this.address = address; + public Form1099K noTin(Boolean noTin) { + this.noTin = noTin; return this; } /** - * Get address - * @return address + * No TIN indicator + * @return noTin */ @javax.annotation.Nullable - public String getAddress() { - return address; + public Boolean getNoTin() { + return noTin; } - public void setAddress(String address) { - this.address = address; + public void setNoTin(Boolean noTin) { + this.noTin = noTin; } - public Form1099K address2(String address2) { - this.address2 = address2; + public Form1099K addressVerification(Boolean addressVerification) { + this.addressVerification = addressVerification; return this; } /** - * Get address2 - * @return address2 + * Boolean indicating that address verification should be scheduled for this form + * @return addressVerification */ @javax.annotation.Nullable - public String getAddress2() { - return address2; + public Boolean getAddressVerification() { + return addressVerification; } - public void setAddress2(String address2) { - this.address2 = address2; + public void setAddressVerification(Boolean addressVerification) { + this.addressVerification = addressVerification; } - public Form1099K city(String city) { - this.city = city; + public Form1099K stateAndLocalWithholding(StateAndLocalWithholding stateAndLocalWithholding) { + this.stateAndLocalWithholding = stateAndLocalWithholding; return this; } /** - * Get city - * @return city + * State and local withholding information + * @return stateAndLocalWithholding */ @javax.annotation.Nullable - public String getCity() { - return city; + public StateAndLocalWithholding getStateAndLocalWithholding() { + return stateAndLocalWithholding; } - public void setCity(String city) { - this.city = city; + public void setStateAndLocalWithholding(StateAndLocalWithholding stateAndLocalWithholding) { + this.stateAndLocalWithholding = stateAndLocalWithholding; } - public Form1099K state(String state) { - this.state = state; + public Form1099K secondTinNotice(Boolean secondTinNotice) { + this.secondTinNotice = secondTinNotice; return this; } /** - * Get state - * @return state + * Second TIN notice + * @return secondTinNotice */ @javax.annotation.Nullable - public String getState() { - return state; + public Boolean getSecondTinNotice() { + return secondTinNotice; } - public void setState(String state) { - this.state = state; + public void setSecondTinNotice(Boolean secondTinNotice) { + this.secondTinNotice = secondTinNotice; } - public Form1099K zip(String zip) { - this.zip = zip; - return this; - } - /** - * Get zip - * @return zip + * Federal e-file status + * @return federalEfileStatus */ @javax.annotation.Nullable - public String getZip() { - return zip; - } - - public void setZip(String zip) { - this.zip = zip; + public Form1099StatusDetail getFederalEfileStatus() { + return federalEfileStatus; } - public Form1099K nonUsProvince(String nonUsProvince) { - this.nonUsProvince = nonUsProvince; - return this; - } /** - * Get nonUsProvince - * @return nonUsProvince + * State e-file status + * @return stateEfileStatus */ @javax.annotation.Nullable - public String getNonUsProvince() { - return nonUsProvince; + public List getStateEfileStatus() { + return stateEfileStatus; } - public void setNonUsProvince(String nonUsProvince) { - this.nonUsProvince = nonUsProvince; - } - public Form1099K countryCode(String countryCode) { - this.countryCode = countryCode; - return this; - } - /** - * Get countryCode - * @return countryCode + * Postal mail to recipient status + * @return postalMailStatus */ @javax.annotation.Nullable - public String getCountryCode() { - return countryCode; - } - - public void setCountryCode(String countryCode) { - this.countryCode = countryCode; + public Form1099StatusDetail getPostalMailStatus() { + return postalMailStatus; } - public Form1099K accountNumber(String accountNumber) { - this.accountNumber = accountNumber; - return this; - } /** - * Get accountNumber - * @return accountNumber + * TIN Match status + * @return tinMatchStatus */ @javax.annotation.Nullable - public String getAccountNumber() { - return accountNumber; - } - - public void setAccountNumber(String accountNumber) { - this.accountNumber = accountNumber; + public Form1099StatusDetail getTinMatchStatus() { + return tinMatchStatus; } - public Form1099K officeCode(String officeCode) { - this.officeCode = officeCode; - return this; - } /** - * Get officeCode - * @return officeCode + * Address verification status + * @return addressVerificationStatus */ @javax.annotation.Nullable - public String getOfficeCode() { - return officeCode; + public Form1099StatusDetail getAddressVerificationStatus() { + return addressVerificationStatus; } - public void setOfficeCode(String officeCode) { - this.officeCode = officeCode; - } - public Form1099K validationErrors(List validationErrors) { - this.validationErrors = validationErrors; - return this; + /** + * EDelivery status + * @return eDeliveryStatus + */ + @javax.annotation.Nullable + public Form1099StatusDetail geteDeliveryStatus() { + return eDeliveryStatus; } - public Form1099K addValidationErrorsItem(ValidationError validationErrorsItem) { - if (this.validationErrors == null) { - this.validationErrors = new ArrayList<>(); - } - this.validationErrors.add(validationErrorsItem); - return this; - } + /** - * Get validationErrors + * Validation errors * @return validationErrors */ @javax.annotation.Nullable @@ -1485,18 +1577,10 @@ public List getValidationErrors() { return validationErrors; } - public void setValidationErrors(List validationErrors) { - this.validationErrors = validationErrors; - } - - public Form1099K createdAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - return this; - } /** - * Get createdAt + * Date time when the record was created. * @return createdAt */ @javax.annotation.Nullable @@ -1504,18 +1588,10 @@ public OffsetDateTime getCreatedAt() { return createdAt; } - public void setCreatedAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - } - - public Form1099K updatedAt(OffsetDateTime updatedAt) { - this.updatedAt = updatedAt; - return this; - } /** - * Get updatedAt + * Date time when the record was last updated. * @return updatedAt */ @javax.annotation.Nullable @@ -1523,28 +1599,6 @@ public OffsetDateTime getUpdatedAt() { return updatedAt; } - public void setUpdatedAt(OffsetDateTime updatedAt) { - this.updatedAt = updatedAt; - } - - - public Form1099K stateAndLocalWithholding(StateAndLocalWithholding stateAndLocalWithholding) { - this.stateAndLocalWithholding = stateAndLocalWithholding; - return this; - } - - /** - * Get stateAndLocalWithholding - * @return stateAndLocalWithholding - */ - @javax.annotation.Nullable - public StateAndLocalWithholding getStateAndLocalWithholding() { - return stateAndLocalWithholding; - } - - public void setStateAndLocalWithholding(StateAndLocalWithholding stateAndLocalWithholding) { - this.stateAndLocalWithholding = stateAndLocalWithholding; - } @@ -1573,49 +1627,49 @@ public boolean equals(Object o) { Objects.equals(this.june, form1099K.june) && Objects.equals(this.july, form1099K.july) && Objects.equals(this.august, form1099K.august) && - Objects.equals(this.sept, form1099K.sept) && + Objects.equals(this.september, form1099K.september) && Objects.equals(this.october, form1099K.october) && Objects.equals(this.november, form1099K.november) && Objects.equals(this.december, form1099K.december) && - Objects.equals(this.id, form1099K.id) && Objects.equals(this.type, form1099K.type) && + Objects.equals(this.id, form1099K.id) && Objects.equals(this.issuerId, form1099K.issuerId) && Objects.equals(this.issuerReferenceId, form1099K.issuerReferenceId) && Objects.equals(this.issuerTin, form1099K.issuerTin) && Objects.equals(this.taxYear, form1099K.taxYear) && - Objects.equals(this.federalEfile, form1099K.federalEfile) && - Objects.equals(this.federalEfileStatus, form1099K.federalEfileStatus) && - Objects.equals(this.stateEfile, form1099K.stateEfile) && - Objects.equals(this.stateEfileStatus, form1099K.stateEfileStatus) && - Objects.equals(this.postalMail, form1099K.postalMail) && - Objects.equals(this.postalMailStatus, form1099K.postalMailStatus) && - Objects.equals(this.tinMatch, form1099K.tinMatch) && - Objects.equals(this.tinMatchStatus, form1099K.tinMatchStatus) && - Objects.equals(this.addressVerification, form1099K.addressVerification) && - Objects.equals(this.addressVerificationStatus, form1099K.addressVerificationStatus) && - Objects.equals(this.eDeliveryStatus, form1099K.eDeliveryStatus) && Objects.equals(this.referenceId, form1099K.referenceId) && - Objects.equals(this.email, form1099K.email) && - Objects.equals(this.tinType, form1099K.tinType) && - Objects.equals(this.fatcaFilingRequirement, form1099K.fatcaFilingRequirement) && Objects.equals(this.tin, form1099K.tin) && - Objects.equals(this.noTin, form1099K.noTin) && - Objects.equals(this.secondTinNotice, form1099K.secondTinNotice) && Objects.equals(this.recipientName, form1099K.recipientName) && + Objects.equals(this.tinType, form1099K.tinType) && Objects.equals(this.recipientSecondName, form1099K.recipientSecondName) && Objects.equals(this.address, form1099K.address) && Objects.equals(this.address2, form1099K.address2) && Objects.equals(this.city, form1099K.city) && Objects.equals(this.state, form1099K.state) && Objects.equals(this.zip, form1099K.zip) && - Objects.equals(this.nonUsProvince, form1099K.nonUsProvince) && - Objects.equals(this.countryCode, form1099K.countryCode) && + Objects.equals(this.email, form1099K.email) && Objects.equals(this.accountNumber, form1099K.accountNumber) && Objects.equals(this.officeCode, form1099K.officeCode) && + Objects.equals(this.nonUsProvince, form1099K.nonUsProvince) && + Objects.equals(this.countryCode, form1099K.countryCode) && + Objects.equals(this.federalEfileDate, form1099K.federalEfileDate) && + Objects.equals(this.postalMail, form1099K.postalMail) && + Objects.equals(this.stateEfileDate, form1099K.stateEfileDate) && + Objects.equals(this.recipientEdeliveryDate, form1099K.recipientEdeliveryDate) && + Objects.equals(this.tinMatch, form1099K.tinMatch) && + Objects.equals(this.noTin, form1099K.noTin) && + Objects.equals(this.addressVerification, form1099K.addressVerification) && + Objects.equals(this.stateAndLocalWithholding, form1099K.stateAndLocalWithholding) && + Objects.equals(this.secondTinNotice, form1099K.secondTinNotice) && + Objects.equals(this.federalEfileStatus, form1099K.federalEfileStatus) && + Objects.equals(this.stateEfileStatus, form1099K.stateEfileStatus) && + Objects.equals(this.postalMailStatus, form1099K.postalMailStatus) && + Objects.equals(this.tinMatchStatus, form1099K.tinMatchStatus) && + Objects.equals(this.addressVerificationStatus, form1099K.addressVerificationStatus) && + Objects.equals(this.eDeliveryStatus, form1099K.eDeliveryStatus) && Objects.equals(this.validationErrors, form1099K.validationErrors) && Objects.equals(this.createdAt, form1099K.createdAt) && - Objects.equals(this.updatedAt, form1099K.updatedAt) && - Objects.equals(this.stateAndLocalWithholding, form1099K.stateAndLocalWithholding); + Objects.equals(this.updatedAt, form1099K.updatedAt); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -1624,7 +1678,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(filerType, paymentType, paymentSettlementEntityNamePhoneNumber, grossAmountPaymentCard, cardNotPresentTransactions, merchantCategoryCode, paymentTransactionNumber, federalIncomeTaxWithheld, january, february, march, april, may, june, july, august, sept, october, november, december, id, type, issuerId, issuerReferenceId, issuerTin, taxYear, federalEfile, federalEfileStatus, stateEfile, stateEfileStatus, postalMail, postalMailStatus, tinMatch, tinMatchStatus, addressVerification, addressVerificationStatus, eDeliveryStatus, referenceId, email, tinType, fatcaFilingRequirement, tin, noTin, secondTinNotice, recipientName, recipientSecondName, address, address2, city, state, zip, nonUsProvince, countryCode, accountNumber, officeCode, validationErrors, createdAt, updatedAt, stateAndLocalWithholding); + return Objects.hash(filerType, paymentType, paymentSettlementEntityNamePhoneNumber, grossAmountPaymentCard, cardNotPresentTransactions, merchantCategoryCode, paymentTransactionNumber, federalIncomeTaxWithheld, january, february, march, april, may, june, july, august, september, october, november, december, type, id, issuerId, issuerReferenceId, issuerTin, taxYear, referenceId, tin, recipientName, tinType, recipientSecondName, address, address2, city, state, zip, email, accountNumber, officeCode, nonUsProvince, countryCode, federalEfileDate, postalMail, stateEfileDate, recipientEdeliveryDate, tinMatch, noTin, addressVerification, stateAndLocalWithholding, secondTinNotice, federalEfileStatus, stateEfileStatus, postalMailStatus, tinMatchStatus, addressVerificationStatus, eDeliveryStatus, validationErrors, createdAt, updatedAt); } private static int hashCodeNullable(JsonNullable a) { @@ -1654,49 +1708,49 @@ public String toString() { sb.append(" june: ").append(toIndentedString(june)).append("\n"); sb.append(" july: ").append(toIndentedString(july)).append("\n"); sb.append(" august: ").append(toIndentedString(august)).append("\n"); - sb.append(" sept: ").append(toIndentedString(sept)).append("\n"); + sb.append(" september: ").append(toIndentedString(september)).append("\n"); sb.append(" october: ").append(toIndentedString(october)).append("\n"); sb.append(" november: ").append(toIndentedString(november)).append("\n"); sb.append(" december: ").append(toIndentedString(december)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" issuerId: ").append(toIndentedString(issuerId)).append("\n"); sb.append(" issuerReferenceId: ").append(toIndentedString(issuerReferenceId)).append("\n"); sb.append(" issuerTin: ").append(toIndentedString(issuerTin)).append("\n"); sb.append(" taxYear: ").append(toIndentedString(taxYear)).append("\n"); - sb.append(" federalEfile: ").append(toIndentedString(federalEfile)).append("\n"); - sb.append(" federalEfileStatus: ").append(toIndentedString(federalEfileStatus)).append("\n"); - sb.append(" stateEfile: ").append(toIndentedString(stateEfile)).append("\n"); - sb.append(" stateEfileStatus: ").append(toIndentedString(stateEfileStatus)).append("\n"); - sb.append(" postalMail: ").append(toIndentedString(postalMail)).append("\n"); - sb.append(" postalMailStatus: ").append(toIndentedString(postalMailStatus)).append("\n"); - sb.append(" tinMatch: ").append(toIndentedString(tinMatch)).append("\n"); - sb.append(" tinMatchStatus: ").append(toIndentedString(tinMatchStatus)).append("\n"); - sb.append(" addressVerification: ").append(toIndentedString(addressVerification)).append("\n"); - sb.append(" addressVerificationStatus: ").append(toIndentedString(addressVerificationStatus)).append("\n"); - sb.append(" eDeliveryStatus: ").append(toIndentedString(eDeliveryStatus)).append("\n"); sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" tinType: ").append(toIndentedString(tinType)).append("\n"); - sb.append(" fatcaFilingRequirement: ").append(toIndentedString(fatcaFilingRequirement)).append("\n"); sb.append(" tin: ").append(toIndentedString(tin)).append("\n"); - sb.append(" noTin: ").append(toIndentedString(noTin)).append("\n"); - sb.append(" secondTinNotice: ").append(toIndentedString(secondTinNotice)).append("\n"); sb.append(" recipientName: ").append(toIndentedString(recipientName)).append("\n"); + sb.append(" tinType: ").append(toIndentedString(tinType)).append("\n"); sb.append(" recipientSecondName: ").append(toIndentedString(recipientSecondName)).append("\n"); sb.append(" address: ").append(toIndentedString(address)).append("\n"); sb.append(" address2: ").append(toIndentedString(address2)).append("\n"); sb.append(" city: ").append(toIndentedString(city)).append("\n"); sb.append(" state: ").append(toIndentedString(state)).append("\n"); sb.append(" zip: ").append(toIndentedString(zip)).append("\n"); - sb.append(" nonUsProvince: ").append(toIndentedString(nonUsProvince)).append("\n"); - sb.append(" countryCode: ").append(toIndentedString(countryCode)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); sb.append(" officeCode: ").append(toIndentedString(officeCode)).append("\n"); + sb.append(" nonUsProvince: ").append(toIndentedString(nonUsProvince)).append("\n"); + sb.append(" countryCode: ").append(toIndentedString(countryCode)).append("\n"); + sb.append(" federalEfileDate: ").append(toIndentedString(federalEfileDate)).append("\n"); + sb.append(" postalMail: ").append(toIndentedString(postalMail)).append("\n"); + sb.append(" stateEfileDate: ").append(toIndentedString(stateEfileDate)).append("\n"); + sb.append(" recipientEdeliveryDate: ").append(toIndentedString(recipientEdeliveryDate)).append("\n"); + sb.append(" tinMatch: ").append(toIndentedString(tinMatch)).append("\n"); + sb.append(" noTin: ").append(toIndentedString(noTin)).append("\n"); + sb.append(" addressVerification: ").append(toIndentedString(addressVerification)).append("\n"); + sb.append(" stateAndLocalWithholding: ").append(toIndentedString(stateAndLocalWithholding)).append("\n"); + sb.append(" secondTinNotice: ").append(toIndentedString(secondTinNotice)).append("\n"); + sb.append(" federalEfileStatus: ").append(toIndentedString(federalEfileStatus)).append("\n"); + sb.append(" stateEfileStatus: ").append(toIndentedString(stateEfileStatus)).append("\n"); + sb.append(" postalMailStatus: ").append(toIndentedString(postalMailStatus)).append("\n"); + sb.append(" tinMatchStatus: ").append(toIndentedString(tinMatchStatus)).append("\n"); + sb.append(" addressVerificationStatus: ").append(toIndentedString(addressVerificationStatus)).append("\n"); + sb.append(" eDeliveryStatus: ").append(toIndentedString(eDeliveryStatus)).append("\n"); sb.append(" validationErrors: ").append(toIndentedString(validationErrors)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append(" stateAndLocalWithholding: ").append(toIndentedString(stateAndLocalWithholding)).append("\n"); sb.append("}"); return sb.toString(); } @@ -1719,48 +1773,53 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("id"); openapiFields.add("type"); + openapiFields.add("id"); openapiFields.add("issuerId"); openapiFields.add("issuerReferenceId"); openapiFields.add("issuerTin"); openapiFields.add("taxYear"); - openapiFields.add("federalEfile"); - openapiFields.add("federalEfileStatus"); - openapiFields.add("stateEfile"); - openapiFields.add("stateEfileStatus"); - openapiFields.add("postalMail"); - openapiFields.add("postalMailStatus"); - openapiFields.add("tinMatch"); - openapiFields.add("tinMatchStatus"); - openapiFields.add("addressVerification"); - openapiFields.add("addressVerificationStatus"); - openapiFields.add("eDeliveryStatus"); openapiFields.add("referenceId"); - openapiFields.add("email"); - openapiFields.add("tinType"); - openapiFields.add("fatcaFilingRequirement"); openapiFields.add("tin"); - openapiFields.add("noTin"); - openapiFields.add("secondTinNotice"); openapiFields.add("recipientName"); + openapiFields.add("tinType"); openapiFields.add("recipientSecondName"); openapiFields.add("address"); openapiFields.add("address2"); openapiFields.add("city"); openapiFields.add("state"); openapiFields.add("zip"); - openapiFields.add("nonUsProvince"); - openapiFields.add("countryCode"); + openapiFields.add("email"); openapiFields.add("accountNumber"); openapiFields.add("officeCode"); + openapiFields.add("nonUsProvince"); + openapiFields.add("countryCode"); + openapiFields.add("federalEfileDate"); + openapiFields.add("postalMail"); + openapiFields.add("stateEfileDate"); + openapiFields.add("recipientEdeliveryDate"); + openapiFields.add("tinMatch"); + openapiFields.add("noTin"); + openapiFields.add("addressVerification"); + openapiFields.add("stateAndLocalWithholding"); + openapiFields.add("secondTinNotice"); + openapiFields.add("federalEfileStatus"); + openapiFields.add("stateEfileStatus"); + openapiFields.add("postalMailStatus"); + openapiFields.add("tinMatchStatus"); + openapiFields.add("addressVerificationStatus"); + openapiFields.add("eDeliveryStatus"); openapiFields.add("validationErrors"); openapiFields.add("createdAt"); openapiFields.add("updatedAt"); - openapiFields.add("stateAndLocalWithholding"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("recipientName"); + openapiRequiredFields.add("address"); + openapiRequiredFields.add("city"); + openapiRequiredFields.add("countryCode"); } /** @@ -1783,6 +1842,13 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Form1099K` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Form1099K.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("filerType") != null && !jsonObj.get("filerType").isJsonNull()) && !jsonObj.get("filerType").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `filerType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("filerType").toString())); @@ -1804,11 +1870,16 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("merchantCategoryCode") != null && !jsonObj.get("merchantCategoryCode").isJsonNull()) && !jsonObj.get("merchantCategoryCode").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `merchantCategoryCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantCategoryCode").toString())); } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); 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("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + if ((jsonObj.get("issuerId") != null && !jsonObj.get("issuerId").isJsonNull()) && !jsonObj.get("issuerId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `issuerId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerId").toString())); } if ((jsonObj.get("issuerReferenceId") != null && !jsonObj.get("issuerReferenceId").isJsonNull()) && !jsonObj.get("issuerReferenceId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `issuerReferenceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerReferenceId").toString())); @@ -1816,55 +1887,22 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("issuerTin") != null && !jsonObj.get("issuerTin").isJsonNull()) && !jsonObj.get("issuerTin").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `issuerTin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerTin").toString())); } - // validate the optional field `federalEfileStatus` - if (jsonObj.get("federalEfileStatus") != null && !jsonObj.get("federalEfileStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("federalEfileStatus")); - } - if (jsonObj.get("stateEfileStatus") != null && !jsonObj.get("stateEfileStatus").isJsonNull()) { - JsonArray jsonArraystateEfileStatus = jsonObj.getAsJsonArray("stateEfileStatus"); - if (jsonArraystateEfileStatus != null) { - // ensure the json data is an array - if (!jsonObj.get("stateEfileStatus").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `stateEfileStatus` to be an array in the JSON string but got `%s`", jsonObj.get("stateEfileStatus").toString())); - } - - // validate the optional field `stateEfileStatus` (array) - for (int i = 0; i < jsonArraystateEfileStatus.size(); i++) { - StateEfileStatusDetail.validateJsonElement(jsonArraystateEfileStatus.get(i)); - }; - } - } - // validate the optional field `postalMailStatus` - if (jsonObj.get("postalMailStatus") != null && !jsonObj.get("postalMailStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("postalMailStatus")); - } - // validate the optional field `tinMatchStatus` - if (jsonObj.get("tinMatchStatus") != null && !jsonObj.get("tinMatchStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("tinMatchStatus")); - } - // validate the optional field `addressVerificationStatus` - if (jsonObj.get("addressVerificationStatus") != null && !jsonObj.get("addressVerificationStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("addressVerificationStatus")); - } - // validate the optional field `eDeliveryStatus` - if (jsonObj.get("eDeliveryStatus") != null && !jsonObj.get("eDeliveryStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("eDeliveryStatus")); - } if ((jsonObj.get("referenceId") != null && !jsonObj.get("referenceId").isJsonNull()) && !jsonObj.get("referenceId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `referenceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("referenceId").toString())); } - if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); - } - if ((jsonObj.get("tinType") != null && !jsonObj.get("tinType").isJsonNull()) && !jsonObj.get("tinType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `tinType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tinType").toString())); - } if ((jsonObj.get("tin") != null && !jsonObj.get("tin").isJsonNull()) && !jsonObj.get("tin").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `tin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tin").toString())); } if ((jsonObj.get("recipientName") != null && !jsonObj.get("recipientName").isJsonNull()) && !jsonObj.get("recipientName").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `recipientName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientName").toString())); } + if ((jsonObj.get("tinType") != null && !jsonObj.get("tinType").isJsonNull()) && !jsonObj.get("tinType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `tinType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tinType").toString())); + } + // validate the optional field `tinType` + if (jsonObj.get("tinType") != null && !jsonObj.get("tinType").isJsonNull()) { + TinTypeEnum.validateJsonElement(jsonObj.get("tinType")); + } if ((jsonObj.get("recipientSecondName") != null && !jsonObj.get("recipientSecondName").isJsonNull()) && !jsonObj.get("recipientSecondName").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `recipientSecondName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientSecondName").toString())); } @@ -1883,17 +1921,58 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("zip") != null && !jsonObj.get("zip").isJsonNull()) && !jsonObj.get("zip").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `zip` to be a primitive type in the JSON string but got `%s`", jsonObj.get("zip").toString())); } + if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if ((jsonObj.get("accountNumber") != null && !jsonObj.get("accountNumber").isJsonNull()) && !jsonObj.get("accountNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); + } + if ((jsonObj.get("officeCode") != null && !jsonObj.get("officeCode").isJsonNull()) && !jsonObj.get("officeCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `officeCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("officeCode").toString())); + } if ((jsonObj.get("nonUsProvince") != null && !jsonObj.get("nonUsProvince").isJsonNull()) && !jsonObj.get("nonUsProvince").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `nonUsProvince` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nonUsProvince").toString())); } if ((jsonObj.get("countryCode") != null && !jsonObj.get("countryCode").isJsonNull()) && !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("accountNumber") != null && !jsonObj.get("accountNumber").isJsonNull()) && !jsonObj.get("accountNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); + // validate the optional field `stateAndLocalWithholding` + if (jsonObj.get("stateAndLocalWithholding") != null && !jsonObj.get("stateAndLocalWithholding").isJsonNull()) { + StateAndLocalWithholding.validateJsonElement(jsonObj.get("stateAndLocalWithholding")); } - if ((jsonObj.get("officeCode") != null && !jsonObj.get("officeCode").isJsonNull()) && !jsonObj.get("officeCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `officeCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("officeCode").toString())); + // validate the optional field `federalEfileStatus` + if (jsonObj.get("federalEfileStatus") != null && !jsonObj.get("federalEfileStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("federalEfileStatus")); + } + if (jsonObj.get("stateEfileStatus") != null && !jsonObj.get("stateEfileStatus").isJsonNull()) { + JsonArray jsonArraystateEfileStatus = jsonObj.getAsJsonArray("stateEfileStatus"); + if (jsonArraystateEfileStatus != null) { + // ensure the json data is an array + if (!jsonObj.get("stateEfileStatus").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `stateEfileStatus` to be an array in the JSON string but got `%s`", jsonObj.get("stateEfileStatus").toString())); + } + + // validate the optional field `stateEfileStatus` (array) + for (int i = 0; i < jsonArraystateEfileStatus.size(); i++) { + StateEfileStatusDetail.validateJsonElement(jsonArraystateEfileStatus.get(i)); + }; + } + } + // validate the optional field `postalMailStatus` + if (jsonObj.get("postalMailStatus") != null && !jsonObj.get("postalMailStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("postalMailStatus")); + } + // validate the optional field `tinMatchStatus` + if (jsonObj.get("tinMatchStatus") != null && !jsonObj.get("tinMatchStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("tinMatchStatus")); + } + // validate the optional field `addressVerificationStatus` + if (jsonObj.get("addressVerificationStatus") != null && !jsonObj.get("addressVerificationStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("addressVerificationStatus")); + } + // validate the optional field `eDeliveryStatus` + if (jsonObj.get("eDeliveryStatus") != null && !jsonObj.get("eDeliveryStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("eDeliveryStatus")); } if (jsonObj.get("validationErrors") != null && !jsonObj.get("validationErrors").isJsonNull()) { JsonArray jsonArrayvalidationErrors = jsonObj.getAsJsonArray("validationErrors"); @@ -1909,10 +1988,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti }; } } - // validate the optional field `stateAndLocalWithholding` - if (jsonObj.get("stateAndLocalWithholding") != null && !jsonObj.get("stateAndLocalWithholding").isJsonNull()) { - StateAndLocalWithholding.validateJsonElement(jsonObj.get("stateAndLocalWithholding")); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/Form1099List.java b/src/main/java/Avalara/SDK/model/A1099/V2/Form1099List.java deleted file mode 100644 index eee8d63..0000000 --- a/src/main/java/Avalara/SDK/model/A1099/V2/Form1099List.java +++ /dev/null @@ -1,246 +0,0 @@ -/* - * AvaTax Software Development Kit for Java (JRE) - * - * (c) 2004-2025 Avalara, Inc. - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - * - * Avalara 1099 & W-9 API Definition - * - * ## 🔐 Authentication Use **username/password** or generate a **license key** from: *Avalara Portal → Settings → License and API Keys*. [More on authentication methods](https://developer.avalara.com/avatax-dm-combined-erp/common-setup/authentication/authentication-methods/) [Test your credentials](https://developer.avalara.com/avatax/test-credentials/) ## 📘 API & SDK Documentation [Avalara SDK (.NET) on GitHub](https://github.com/avadev/Avalara-SDK-DotNet#avalarasdk--the-unified-c-library-for-next-gen-avalara-services) [Code Examples – 1099 API](https://github.com/avadev/Avalara-SDK-DotNet/blob/main/docs/A1099/V2/Class1099IssuersApi.md#call1099issuersget) - * - * @author Sachin Baijal - * @author Jonathan Wenger - * @copyright 2004-2025 Avalara, Inc. - * @license https://www.apache.org/licenses/LICENSE-2.0 - * @link https://github.com/avadev/Avalara-SDK-Java - */ - -package Avalara.SDK.model.A1099.V2; - -import java.util.Objects; -import Avalara.SDK.model.A1099.V2.Get1099Form200Response; -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 org.openapitools.jackson.nullable.JsonNullable; - -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; - -/** - * Form1099List - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") -public class Form1099List { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private List data; - - public Form1099List() { - } - - public Form1099List data(List data) { - this.data = data; - return this; - } - - public Form1099List addDataItem(Get1099Form200Response dataItem) { - if (this.data == null) { - this.data = new ArrayList<>(); - } - this.data.add(dataItem); - return this; - } - - /** - * Get data - * @return data - */ - @javax.annotation.Nullable - public List getData() { - return data; - } - - public void setData(List data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Form1099List form1099List = (Form1099List) o; - return Objects.equals(this.data, form1099List.data); - } - - 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(data); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Form1099List {\n"); - sb.append(" data: ").append(toIndentedString(data)).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"); - - // 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 Form1099List - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!Form1099List.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in Form1099List is not found in the empty JSON string", Form1099List.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!Form1099List.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Form1099List` 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++) { - Get1099Form200Response.validateJsonElement(jsonArraydata.get(i)); - }; - } - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Form1099List.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Form1099List' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Form1099List.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Form1099List value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public Form1099List read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of Form1099List given an JSON string - * - * @param jsonString JSON string - * @return An instance of Form1099List - * @throws IOException if the JSON string is invalid with respect to Form1099List - */ - public static Form1099List fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Form1099List.class); - } - - /** - * Convert an instance of Form1099List to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/Form1099ListDataInner.java b/src/main/java/Avalara/SDK/model/A1099/V2/Form1099ListDataInner.java deleted file mode 100644 index 45f3a79..0000000 --- a/src/main/java/Avalara/SDK/model/A1099/V2/Form1099ListDataInner.java +++ /dev/null @@ -1,376 +0,0 @@ -/* - * AvaTax Software Development Kit for Java (JRE) - * - * (c) 2004-2025 Avalara, Inc. - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - * - * Avalara 1099 & W-9 API Definition - * - * ## 🔐 Authentication Use **username/password** or generate a **license key** from: *Avalara Portal → Settings → License and API Keys*. [More on authentication methods](https://developer.avalara.com/avatax-dm-combined-erp/common-setup/authentication/authentication-methods/) [Test your credentials](https://developer.avalara.com/avatax/test-credentials/) ## 📘 API & SDK Documentation [Avalara SDK (.NET) on GitHub](https://github.com/avadev/Avalara-SDK-DotNet#avalarasdk--the-unified-c-library-for-next-gen-avalara-services) [Code Examples – 1099 API](https://github.com/avadev/Avalara-SDK-DotNet/blob/main/docs/A1099/V2/Class1099IssuersApi.md#call1099issuersget) - * - * @author Sachin Baijal - * @author Jonathan Wenger - * @copyright 2004-2025 Avalara, Inc. - * @license https://www.apache.org/licenses/LICENSE-2.0 - * @link https://github.com/avadev/Avalara-SDK-Java - */ - -package Avalara.SDK.model.A1099.V2; - -import java.util.Objects; -import Avalara.SDK.model.A1099.V2.Form1099K; -import Avalara.SDK.model.A1099.V2.Form1099Misc; -import Avalara.SDK.model.A1099.V2.Form1099Nec; -import Avalara.SDK.model.A1099.V2.Form1099R; -import Avalara.SDK.model.A1099.V2.Form1099StatusDetail; -import Avalara.SDK.model.A1099.V2.StateAndLocalWithholding; -import Avalara.SDK.model.A1099.V2.StateEfileStatusDetail; -import Avalara.SDK.model.A1099.V2.ValidationError; -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.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - - - -import java.io.IOException; -import java.lang.reflect.Type; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.JsonPrimitive; -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 com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonSerializationContext; -import com.google.gson.JsonSerializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonArray; -import com.google.gson.JsonParseException; - -import Avalara.SDK.JSON; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") -public class Form1099ListDataInner extends AbstractOpenApiSchema { - private static final Logger log = Logger.getLogger(Form1099ListDataInner.class.getName()); - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!Form1099ListDataInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Form1099ListDataInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter adapterForm1099K = gson.getDelegateAdapter(this, TypeToken.get(Form1099K.class)); - final TypeAdapter adapterForm1099Misc = gson.getDelegateAdapter(this, TypeToken.get(Form1099Misc.class)); - final TypeAdapter adapterForm1099Nec = gson.getDelegateAdapter(this, TypeToken.get(Form1099Nec.class)); - final TypeAdapter adapterForm1099R = gson.getDelegateAdapter(this, TypeToken.get(Form1099R.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, Form1099ListDataInner value) throws IOException { - if (value == null || value.getActualInstance() == null) { - elementAdapter.write(out, null); - return; - } - - // check if the actual instance is of the type `Form1099K` - if (value.getActualInstance() instanceof Form1099K) { - JsonElement element = adapterForm1099K.toJsonTree((Form1099K)value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type `Form1099Misc` - if (value.getActualInstance() instanceof Form1099Misc) { - JsonElement element = adapterForm1099Misc.toJsonTree((Form1099Misc)value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type `Form1099Nec` - if (value.getActualInstance() instanceof Form1099Nec) { - JsonElement element = adapterForm1099Nec.toJsonTree((Form1099Nec)value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - // check if the actual instance is of the type `Form1099R` - if (value.getActualInstance() instanceof Form1099R) { - JsonElement element = adapterForm1099R.toJsonTree((Form1099R)value.getActualInstance()); - elementAdapter.write(out, element); - return; - } - throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Form1099K, Form1099Misc, Form1099Nec, Form1099R"); - } - - @Override - public Form1099ListDataInner read(JsonReader in) throws IOException { - Object deserialized = null; - JsonElement jsonElement = elementAdapter.read(in); - - int match = 0; - ArrayList errorMessages = new ArrayList<>(); - TypeAdapter actualAdapter = elementAdapter; - - // deserialize Form1099K - try { - // validate the JSON object to see if any exception is thrown - Form1099K.validateJsonElement(jsonElement); - actualAdapter = adapterForm1099K; - match++; - log.log(Level.FINER, "Input data matches schema 'Form1099K'"); - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add(String.format("Deserialization for Form1099K failed with `%s`.", e.getMessage())); - log.log(Level.FINER, "Input data does not match schema 'Form1099K'", e); - } - // deserialize Form1099Misc - try { - // validate the JSON object to see if any exception is thrown - Form1099Misc.validateJsonElement(jsonElement); - actualAdapter = adapterForm1099Misc; - match++; - log.log(Level.FINER, "Input data matches schema 'Form1099Misc'"); - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add(String.format("Deserialization for Form1099Misc failed with `%s`.", e.getMessage())); - log.log(Level.FINER, "Input data does not match schema 'Form1099Misc'", e); - } - // deserialize Form1099Nec - try { - // validate the JSON object to see if any exception is thrown - Form1099Nec.validateJsonElement(jsonElement); - actualAdapter = adapterForm1099Nec; - match++; - log.log(Level.FINER, "Input data matches schema 'Form1099Nec'"); - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add(String.format("Deserialization for Form1099Nec failed with `%s`.", e.getMessage())); - log.log(Level.FINER, "Input data does not match schema 'Form1099Nec'", e); - } - // deserialize Form1099R - try { - // validate the JSON object to see if any exception is thrown - Form1099R.validateJsonElement(jsonElement); - actualAdapter = adapterForm1099R; - match++; - log.log(Level.FINER, "Input data matches schema 'Form1099R'"); - } catch (Exception e) { - // deserialization failed, continue - errorMessages.add(String.format("Deserialization for Form1099R failed with `%s`.", e.getMessage())); - log.log(Level.FINER, "Input data does not match schema 'Form1099R'", e); - } - - if (match == 1) { - Form1099ListDataInner ret = new Form1099ListDataInner(); - ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); - return ret; - } - - throw new IOException(String.format("Failed deserialization for Form1099ListDataInner: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); - } - }.nullSafe(); - } - } - - // store a list of schema names defined in oneOf - public static final Map> schemas = new HashMap>(); - - public Form1099ListDataInner() { - super("oneOf", Boolean.FALSE); - } - - public Form1099ListDataInner(Object o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - - static { - schemas.put("Form1099K", Form1099K.class); - schemas.put("Form1099Misc", Form1099Misc.class); - schemas.put("Form1099Nec", Form1099Nec.class); - schemas.put("Form1099R", Form1099R.class); - } - - @Override - public Map> getSchemas() { - return Form1099ListDataInner.schemas; - } - - /** - * Set the instance that matches the oneOf child schema, check - * the instance parameter is valid against the oneOf child schemas: - * Form1099K, Form1099Misc, Form1099Nec, Form1099R - * - * It could be an instance of the 'oneOf' schemas. - */ - @Override - public void setActualInstance(Object instance) { - if (instance instanceof Form1099K) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof Form1099Misc) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof Form1099Nec) { - super.setActualInstance(instance); - return; - } - - if (instance instanceof Form1099R) { - super.setActualInstance(instance); - return; - } - - throw new RuntimeException("Invalid instance type. Must be Form1099K, Form1099Misc, Form1099Nec, Form1099R"); - } - - /** - * Get the actual instance, which can be the following: - * Form1099K, Form1099Misc, Form1099Nec, Form1099R - * - * @return The actual instance (Form1099K, Form1099Misc, Form1099Nec, Form1099R) - */ - @SuppressWarnings("unchecked") - @Override - public Object getActualInstance() { - return super.getActualInstance(); - } - - /** - * Get the actual instance of `Form1099K`. If the actual instance is not `Form1099K`, - * the ClassCastException will be thrown. - * - * @return The actual instance of `Form1099K` - * @throws ClassCastException if the instance is not `Form1099K` - */ - public Form1099K getForm1099K() throws ClassCastException { - return (Form1099K)super.getActualInstance(); - } - /** - * Get the actual instance of `Form1099Misc`. If the actual instance is not `Form1099Misc`, - * the ClassCastException will be thrown. - * - * @return The actual instance of `Form1099Misc` - * @throws ClassCastException if the instance is not `Form1099Misc` - */ - public Form1099Misc getForm1099Misc() throws ClassCastException { - return (Form1099Misc)super.getActualInstance(); - } - /** - * Get the actual instance of `Form1099Nec`. If the actual instance is not `Form1099Nec`, - * the ClassCastException will be thrown. - * - * @return The actual instance of `Form1099Nec` - * @throws ClassCastException if the instance is not `Form1099Nec` - */ - public Form1099Nec getForm1099Nec() throws ClassCastException { - return (Form1099Nec)super.getActualInstance(); - } - /** - * Get the actual instance of `Form1099R`. If the actual instance is not `Form1099R`, - * the ClassCastException will be thrown. - * - * @return The actual instance of `Form1099R` - * @throws ClassCastException if the instance is not `Form1099R` - */ - public Form1099R getForm1099R() throws ClassCastException { - return (Form1099R)super.getActualInstance(); - } - - /** - * 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 Form1099ListDataInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - // validate oneOf schemas one by one - int validCount = 0; - ArrayList errorMessages = new ArrayList<>(); - // validate the json string with Form1099K - try { - Form1099K.validateJsonElement(jsonElement); - validCount++; - } catch (Exception e) { - errorMessages.add(String.format("Deserialization for Form1099K failed with `%s`.", e.getMessage())); - // continue to the next one - } - // validate the json string with Form1099Misc - try { - Form1099Misc.validateJsonElement(jsonElement); - validCount++; - } catch (Exception e) { - errorMessages.add(String.format("Deserialization for Form1099Misc failed with `%s`.", e.getMessage())); - // continue to the next one - } - // validate the json string with Form1099Nec - try { - Form1099Nec.validateJsonElement(jsonElement); - validCount++; - } catch (Exception e) { - errorMessages.add(String.format("Deserialization for Form1099Nec failed with `%s`.", e.getMessage())); - // continue to the next one - } - // validate the json string with Form1099R - try { - Form1099R.validateJsonElement(jsonElement); - validCount++; - } catch (Exception e) { - errorMessages.add(String.format("Deserialization for Form1099R failed with `%s`.", e.getMessage())); - // continue to the next one - } - if (validCount != 1) { - throw new IOException(String.format("The JSON string is invalid for Form1099ListDataInner with oneOf schemas: Form1099K, Form1099Misc, Form1099Nec, Form1099R. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); - } - } - - /** - * Create an instance of Form1099ListDataInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of Form1099ListDataInner - * @throws IOException if the JSON string is invalid with respect to Form1099ListDataInner - */ - public static Form1099ListDataInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Form1099ListDataInner.class); - } - - /** - * Convert an instance of Form1099ListDataInner to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/Form1099ListRequest.java b/src/main/java/Avalara/SDK/model/A1099/V2/Form1099ListRequest.java new file mode 100644 index 0000000..3d4fe55 --- /dev/null +++ b/src/main/java/Avalara/SDK/model/A1099/V2/Form1099ListRequest.java @@ -0,0 +1,333 @@ +/* + * AvaTax Software Development Kit for Java (JRE) + * + * (c) 2004-2025 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * Avalara 1099 & W-9 API Definition + * + * ## 🔐 Authentication Generate a **license key** from: *[Avalara Portal](https://www.avalara.com/us/en/signin.html) → Settings → License and API Keys*. [More on authentication methods](https://developer.avalara.com/avatax-dm-combined-erp/common-setup/authentication/authentication-methods/) [Test your credentials](https://developer.avalara.com/avatax/test-credentials/) ## 📘 API & SDK Documentation [Avalara SDK (.NET) on GitHub](https://github.com/avadev/Avalara-SDK-DotNet#avalarasdk--the-unified-c-library-for-next-gen-avalara-services) [Code Examples – 1099 API](https://github.com/avadev/Avalara-SDK-DotNet/blob/main/docs/A1099/V2/Class1099IssuersApi.md#call1099issuersget) + * + * @author Sachin Baijal + * @author Jonathan Wenger + * @copyright 2004-2025 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @link https://github.com/avadev/Avalara-SDK-Java + */ + +package Avalara.SDK.model.A1099.V2; + +import java.util.Objects; +import Avalara.SDK.model.A1099.V2.Get1099Form200Response; +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; + +/** + * Form1099ListRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") +public class Form1099ListRequest { + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + _1099_NEC("1099-NEC"), + + _1099_MISC("1099-MISC"), + + _1099_DIV("1099-DIV"), + + _1099_R("1099-R"), + + _1099_K("1099-K"), + + _1095_B("1095-B"), + + _1042_S("1042-S"), + + _1095_C("1095-C"), + + _1099_INT("1099-INT"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.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 TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public static final String SERIALIZED_NAME_FORMS = "forms"; + @SerializedName(SERIALIZED_NAME_FORMS) + private List forms; + + public Form1099ListRequest() { + } + + public Form1099ListRequest type(TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nullable + public TypeEnum getType() { + return type; + } + + public void setType(TypeEnum type) { + this.type = type; + } + + + public Form1099ListRequest forms(List forms) { + this.forms = forms; + return this; + } + + public Form1099ListRequest addFormsItem(Get1099Form200Response formsItem) { + if (this.forms == null) { + this.forms = new ArrayList<>(); + } + this.forms.add(formsItem); + return this; + } + + /** + * Get forms + * @return forms + */ + @javax.annotation.Nullable + public List getForms() { + return forms; + } + + public void setForms(List forms) { + this.forms = forms; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Form1099ListRequest form1099ListRequest = (Form1099ListRequest) o; + return Objects.equals(this.type, form1099ListRequest.type) && + Objects.equals(this.forms, form1099ListRequest.forms); + } + + @Override + public int hashCode() { + return Objects.hash(type, forms); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Form1099ListRequest {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" forms: ").append(toIndentedString(forms)).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("type"); + openapiFields.add("forms"); + + // 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 Form1099ListRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Form1099ListRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Form1099ListRequest is not found in the empty JSON string", Form1099ListRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Form1099ListRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Form1099ListRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the optional field `type` + if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) { + TypeEnum.validateJsonElement(jsonObj.get("type")); + } + if (jsonObj.get("forms") != null && !jsonObj.get("forms").isJsonNull()) { + JsonArray jsonArrayforms = jsonObj.getAsJsonArray("forms"); + if (jsonArrayforms != null) { + // ensure the json data is an array + if (!jsonObj.get("forms").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `forms` to be an array in the JSON string but got `%s`", jsonObj.get("forms").toString())); + } + + // validate the optional field `forms` (array) + for (int i = 0; i < jsonArrayforms.size(); i++) { + Get1099Form200Response.validateJsonElement(jsonArrayforms.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Form1099ListRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Form1099ListRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Form1099ListRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Form1099ListRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Form1099ListRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Form1099ListRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of Form1099ListRequest + * @throws IOException if the JSON string is invalid with respect to Form1099ListRequest + */ + public static Form1099ListRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Form1099ListRequest.class); + } + + /** + * Convert an instance of Form1099ListRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/Form1099Misc.java b/src/main/java/Avalara/SDK/model/A1099/V2/Form1099Misc.java index 4e541bb..7f0d42a 100644 --- a/src/main/java/Avalara/SDK/model/A1099/V2/Form1099Misc.java +++ b/src/main/java/Avalara/SDK/model/A1099/V2/Form1099Misc.java @@ -30,6 +30,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.Arrays; @@ -61,7 +62,7 @@ import Avalara.SDK.JSON; /** - * Form1099Misc + * Form 1099-MISC: Miscellaneous Income */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class Form1099Misc { @@ -77,9 +78,9 @@ public class Form1099Misc { @SerializedName(SERIALIZED_NAME_OTHER_INCOME) private Double otherIncome; - public static final String SERIALIZED_NAME_FED_INCOME_TAX_WITHHELD = "fedIncomeTaxWithheld"; - @SerializedName(SERIALIZED_NAME_FED_INCOME_TAX_WITHHELD) - private Double fedIncomeTaxWithheld; + public static final String SERIALIZED_NAME_FEDERAL_INCOME_TAX_WITHHELD = "federalIncomeTaxWithheld"; + @SerializedName(SERIALIZED_NAME_FEDERAL_INCOME_TAX_WITHHELD) + private Double federalIncomeTaxWithheld; public static final String SERIALIZED_NAME_FISHING_BOAT_PROCEEDS = "fishingBoatProceeds"; @SerializedName(SERIALIZED_NAME_FISHING_BOAT_PROCEEDS) @@ -89,22 +90,18 @@ public class Form1099Misc { @SerializedName(SERIALIZED_NAME_MEDICAL_AND_HEALTH_CARE_PAYMENTS) private Double medicalAndHealthCarePayments; - public static final String SERIALIZED_NAME_SUBSTITUTE_PAYMENTS = "substitutePayments"; - @SerializedName(SERIALIZED_NAME_SUBSTITUTE_PAYMENTS) - private Double substitutePayments; - public static final String SERIALIZED_NAME_DIRECT_SALES_INDICATOR = "directSalesIndicator"; @SerializedName(SERIALIZED_NAME_DIRECT_SALES_INDICATOR) private Boolean directSalesIndicator; + public static final String SERIALIZED_NAME_SUBSTITUTE_PAYMENTS = "substitutePayments"; + @SerializedName(SERIALIZED_NAME_SUBSTITUTE_PAYMENTS) + private Double substitutePayments; + public static final String SERIALIZED_NAME_CROP_INSURANCE_PROCEEDS = "cropInsuranceProceeds"; @SerializedName(SERIALIZED_NAME_CROP_INSURANCE_PROCEEDS) private Double cropInsuranceProceeds; - public static final String SERIALIZED_NAME_EXCESS_GOLDEN_PARACHUTE_PAYMENTS = "excessGoldenParachutePayments"; - @SerializedName(SERIALIZED_NAME_EXCESS_GOLDEN_PARACHUTE_PAYMENTS) - private Double excessGoldenParachutePayments; - public static final String SERIALIZED_NAME_GROSS_PROCEEDS_PAID_TO_ATTORNEY = "grossProceedsPaidToAttorney"; @SerializedName(SERIALIZED_NAME_GROSS_PROCEEDS_PAID_TO_ATTORNEY) private Double grossProceedsPaidToAttorney; @@ -117,21 +114,95 @@ public class Form1099Misc { @SerializedName(SERIALIZED_NAME_SECTION409_A_DEFERRALS) private Double section409ADeferrals; + public static final String SERIALIZED_NAME_EXCESS_GOLDEN_PARACHUTE_PAYMENTS = "excessGoldenParachutePayments"; + @SerializedName(SERIALIZED_NAME_EXCESS_GOLDEN_PARACHUTE_PAYMENTS) + private Double excessGoldenParachutePayments; + public static final String SERIALIZED_NAME_NONQUALIFIED_DEFERRED_COMPENSATION = "nonqualifiedDeferredCompensation"; @SerializedName(SERIALIZED_NAME_NONQUALIFIED_DEFERRED_COMPENSATION) private Double nonqualifiedDeferredCompensation; - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; + public static final String SERIALIZED_NAME_FATCA_FILING_REQUIREMENT = "fatcaFilingRequirement"; + @SerializedName(SERIALIZED_NAME_FATCA_FILING_REQUIREMENT) + private Boolean fatcaFilingRequirement; + + /** + * Form type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + _1099_NEC("1099-NEC"), + + _1099_MISC("1099-MISC"), + + _1099_DIV("1099-DIV"), + + _1099_R("1099-R"), + + _1099_K("1099-K"), + + _1095_B("1095-B"), + + _1042_S("1042-S"), + + _1095_C("1095-C"), + + _1099_INT("1099-INT"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.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 TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) - private String type; + private TypeEnum type; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; public static final String SERIALIZED_NAME_ISSUER_ID = "issuerId"; @SerializedName(SERIALIZED_NAME_ISSUER_ID) - private Integer issuerId; + private String issuerId; public static final String SERIALIZED_NAME_ISSUER_REFERENCE_ID = "issuerReferenceId"; @SerializedName(SERIALIZED_NAME_ISSUER_REFERENCE_ID) @@ -145,81 +216,79 @@ public class Form1099Misc { @SerializedName(SERIALIZED_NAME_TAX_YEAR) private Integer taxYear; - public static final String SERIALIZED_NAME_FEDERAL_EFILE = "federalEfile"; - @SerializedName(SERIALIZED_NAME_FEDERAL_EFILE) - private Boolean federalEfile; - - public static final String SERIALIZED_NAME_FEDERAL_EFILE_STATUS = "federalEfileStatus"; - @SerializedName(SERIALIZED_NAME_FEDERAL_EFILE_STATUS) - private Form1099StatusDetail federalEfileStatus; - - public static final String SERIALIZED_NAME_STATE_EFILE = "stateEfile"; - @SerializedName(SERIALIZED_NAME_STATE_EFILE) - private Boolean stateEfile; - - public static final String SERIALIZED_NAME_STATE_EFILE_STATUS = "stateEfileStatus"; - @SerializedName(SERIALIZED_NAME_STATE_EFILE_STATUS) - private List stateEfileStatus; + public static final String SERIALIZED_NAME_REFERENCE_ID = "referenceId"; + @SerializedName(SERIALIZED_NAME_REFERENCE_ID) + private String referenceId; - public static final String SERIALIZED_NAME_POSTAL_MAIL = "postalMail"; - @SerializedName(SERIALIZED_NAME_POSTAL_MAIL) - private Boolean postalMail; + public static final String SERIALIZED_NAME_TIN = "tin"; + @SerializedName(SERIALIZED_NAME_TIN) + private String tin; - public static final String SERIALIZED_NAME_POSTAL_MAIL_STATUS = "postalMailStatus"; - @SerializedName(SERIALIZED_NAME_POSTAL_MAIL_STATUS) - private Form1099StatusDetail postalMailStatus; + public static final String SERIALIZED_NAME_RECIPIENT_NAME = "recipientName"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_NAME) + private String recipientName; - public static final String SERIALIZED_NAME_TIN_MATCH = "tinMatch"; - @SerializedName(SERIALIZED_NAME_TIN_MATCH) - private Boolean tinMatch; + /** + * Type of TIN (Tax ID Number) + */ + @JsonAdapter(TinTypeEnum.Adapter.class) + public enum TinTypeEnum { + EMPTY("Empty"), + + EIN("EIN"), + + SSN("SSN"), + + ITIN("ITIN"), + + ATIN("ATIN"); + + private String value; + + TinTypeEnum(String value) { + this.value = value; + } - public static final String SERIALIZED_NAME_TIN_MATCH_STATUS = "tinMatchStatus"; - @SerializedName(SERIALIZED_NAME_TIN_MATCH_STATUS) - private Form1099StatusDetail tinMatchStatus; + public String getValue() { + return value; + } - public static final String SERIALIZED_NAME_ADDRESS_VERIFICATION = "addressVerification"; - @SerializedName(SERIALIZED_NAME_ADDRESS_VERIFICATION) - private Boolean addressVerification; + @Override + public String toString() { + return String.valueOf(value); + } - public static final String SERIALIZED_NAME_ADDRESS_VERIFICATION_STATUS = "addressVerificationStatus"; - @SerializedName(SERIALIZED_NAME_ADDRESS_VERIFICATION_STATUS) - private Form1099StatusDetail addressVerificationStatus; + public static TinTypeEnum fromValue(String value) { + for (TinTypeEnum b : TinTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } - public static final String SERIALIZED_NAME_E_DELIVERY_STATUS = "eDeliveryStatus"; - @SerializedName(SERIALIZED_NAME_E_DELIVERY_STATUS) - private Form1099StatusDetail eDeliveryStatus; + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TinTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } - public static final String SERIALIZED_NAME_REFERENCE_ID = "referenceId"; - @SerializedName(SERIALIZED_NAME_REFERENCE_ID) - private String referenceId; + @Override + public TinTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TinTypeEnum.fromValue(value); + } + } - public static final String SERIALIZED_NAME_EMAIL = "email"; - @SerializedName(SERIALIZED_NAME_EMAIL) - private String email; + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TinTypeEnum.fromValue(value); + } + } public static final String SERIALIZED_NAME_TIN_TYPE = "tinType"; @SerializedName(SERIALIZED_NAME_TIN_TYPE) - private String tinType; - - public static final String SERIALIZED_NAME_FATCA_FILING_REQUIREMENT = "fatcaFilingRequirement"; - @SerializedName(SERIALIZED_NAME_FATCA_FILING_REQUIREMENT) - private Boolean fatcaFilingRequirement; - - public static final String SERIALIZED_NAME_TIN = "tin"; - @SerializedName(SERIALIZED_NAME_TIN) - private String tin; - - public static final String SERIALIZED_NAME_NO_TIN = "noTin"; - @SerializedName(SERIALIZED_NAME_NO_TIN) - private Boolean noTin; - - public static final String SERIALIZED_NAME_SECOND_TIN_NOTICE = "secondTinNotice"; - @SerializedName(SERIALIZED_NAME_SECOND_TIN_NOTICE) - private Boolean secondTinNotice; - - public static final String SERIALIZED_NAME_RECIPIENT_NAME = "recipientName"; - @SerializedName(SERIALIZED_NAME_RECIPIENT_NAME) - private String recipientName; + private TinTypeEnum tinType; public static final String SERIALIZED_NAME_RECIPIENT_SECOND_NAME = "recipientSecondName"; @SerializedName(SERIALIZED_NAME_RECIPIENT_SECOND_NAME) @@ -245,6 +314,18 @@ public class Form1099Misc { @SerializedName(SERIALIZED_NAME_ZIP) private String zip; + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) + private String accountNumber; + + public static final String SERIALIZED_NAME_OFFICE_CODE = "officeCode"; + @SerializedName(SERIALIZED_NAME_OFFICE_CODE) + private String officeCode; + public static final String SERIALIZED_NAME_NON_US_PROVINCE = "nonUsProvince"; @SerializedName(SERIALIZED_NAME_NON_US_PROVINCE) private String nonUsProvince; @@ -253,13 +334,65 @@ public class Form1099Misc { @SerializedName(SERIALIZED_NAME_COUNTRY_CODE) private String countryCode; - public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; - @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) - private String accountNumber; + public static final String SERIALIZED_NAME_FEDERAL_EFILE_DATE = "federalEfileDate"; + @SerializedName(SERIALIZED_NAME_FEDERAL_EFILE_DATE) + private LocalDate federalEfileDate; - public static final String SERIALIZED_NAME_OFFICE_CODE = "officeCode"; - @SerializedName(SERIALIZED_NAME_OFFICE_CODE) - private String officeCode; + public static final String SERIALIZED_NAME_POSTAL_MAIL = "postalMail"; + @SerializedName(SERIALIZED_NAME_POSTAL_MAIL) + private Boolean postalMail; + + public static final String SERIALIZED_NAME_STATE_EFILE_DATE = "stateEfileDate"; + @SerializedName(SERIALIZED_NAME_STATE_EFILE_DATE) + private LocalDate stateEfileDate; + + public static final String SERIALIZED_NAME_RECIPIENT_EDELIVERY_DATE = "recipientEdeliveryDate"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_EDELIVERY_DATE) + private LocalDate recipientEdeliveryDate; + + public static final String SERIALIZED_NAME_TIN_MATCH = "tinMatch"; + @SerializedName(SERIALIZED_NAME_TIN_MATCH) + private Boolean tinMatch; + + public static final String SERIALIZED_NAME_NO_TIN = "noTin"; + @SerializedName(SERIALIZED_NAME_NO_TIN) + private Boolean noTin; + + public static final String SERIALIZED_NAME_ADDRESS_VERIFICATION = "addressVerification"; + @SerializedName(SERIALIZED_NAME_ADDRESS_VERIFICATION) + private Boolean addressVerification; + + public static final String SERIALIZED_NAME_STATE_AND_LOCAL_WITHHOLDING = "stateAndLocalWithholding"; + @SerializedName(SERIALIZED_NAME_STATE_AND_LOCAL_WITHHOLDING) + private StateAndLocalWithholding stateAndLocalWithholding; + + public static final String SERIALIZED_NAME_SECOND_TIN_NOTICE = "secondTinNotice"; + @SerializedName(SERIALIZED_NAME_SECOND_TIN_NOTICE) + private Boolean secondTinNotice; + + public static final String SERIALIZED_NAME_FEDERAL_EFILE_STATUS = "federalEfileStatus"; + @SerializedName(SERIALIZED_NAME_FEDERAL_EFILE_STATUS) + private Form1099StatusDetail federalEfileStatus; + + public static final String SERIALIZED_NAME_STATE_EFILE_STATUS = "stateEfileStatus"; + @SerializedName(SERIALIZED_NAME_STATE_EFILE_STATUS) + private List stateEfileStatus; + + public static final String SERIALIZED_NAME_POSTAL_MAIL_STATUS = "postalMailStatus"; + @SerializedName(SERIALIZED_NAME_POSTAL_MAIL_STATUS) + private Form1099StatusDetail postalMailStatus; + + public static final String SERIALIZED_NAME_TIN_MATCH_STATUS = "tinMatchStatus"; + @SerializedName(SERIALIZED_NAME_TIN_MATCH_STATUS) + private Form1099StatusDetail tinMatchStatus; + + public static final String SERIALIZED_NAME_ADDRESS_VERIFICATION_STATUS = "addressVerificationStatus"; + @SerializedName(SERIALIZED_NAME_ADDRESS_VERIFICATION_STATUS) + private Form1099StatusDetail addressVerificationStatus; + + public static final String SERIALIZED_NAME_E_DELIVERY_STATUS = "eDeliveryStatus"; + @SerializedName(SERIALIZED_NAME_E_DELIVERY_STATUS) + private Form1099StatusDetail eDeliveryStatus; public static final String SERIALIZED_NAME_VALIDATION_ERRORS = "validationErrors"; @SerializedName(SERIALIZED_NAME_VALIDATION_ERRORS) @@ -273,20 +406,41 @@ public class Form1099Misc { @SerializedName(SERIALIZED_NAME_UPDATED_AT) private OffsetDateTime updatedAt; - public static final String SERIALIZED_NAME_STATE_AND_LOCAL_WITHHOLDING = "stateAndLocalWithholding"; - @SerializedName(SERIALIZED_NAME_STATE_AND_LOCAL_WITHHOLDING) - private StateAndLocalWithholding stateAndLocalWithholding; - public Form1099Misc() { } + public Form1099Misc( + String id, + Form1099StatusDetail federalEfileStatus, + List stateEfileStatus, + Form1099StatusDetail postalMailStatus, + Form1099StatusDetail tinMatchStatus, + Form1099StatusDetail addressVerificationStatus, + Form1099StatusDetail eDeliveryStatus, + List validationErrors, + OffsetDateTime createdAt, + OffsetDateTime updatedAt + ) { + this(); + this.id = id; + this.federalEfileStatus = federalEfileStatus; + this.stateEfileStatus = stateEfileStatus; + this.postalMailStatus = postalMailStatus; + this.tinMatchStatus = tinMatchStatus; + this.addressVerificationStatus = addressVerificationStatus; + this.eDeliveryStatus = eDeliveryStatus; + this.validationErrors = validationErrors; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + public Form1099Misc rents(Double rents) { this.rents = rents; return this; } /** - * Get rents + * Rents * @return rents */ @javax.annotation.Nullable @@ -305,7 +459,7 @@ public Form1099Misc royalties(Double royalties) { } /** - * Get royalties + * Royalties * @return royalties */ @javax.annotation.Nullable @@ -324,7 +478,7 @@ public Form1099Misc otherIncome(Double otherIncome) { } /** - * Get otherIncome + * Other income * @return otherIncome */ @javax.annotation.Nullable @@ -337,22 +491,22 @@ public void setOtherIncome(Double otherIncome) { } - public Form1099Misc fedIncomeTaxWithheld(Double fedIncomeTaxWithheld) { - this.fedIncomeTaxWithheld = fedIncomeTaxWithheld; + public Form1099Misc federalIncomeTaxWithheld(Double federalIncomeTaxWithheld) { + this.federalIncomeTaxWithheld = federalIncomeTaxWithheld; return this; } /** - * Get fedIncomeTaxWithheld - * @return fedIncomeTaxWithheld + * Federal income tax withheld + * @return federalIncomeTaxWithheld */ @javax.annotation.Nullable - public Double getFedIncomeTaxWithheld() { - return fedIncomeTaxWithheld; + public Double getFederalIncomeTaxWithheld() { + return federalIncomeTaxWithheld; } - public void setFedIncomeTaxWithheld(Double fedIncomeTaxWithheld) { - this.fedIncomeTaxWithheld = fedIncomeTaxWithheld; + public void setFederalIncomeTaxWithheld(Double federalIncomeTaxWithheld) { + this.federalIncomeTaxWithheld = federalIncomeTaxWithheld; } @@ -362,7 +516,7 @@ public Form1099Misc fishingBoatProceeds(Double fishingBoatProceeds) { } /** - * Get fishingBoatProceeds + * Fishing boat proceeds * @return fishingBoatProceeds */ @javax.annotation.Nullable @@ -381,7 +535,7 @@ public Form1099Misc medicalAndHealthCarePayments(Double medicalAndHealthCarePaym } /** - * Get medicalAndHealthCarePayments + * Medical and health care payments * @return medicalAndHealthCarePayments */ @javax.annotation.Nullable @@ -394,32 +548,13 @@ public void setMedicalAndHealthCarePayments(Double medicalAndHealthCarePayments) } - public Form1099Misc substitutePayments(Double substitutePayments) { - this.substitutePayments = substitutePayments; - return this; - } - - /** - * Get substitutePayments - * @return substitutePayments - */ - @javax.annotation.Nullable - public Double getSubstitutePayments() { - return substitutePayments; - } - - public void setSubstitutePayments(Double substitutePayments) { - this.substitutePayments = substitutePayments; - } - - public Form1099Misc directSalesIndicator(Boolean directSalesIndicator) { this.directSalesIndicator = directSalesIndicator; return this; } /** - * Get directSalesIndicator + * Payer made direct sales totaling $5,000 or more of consumer products to recipient for resale * @return directSalesIndicator */ @javax.annotation.Nullable @@ -432,41 +567,41 @@ public void setDirectSalesIndicator(Boolean directSalesIndicator) { } - public Form1099Misc cropInsuranceProceeds(Double cropInsuranceProceeds) { - this.cropInsuranceProceeds = cropInsuranceProceeds; + public Form1099Misc substitutePayments(Double substitutePayments) { + this.substitutePayments = substitutePayments; return this; } /** - * Get cropInsuranceProceeds - * @return cropInsuranceProceeds + * Substitute payments in lieu of dividends or interest + * @return substitutePayments */ @javax.annotation.Nullable - public Double getCropInsuranceProceeds() { - return cropInsuranceProceeds; + public Double getSubstitutePayments() { + return substitutePayments; } - public void setCropInsuranceProceeds(Double cropInsuranceProceeds) { - this.cropInsuranceProceeds = cropInsuranceProceeds; + public void setSubstitutePayments(Double substitutePayments) { + this.substitutePayments = substitutePayments; } - public Form1099Misc excessGoldenParachutePayments(Double excessGoldenParachutePayments) { - this.excessGoldenParachutePayments = excessGoldenParachutePayments; + public Form1099Misc cropInsuranceProceeds(Double cropInsuranceProceeds) { + this.cropInsuranceProceeds = cropInsuranceProceeds; return this; } /** - * Get excessGoldenParachutePayments - * @return excessGoldenParachutePayments + * Crop insurance proceeds + * @return cropInsuranceProceeds */ @javax.annotation.Nullable - public Double getExcessGoldenParachutePayments() { - return excessGoldenParachutePayments; + public Double getCropInsuranceProceeds() { + return cropInsuranceProceeds; } - public void setExcessGoldenParachutePayments(Double excessGoldenParachutePayments) { - this.excessGoldenParachutePayments = excessGoldenParachutePayments; + public void setCropInsuranceProceeds(Double cropInsuranceProceeds) { + this.cropInsuranceProceeds = cropInsuranceProceeds; } @@ -476,7 +611,7 @@ public Form1099Misc grossProceedsPaidToAttorney(Double grossProceedsPaidToAttorn } /** - * Get grossProceedsPaidToAttorney + * Gross proceeds paid to an attorney * @return grossProceedsPaidToAttorney */ @javax.annotation.Nullable @@ -495,7 +630,7 @@ public Form1099Misc fishPurchasedForResale(Double fishPurchasedForResale) { } /** - * Get fishPurchasedForResale + * Fish purchased for resale * @return fishPurchasedForResale */ @javax.annotation.Nullable @@ -514,7 +649,7 @@ public Form1099Misc section409ADeferrals(Double section409ADeferrals) { } /** - * Get section409ADeferrals + * Section 409A deferrals * @return section409ADeferrals */ @javax.annotation.Nullable @@ -527,13 +662,32 @@ public void setSection409ADeferrals(Double section409ADeferrals) { } - public Form1099Misc nonqualifiedDeferredCompensation(Double nonqualifiedDeferredCompensation) { + public Form1099Misc excessGoldenParachutePayments(Double excessGoldenParachutePayments) { + this.excessGoldenParachutePayments = excessGoldenParachutePayments; + return this; + } + + /** + * (Legacy field) Excess golden parachute payments + * @return excessGoldenParachutePayments + */ + @javax.annotation.Nullable + public Double getExcessGoldenParachutePayments() { + return excessGoldenParachutePayments; + } + + public void setExcessGoldenParachutePayments(Double excessGoldenParachutePayments) { + this.excessGoldenParachutePayments = excessGoldenParachutePayments; + } + + + public Form1099Misc nonqualifiedDeferredCompensation(Double nonqualifiedDeferredCompensation) { this.nonqualifiedDeferredCompensation = nonqualifiedDeferredCompensation; return this; } /** - * Get nonqualifiedDeferredCompensation + * Nonqualified deferred compensation * @return nonqualifiedDeferredCompensation */ @javax.annotation.Nullable @@ -546,59 +700,70 @@ public void setNonqualifiedDeferredCompensation(Double nonqualifiedDeferredCompe } - public Form1099Misc id(String id) { - this.id = id; + public Form1099Misc fatcaFilingRequirement(Boolean fatcaFilingRequirement) { + this.fatcaFilingRequirement = fatcaFilingRequirement; return this; } /** - * Get id - * @return id + * FATCA filing requirement + * @return fatcaFilingRequirement */ @javax.annotation.Nullable - public String getId() { - return id; + public Boolean getFatcaFilingRequirement() { + return fatcaFilingRequirement; } - public void setId(String id) { - this.id = id; + public void setFatcaFilingRequirement(Boolean fatcaFilingRequirement) { + this.fatcaFilingRequirement = fatcaFilingRequirement; } - public Form1099Misc type(String type) { + public Form1099Misc type(TypeEnum type) { this.type = type; return this; } /** - * Get type + * Form type * @return type */ - @javax.annotation.Nullable - public String getType() { + @javax.annotation.Nonnull + public TypeEnum getType() { return type; } - public void setType(String type) { + public void setType(TypeEnum type) { this.type = type; } - public Form1099Misc issuerId(Integer issuerId) { + /** + * Form ID. Unique identifier set when the record is created. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + + + public Form1099Misc issuerId(String issuerId) { this.issuerId = issuerId; return this; } /** - * Get issuerId + * Issuer ID - only required when creating forms * @return issuerId */ @javax.annotation.Nullable - public Integer getIssuerId() { + public String getIssuerId() { return issuerId; } - public void setIssuerId(Integer issuerId) { + public void setIssuerId(String issuerId) { this.issuerId = issuerId; } @@ -609,7 +774,7 @@ public Form1099Misc issuerReferenceId(String issuerReferenceId) { } /** - * Get issuerReferenceId + * Issuer Reference ID - only required when creating forms * @return issuerReferenceId */ @javax.annotation.Nullable @@ -628,7 +793,7 @@ public Form1099Misc issuerTin(String issuerTin) { } /** - * Get issuerTin + * Issuer TIN - readonly * @return issuerTin */ @javax.annotation.Nullable @@ -647,7 +812,7 @@ public Form1099Misc taxYear(Integer taxYear) { } /** - * Get taxYear + * Tax Year - only required when creating forms * @return taxYear */ @javax.annotation.Nullable @@ -660,580 +825,530 @@ public void setTaxYear(Integer taxYear) { } - public Form1099Misc federalEfile(Boolean federalEfile) { - this.federalEfile = federalEfile; + public Form1099Misc referenceId(String referenceId) { + this.referenceId = referenceId; return this; } /** - * Get federalEfile - * @return federalEfile + * Internal reference ID. Never shown to any agency or recipient. + * @return referenceId */ @javax.annotation.Nullable - public Boolean getFederalEfile() { - return federalEfile; + public String getReferenceId() { + return referenceId; } - public void setFederalEfile(Boolean federalEfile) { - this.federalEfile = federalEfile; + public void setReferenceId(String referenceId) { + this.referenceId = referenceId; } - public Form1099Misc federalEfileStatus(Form1099StatusDetail federalEfileStatus) { - this.federalEfileStatus = federalEfileStatus; + public Form1099Misc tin(String tin) { + this.tin = tin; return this; } /** - * Get federalEfileStatus - * @return federalEfileStatus + * Recipient's Federal Tax Identification Number (TIN). + * @return tin */ @javax.annotation.Nullable - public Form1099StatusDetail getFederalEfileStatus() { - return federalEfileStatus; + public String getTin() { + return tin; } - public void setFederalEfileStatus(Form1099StatusDetail federalEfileStatus) { - this.federalEfileStatus = federalEfileStatus; + public void setTin(String tin) { + this.tin = tin; } - public Form1099Misc stateEfile(Boolean stateEfile) { - this.stateEfile = stateEfile; + public Form1099Misc recipientName(String recipientName) { + this.recipientName = recipientName; return this; } /** - * Get stateEfile - * @return stateEfile + * Recipient name + * @return recipientName */ @javax.annotation.Nullable - public Boolean getStateEfile() { - return stateEfile; + public String getRecipientName() { + return recipientName; } - public void setStateEfile(Boolean stateEfile) { - this.stateEfile = stateEfile; + public void setRecipientName(String recipientName) { + this.recipientName = recipientName; } - public Form1099Misc stateEfileStatus(List stateEfileStatus) { - this.stateEfileStatus = stateEfileStatus; - return this; - } - - public Form1099Misc addStateEfileStatusItem(StateEfileStatusDetail stateEfileStatusItem) { - if (this.stateEfileStatus == null) { - this.stateEfileStatus = new ArrayList<>(); - } - this.stateEfileStatus.add(stateEfileStatusItem); + public Form1099Misc tinType(TinTypeEnum tinType) { + this.tinType = tinType; return this; } /** - * Get stateEfileStatus - * @return stateEfileStatus + * Type of TIN (Tax ID Number) + * @return tinType */ @javax.annotation.Nullable - public List getStateEfileStatus() { - return stateEfileStatus; + public TinTypeEnum getTinType() { + return tinType; } - public void setStateEfileStatus(List stateEfileStatus) { - this.stateEfileStatus = stateEfileStatus; + public void setTinType(TinTypeEnum tinType) { + this.tinType = tinType; } - public Form1099Misc postalMail(Boolean postalMail) { - this.postalMail = postalMail; + public Form1099Misc recipientSecondName(String recipientSecondName) { + this.recipientSecondName = recipientSecondName; return this; } /** - * Get postalMail - * @return postalMail + * Recipient second name + * @return recipientSecondName */ @javax.annotation.Nullable - public Boolean getPostalMail() { - return postalMail; + public String getRecipientSecondName() { + return recipientSecondName; } - public void setPostalMail(Boolean postalMail) { - this.postalMail = postalMail; + public void setRecipientSecondName(String recipientSecondName) { + this.recipientSecondName = recipientSecondName; } - public Form1099Misc postalMailStatus(Form1099StatusDetail postalMailStatus) { - this.postalMailStatus = postalMailStatus; + public Form1099Misc address(String address) { + this.address = address; return this; } /** - * Get postalMailStatus - * @return postalMailStatus + * Address. + * @return address */ @javax.annotation.Nullable - public Form1099StatusDetail getPostalMailStatus() { - return postalMailStatus; + public String getAddress() { + return address; } - public void setPostalMailStatus(Form1099StatusDetail postalMailStatus) { - this.postalMailStatus = postalMailStatus; + public void setAddress(String address) { + this.address = address; } - public Form1099Misc tinMatch(Boolean tinMatch) { - this.tinMatch = tinMatch; + public Form1099Misc address2(String address2) { + this.address2 = address2; return this; } /** - * Get tinMatch - * @return tinMatch + * Address line 2. + * @return address2 */ @javax.annotation.Nullable - public Boolean getTinMatch() { - return tinMatch; + public String getAddress2() { + return address2; } - public void setTinMatch(Boolean tinMatch) { - this.tinMatch = tinMatch; + public void setAddress2(String address2) { + this.address2 = address2; } - public Form1099Misc tinMatchStatus(Form1099StatusDetail tinMatchStatus) { - this.tinMatchStatus = tinMatchStatus; + public Form1099Misc city(String city) { + this.city = city; return this; } /** - * Get tinMatchStatus - * @return tinMatchStatus + * City. + * @return city */ @javax.annotation.Nullable - public Form1099StatusDetail getTinMatchStatus() { - return tinMatchStatus; + public String getCity() { + return city; } - public void setTinMatchStatus(Form1099StatusDetail tinMatchStatus) { - this.tinMatchStatus = tinMatchStatus; + public void setCity(String city) { + this.city = city; } - public Form1099Misc addressVerification(Boolean addressVerification) { - this.addressVerification = addressVerification; + public Form1099Misc state(String state) { + this.state = state; return this; } /** - * Get addressVerification - * @return addressVerification + * Two-letter US state or Canadian province code (required for US/CA addresses). + * @return state */ @javax.annotation.Nullable - public Boolean getAddressVerification() { - return addressVerification; + public String getState() { + return state; } - public void setAddressVerification(Boolean addressVerification) { - this.addressVerification = addressVerification; + public void setState(String state) { + this.state = state; } - public Form1099Misc addressVerificationStatus(Form1099StatusDetail addressVerificationStatus) { - this.addressVerificationStatus = addressVerificationStatus; + public Form1099Misc zip(String zip) { + this.zip = zip; return this; } /** - * Get addressVerificationStatus - * @return addressVerificationStatus + * ZIP/postal code. + * @return zip */ @javax.annotation.Nullable - public Form1099StatusDetail getAddressVerificationStatus() { - return addressVerificationStatus; + public String getZip() { + return zip; } - public void setAddressVerificationStatus(Form1099StatusDetail addressVerificationStatus) { - this.addressVerificationStatus = addressVerificationStatus; + public void setZip(String zip) { + this.zip = zip; } - public Form1099Misc eDeliveryStatus(Form1099StatusDetail eDeliveryStatus) { - this.eDeliveryStatus = eDeliveryStatus; + public Form1099Misc email(String email) { + this.email = email; return this; } /** - * Get eDeliveryStatus - * @return eDeliveryStatus + * Recipient's Contact email address. + * @return email */ @javax.annotation.Nullable - public Form1099StatusDetail geteDeliveryStatus() { - return eDeliveryStatus; + public String getEmail() { + return email; } - public void seteDeliveryStatus(Form1099StatusDetail eDeliveryStatus) { - this.eDeliveryStatus = eDeliveryStatus; + public void setEmail(String email) { + this.email = email; } - public Form1099Misc referenceId(String referenceId) { - this.referenceId = referenceId; + public Form1099Misc accountNumber(String accountNumber) { + this.accountNumber = accountNumber; return this; } /** - * Get referenceId - * @return referenceId + * Account number + * @return accountNumber */ @javax.annotation.Nullable - public String getReferenceId() { - return referenceId; + public String getAccountNumber() { + return accountNumber; } - public void setReferenceId(String referenceId) { - this.referenceId = referenceId; + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; } - public Form1099Misc email(String email) { - this.email = email; + public Form1099Misc officeCode(String officeCode) { + this.officeCode = officeCode; return this; } /** - * Get email - * @return email + * Office code + * @return officeCode */ @javax.annotation.Nullable - public String getEmail() { - return email; + public String getOfficeCode() { + return officeCode; } - public void setEmail(String email) { - this.email = email; + public void setOfficeCode(String officeCode) { + this.officeCode = officeCode; } - public Form1099Misc tinType(String tinType) { - this.tinType = tinType; + public Form1099Misc nonUsProvince(String nonUsProvince) { + this.nonUsProvince = nonUsProvince; return this; } /** - * Get tinType - * @return tinType + * Province or region for non-US/CA addresses. + * @return nonUsProvince */ @javax.annotation.Nullable - public String getTinType() { - return tinType; + public String getNonUsProvince() { + return nonUsProvince; } - public void setTinType(String tinType) { - this.tinType = tinType; + public void setNonUsProvince(String nonUsProvince) { + this.nonUsProvince = nonUsProvince; } - public Form1099Misc fatcaFilingRequirement(Boolean fatcaFilingRequirement) { - this.fatcaFilingRequirement = fatcaFilingRequirement; + public Form1099Misc countryCode(String countryCode) { + this.countryCode = countryCode; return this; } /** - * Get fatcaFilingRequirement - * @return fatcaFilingRequirement + * Two-letter IRS country code (e.g., 'US', 'CA'), as defined at https://www.irs.gov/e-file-providers/country-codes. + * @return countryCode */ @javax.annotation.Nullable - public Boolean getFatcaFilingRequirement() { - return fatcaFilingRequirement; + public String getCountryCode() { + return countryCode; } - public void setFatcaFilingRequirement(Boolean fatcaFilingRequirement) { - this.fatcaFilingRequirement = fatcaFilingRequirement; + public void setCountryCode(String countryCode) { + this.countryCode = countryCode; } - public Form1099Misc tin(String tin) { - this.tin = tin; + public Form1099Misc federalEfileDate(LocalDate federalEfileDate) { + this.federalEfileDate = federalEfileDate; return this; } /** - * Get tin - * @return tin + * Date when federal e-filing should be scheduled for this form + * @return federalEfileDate */ @javax.annotation.Nullable - public String getTin() { - return tin; + public LocalDate getFederalEfileDate() { + return federalEfileDate; } - public void setTin(String tin) { - this.tin = tin; + public void setFederalEfileDate(LocalDate federalEfileDate) { + this.federalEfileDate = federalEfileDate; } - public Form1099Misc noTin(Boolean noTin) { - this.noTin = noTin; + public Form1099Misc postalMail(Boolean postalMail) { + this.postalMail = postalMail; return this; } /** - * Get noTin - * @return noTin + * Boolean indicating that postal mailing to the recipient should be scheduled for this form + * @return postalMail */ @javax.annotation.Nullable - public Boolean getNoTin() { - return noTin; + public Boolean getPostalMail() { + return postalMail; } - public void setNoTin(Boolean noTin) { - this.noTin = noTin; + public void setPostalMail(Boolean postalMail) { + this.postalMail = postalMail; } - public Form1099Misc secondTinNotice(Boolean secondTinNotice) { - this.secondTinNotice = secondTinNotice; + public Form1099Misc stateEfileDate(LocalDate stateEfileDate) { + this.stateEfileDate = stateEfileDate; return this; } /** - * Get secondTinNotice - * @return secondTinNotice + * Date when state e-filing should be scheduled for this form + * @return stateEfileDate */ @javax.annotation.Nullable - public Boolean getSecondTinNotice() { - return secondTinNotice; + public LocalDate getStateEfileDate() { + return stateEfileDate; } - public void setSecondTinNotice(Boolean secondTinNotice) { - this.secondTinNotice = secondTinNotice; + public void setStateEfileDate(LocalDate stateEfileDate) { + this.stateEfileDate = stateEfileDate; } - public Form1099Misc recipientName(String recipientName) { - this.recipientName = recipientName; + public Form1099Misc recipientEdeliveryDate(LocalDate recipientEdeliveryDate) { + this.recipientEdeliveryDate = recipientEdeliveryDate; return this; } /** - * Get recipientName - * @return recipientName + * Date when recipient e-delivery should be scheduled for this form + * @return recipientEdeliveryDate */ @javax.annotation.Nullable - public String getRecipientName() { - return recipientName; + public LocalDate getRecipientEdeliveryDate() { + return recipientEdeliveryDate; } - public void setRecipientName(String recipientName) { - this.recipientName = recipientName; + public void setRecipientEdeliveryDate(LocalDate recipientEdeliveryDate) { + this.recipientEdeliveryDate = recipientEdeliveryDate; } - public Form1099Misc recipientSecondName(String recipientSecondName) { - this.recipientSecondName = recipientSecondName; + public Form1099Misc tinMatch(Boolean tinMatch) { + this.tinMatch = tinMatch; return this; } /** - * Get recipientSecondName - * @return recipientSecondName + * Boolean indicating that TIN Matching should be scheduled for this form + * @return tinMatch */ @javax.annotation.Nullable - public String getRecipientSecondName() { - return recipientSecondName; + public Boolean getTinMatch() { + return tinMatch; } - public void setRecipientSecondName(String recipientSecondName) { - this.recipientSecondName = recipientSecondName; + public void setTinMatch(Boolean tinMatch) { + this.tinMatch = tinMatch; } - public Form1099Misc address(String address) { - this.address = address; + public Form1099Misc noTin(Boolean noTin) { + this.noTin = noTin; return this; } /** - * Get address - * @return address + * No TIN indicator + * @return noTin */ @javax.annotation.Nullable - public String getAddress() { - return address; + public Boolean getNoTin() { + return noTin; } - public void setAddress(String address) { - this.address = address; + public void setNoTin(Boolean noTin) { + this.noTin = noTin; } - public Form1099Misc address2(String address2) { - this.address2 = address2; + public Form1099Misc addressVerification(Boolean addressVerification) { + this.addressVerification = addressVerification; return this; } /** - * Get address2 - * @return address2 + * Boolean indicating that address verification should be scheduled for this form + * @return addressVerification */ @javax.annotation.Nullable - public String getAddress2() { - return address2; + public Boolean getAddressVerification() { + return addressVerification; } - public void setAddress2(String address2) { - this.address2 = address2; + public void setAddressVerification(Boolean addressVerification) { + this.addressVerification = addressVerification; } - public Form1099Misc city(String city) { - this.city = city; + public Form1099Misc stateAndLocalWithholding(StateAndLocalWithholding stateAndLocalWithholding) { + this.stateAndLocalWithholding = stateAndLocalWithholding; return this; } /** - * Get city - * @return city + * State and local withholding information + * @return stateAndLocalWithholding */ @javax.annotation.Nullable - public String getCity() { - return city; + public StateAndLocalWithholding getStateAndLocalWithholding() { + return stateAndLocalWithholding; } - public void setCity(String city) { - this.city = city; + public void setStateAndLocalWithholding(StateAndLocalWithholding stateAndLocalWithholding) { + this.stateAndLocalWithholding = stateAndLocalWithholding; } - public Form1099Misc state(String state) { - this.state = state; + public Form1099Misc secondTinNotice(Boolean secondTinNotice) { + this.secondTinNotice = secondTinNotice; return this; } /** - * Get state - * @return state + * Second TIN notice + * @return secondTinNotice */ @javax.annotation.Nullable - public String getState() { - return state; + public Boolean getSecondTinNotice() { + return secondTinNotice; } - public void setState(String state) { - this.state = state; + public void setSecondTinNotice(Boolean secondTinNotice) { + this.secondTinNotice = secondTinNotice; } - public Form1099Misc zip(String zip) { - this.zip = zip; - return this; - } - /** - * Get zip - * @return zip + * Federal e-file status + * @return federalEfileStatus */ @javax.annotation.Nullable - public String getZip() { - return zip; + public Form1099StatusDetail getFederalEfileStatus() { + return federalEfileStatus; } - public void setZip(String zip) { - this.zip = zip; - } - public Form1099Misc nonUsProvince(String nonUsProvince) { - this.nonUsProvince = nonUsProvince; - return this; - } - /** - * Get nonUsProvince - * @return nonUsProvince + * State e-file status + * @return stateEfileStatus */ @javax.annotation.Nullable - public String getNonUsProvince() { - return nonUsProvince; - } - - public void setNonUsProvince(String nonUsProvince) { - this.nonUsProvince = nonUsProvince; + public List getStateEfileStatus() { + return stateEfileStatus; } - public Form1099Misc countryCode(String countryCode) { - this.countryCode = countryCode; - return this; - } /** - * Get countryCode - * @return countryCode + * Postal mail to recipient status + * @return postalMailStatus */ @javax.annotation.Nullable - public String getCountryCode() { - return countryCode; - } - - public void setCountryCode(String countryCode) { - this.countryCode = countryCode; + public Form1099StatusDetail getPostalMailStatus() { + return postalMailStatus; } - public Form1099Misc accountNumber(String accountNumber) { - this.accountNumber = accountNumber; - return this; - } /** - * Get accountNumber - * @return accountNumber + * TIN Match status + * @return tinMatchStatus */ @javax.annotation.Nullable - public String getAccountNumber() { - return accountNumber; - } - - public void setAccountNumber(String accountNumber) { - this.accountNumber = accountNumber; + public Form1099StatusDetail getTinMatchStatus() { + return tinMatchStatus; } - public Form1099Misc officeCode(String officeCode) { - this.officeCode = officeCode; - return this; - } /** - * Get officeCode - * @return officeCode + * Address verification status + * @return addressVerificationStatus */ @javax.annotation.Nullable - public String getOfficeCode() { - return officeCode; + public Form1099StatusDetail getAddressVerificationStatus() { + return addressVerificationStatus; } - public void setOfficeCode(String officeCode) { - this.officeCode = officeCode; - } - public Form1099Misc validationErrors(List validationErrors) { - this.validationErrors = validationErrors; - return this; + /** + * EDelivery status + * @return eDeliveryStatus + */ + @javax.annotation.Nullable + public Form1099StatusDetail geteDeliveryStatus() { + return eDeliveryStatus; } - public Form1099Misc addValidationErrorsItem(ValidationError validationErrorsItem) { - if (this.validationErrors == null) { - this.validationErrors = new ArrayList<>(); - } - this.validationErrors.add(validationErrorsItem); - return this; - } + /** - * Get validationErrors + * Validation errors * @return validationErrors */ @javax.annotation.Nullable @@ -1241,18 +1356,10 @@ public List getValidationErrors() { return validationErrors; } - public void setValidationErrors(List validationErrors) { - this.validationErrors = validationErrors; - } - public Form1099Misc createdAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - return this; - } - /** - * Get createdAt + * Date time when the record was created. * @return createdAt */ @javax.annotation.Nullable @@ -1260,18 +1367,10 @@ public OffsetDateTime getCreatedAt() { return createdAt; } - public void setCreatedAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - } - public Form1099Misc updatedAt(OffsetDateTime updatedAt) { - this.updatedAt = updatedAt; - return this; - } - /** - * Get updatedAt + * Date time when the record was last updated. * @return updatedAt */ @javax.annotation.Nullable @@ -1279,28 +1378,6 @@ public OffsetDateTime getUpdatedAt() { return updatedAt; } - public void setUpdatedAt(OffsetDateTime updatedAt) { - this.updatedAt = updatedAt; - } - - - public Form1099Misc stateAndLocalWithholding(StateAndLocalWithholding stateAndLocalWithholding) { - this.stateAndLocalWithholding = stateAndLocalWithholding; - return this; - } - - /** - * Get stateAndLocalWithholding - * @return stateAndLocalWithholding - */ - @javax.annotation.Nullable - public StateAndLocalWithholding getStateAndLocalWithholding() { - return stateAndLocalWithholding; - } - - public void setStateAndLocalWithholding(StateAndLocalWithholding stateAndLocalWithholding) { - this.stateAndLocalWithholding = stateAndLocalWithholding; - } @@ -1316,56 +1393,57 @@ public boolean equals(Object o) { return Objects.equals(this.rents, form1099Misc.rents) && Objects.equals(this.royalties, form1099Misc.royalties) && Objects.equals(this.otherIncome, form1099Misc.otherIncome) && - Objects.equals(this.fedIncomeTaxWithheld, form1099Misc.fedIncomeTaxWithheld) && + Objects.equals(this.federalIncomeTaxWithheld, form1099Misc.federalIncomeTaxWithheld) && Objects.equals(this.fishingBoatProceeds, form1099Misc.fishingBoatProceeds) && Objects.equals(this.medicalAndHealthCarePayments, form1099Misc.medicalAndHealthCarePayments) && - Objects.equals(this.substitutePayments, form1099Misc.substitutePayments) && Objects.equals(this.directSalesIndicator, form1099Misc.directSalesIndicator) && + Objects.equals(this.substitutePayments, form1099Misc.substitutePayments) && Objects.equals(this.cropInsuranceProceeds, form1099Misc.cropInsuranceProceeds) && - Objects.equals(this.excessGoldenParachutePayments, form1099Misc.excessGoldenParachutePayments) && Objects.equals(this.grossProceedsPaidToAttorney, form1099Misc.grossProceedsPaidToAttorney) && Objects.equals(this.fishPurchasedForResale, form1099Misc.fishPurchasedForResale) && Objects.equals(this.section409ADeferrals, form1099Misc.section409ADeferrals) && + Objects.equals(this.excessGoldenParachutePayments, form1099Misc.excessGoldenParachutePayments) && Objects.equals(this.nonqualifiedDeferredCompensation, form1099Misc.nonqualifiedDeferredCompensation) && - Objects.equals(this.id, form1099Misc.id) && + Objects.equals(this.fatcaFilingRequirement, form1099Misc.fatcaFilingRequirement) && Objects.equals(this.type, form1099Misc.type) && + Objects.equals(this.id, form1099Misc.id) && Objects.equals(this.issuerId, form1099Misc.issuerId) && Objects.equals(this.issuerReferenceId, form1099Misc.issuerReferenceId) && Objects.equals(this.issuerTin, form1099Misc.issuerTin) && Objects.equals(this.taxYear, form1099Misc.taxYear) && - Objects.equals(this.federalEfile, form1099Misc.federalEfile) && - Objects.equals(this.federalEfileStatus, form1099Misc.federalEfileStatus) && - Objects.equals(this.stateEfile, form1099Misc.stateEfile) && - Objects.equals(this.stateEfileStatus, form1099Misc.stateEfileStatus) && - Objects.equals(this.postalMail, form1099Misc.postalMail) && - Objects.equals(this.postalMailStatus, form1099Misc.postalMailStatus) && - Objects.equals(this.tinMatch, form1099Misc.tinMatch) && - Objects.equals(this.tinMatchStatus, form1099Misc.tinMatchStatus) && - Objects.equals(this.addressVerification, form1099Misc.addressVerification) && - Objects.equals(this.addressVerificationStatus, form1099Misc.addressVerificationStatus) && - Objects.equals(this.eDeliveryStatus, form1099Misc.eDeliveryStatus) && Objects.equals(this.referenceId, form1099Misc.referenceId) && - Objects.equals(this.email, form1099Misc.email) && - Objects.equals(this.tinType, form1099Misc.tinType) && - Objects.equals(this.fatcaFilingRequirement, form1099Misc.fatcaFilingRequirement) && Objects.equals(this.tin, form1099Misc.tin) && - Objects.equals(this.noTin, form1099Misc.noTin) && - Objects.equals(this.secondTinNotice, form1099Misc.secondTinNotice) && Objects.equals(this.recipientName, form1099Misc.recipientName) && + Objects.equals(this.tinType, form1099Misc.tinType) && Objects.equals(this.recipientSecondName, form1099Misc.recipientSecondName) && Objects.equals(this.address, form1099Misc.address) && Objects.equals(this.address2, form1099Misc.address2) && Objects.equals(this.city, form1099Misc.city) && Objects.equals(this.state, form1099Misc.state) && Objects.equals(this.zip, form1099Misc.zip) && - Objects.equals(this.nonUsProvince, form1099Misc.nonUsProvince) && - Objects.equals(this.countryCode, form1099Misc.countryCode) && + Objects.equals(this.email, form1099Misc.email) && Objects.equals(this.accountNumber, form1099Misc.accountNumber) && Objects.equals(this.officeCode, form1099Misc.officeCode) && + Objects.equals(this.nonUsProvince, form1099Misc.nonUsProvince) && + Objects.equals(this.countryCode, form1099Misc.countryCode) && + Objects.equals(this.federalEfileDate, form1099Misc.federalEfileDate) && + Objects.equals(this.postalMail, form1099Misc.postalMail) && + Objects.equals(this.stateEfileDate, form1099Misc.stateEfileDate) && + Objects.equals(this.recipientEdeliveryDate, form1099Misc.recipientEdeliveryDate) && + Objects.equals(this.tinMatch, form1099Misc.tinMatch) && + Objects.equals(this.noTin, form1099Misc.noTin) && + Objects.equals(this.addressVerification, form1099Misc.addressVerification) && + Objects.equals(this.stateAndLocalWithholding, form1099Misc.stateAndLocalWithholding) && + Objects.equals(this.secondTinNotice, form1099Misc.secondTinNotice) && + Objects.equals(this.federalEfileStatus, form1099Misc.federalEfileStatus) && + Objects.equals(this.stateEfileStatus, form1099Misc.stateEfileStatus) && + Objects.equals(this.postalMailStatus, form1099Misc.postalMailStatus) && + Objects.equals(this.tinMatchStatus, form1099Misc.tinMatchStatus) && + Objects.equals(this.addressVerificationStatus, form1099Misc.addressVerificationStatus) && + Objects.equals(this.eDeliveryStatus, form1099Misc.eDeliveryStatus) && Objects.equals(this.validationErrors, form1099Misc.validationErrors) && Objects.equals(this.createdAt, form1099Misc.createdAt) && - Objects.equals(this.updatedAt, form1099Misc.updatedAt) && - Objects.equals(this.stateAndLocalWithholding, form1099Misc.stateAndLocalWithholding); + Objects.equals(this.updatedAt, form1099Misc.updatedAt); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -1374,7 +1452,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(rents, royalties, otherIncome, fedIncomeTaxWithheld, fishingBoatProceeds, medicalAndHealthCarePayments, substitutePayments, directSalesIndicator, cropInsuranceProceeds, excessGoldenParachutePayments, grossProceedsPaidToAttorney, fishPurchasedForResale, section409ADeferrals, nonqualifiedDeferredCompensation, id, type, issuerId, issuerReferenceId, issuerTin, taxYear, federalEfile, federalEfileStatus, stateEfile, stateEfileStatus, postalMail, postalMailStatus, tinMatch, tinMatchStatus, addressVerification, addressVerificationStatus, eDeliveryStatus, referenceId, email, tinType, fatcaFilingRequirement, tin, noTin, secondTinNotice, recipientName, recipientSecondName, address, address2, city, state, zip, nonUsProvince, countryCode, accountNumber, officeCode, validationErrors, createdAt, updatedAt, stateAndLocalWithholding); + return Objects.hash(rents, royalties, otherIncome, federalIncomeTaxWithheld, fishingBoatProceeds, medicalAndHealthCarePayments, directSalesIndicator, substitutePayments, cropInsuranceProceeds, grossProceedsPaidToAttorney, fishPurchasedForResale, section409ADeferrals, excessGoldenParachutePayments, nonqualifiedDeferredCompensation, fatcaFilingRequirement, type, id, issuerId, issuerReferenceId, issuerTin, taxYear, referenceId, tin, recipientName, tinType, recipientSecondName, address, address2, city, state, zip, email, accountNumber, officeCode, nonUsProvince, countryCode, federalEfileDate, postalMail, stateEfileDate, recipientEdeliveryDate, tinMatch, noTin, addressVerification, stateAndLocalWithholding, secondTinNotice, federalEfileStatus, stateEfileStatus, postalMailStatus, tinMatchStatus, addressVerificationStatus, eDeliveryStatus, validationErrors, createdAt, updatedAt); } private static int hashCodeNullable(JsonNullable a) { @@ -1391,56 +1469,57 @@ public String toString() { sb.append(" rents: ").append(toIndentedString(rents)).append("\n"); sb.append(" royalties: ").append(toIndentedString(royalties)).append("\n"); sb.append(" otherIncome: ").append(toIndentedString(otherIncome)).append("\n"); - sb.append(" fedIncomeTaxWithheld: ").append(toIndentedString(fedIncomeTaxWithheld)).append("\n"); + sb.append(" federalIncomeTaxWithheld: ").append(toIndentedString(federalIncomeTaxWithheld)).append("\n"); sb.append(" fishingBoatProceeds: ").append(toIndentedString(fishingBoatProceeds)).append("\n"); sb.append(" medicalAndHealthCarePayments: ").append(toIndentedString(medicalAndHealthCarePayments)).append("\n"); - sb.append(" substitutePayments: ").append(toIndentedString(substitutePayments)).append("\n"); sb.append(" directSalesIndicator: ").append(toIndentedString(directSalesIndicator)).append("\n"); + sb.append(" substitutePayments: ").append(toIndentedString(substitutePayments)).append("\n"); sb.append(" cropInsuranceProceeds: ").append(toIndentedString(cropInsuranceProceeds)).append("\n"); - sb.append(" excessGoldenParachutePayments: ").append(toIndentedString(excessGoldenParachutePayments)).append("\n"); sb.append(" grossProceedsPaidToAttorney: ").append(toIndentedString(grossProceedsPaidToAttorney)).append("\n"); sb.append(" fishPurchasedForResale: ").append(toIndentedString(fishPurchasedForResale)).append("\n"); sb.append(" section409ADeferrals: ").append(toIndentedString(section409ADeferrals)).append("\n"); + sb.append(" excessGoldenParachutePayments: ").append(toIndentedString(excessGoldenParachutePayments)).append("\n"); sb.append(" nonqualifiedDeferredCompensation: ").append(toIndentedString(nonqualifiedDeferredCompensation)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" fatcaFilingRequirement: ").append(toIndentedString(fatcaFilingRequirement)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" issuerId: ").append(toIndentedString(issuerId)).append("\n"); sb.append(" issuerReferenceId: ").append(toIndentedString(issuerReferenceId)).append("\n"); sb.append(" issuerTin: ").append(toIndentedString(issuerTin)).append("\n"); sb.append(" taxYear: ").append(toIndentedString(taxYear)).append("\n"); - sb.append(" federalEfile: ").append(toIndentedString(federalEfile)).append("\n"); - sb.append(" federalEfileStatus: ").append(toIndentedString(federalEfileStatus)).append("\n"); - sb.append(" stateEfile: ").append(toIndentedString(stateEfile)).append("\n"); - sb.append(" stateEfileStatus: ").append(toIndentedString(stateEfileStatus)).append("\n"); - sb.append(" postalMail: ").append(toIndentedString(postalMail)).append("\n"); - sb.append(" postalMailStatus: ").append(toIndentedString(postalMailStatus)).append("\n"); - sb.append(" tinMatch: ").append(toIndentedString(tinMatch)).append("\n"); - sb.append(" tinMatchStatus: ").append(toIndentedString(tinMatchStatus)).append("\n"); - sb.append(" addressVerification: ").append(toIndentedString(addressVerification)).append("\n"); - sb.append(" addressVerificationStatus: ").append(toIndentedString(addressVerificationStatus)).append("\n"); - sb.append(" eDeliveryStatus: ").append(toIndentedString(eDeliveryStatus)).append("\n"); sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" tinType: ").append(toIndentedString(tinType)).append("\n"); - sb.append(" fatcaFilingRequirement: ").append(toIndentedString(fatcaFilingRequirement)).append("\n"); sb.append(" tin: ").append(toIndentedString(tin)).append("\n"); - sb.append(" noTin: ").append(toIndentedString(noTin)).append("\n"); - sb.append(" secondTinNotice: ").append(toIndentedString(secondTinNotice)).append("\n"); sb.append(" recipientName: ").append(toIndentedString(recipientName)).append("\n"); + sb.append(" tinType: ").append(toIndentedString(tinType)).append("\n"); sb.append(" recipientSecondName: ").append(toIndentedString(recipientSecondName)).append("\n"); sb.append(" address: ").append(toIndentedString(address)).append("\n"); sb.append(" address2: ").append(toIndentedString(address2)).append("\n"); sb.append(" city: ").append(toIndentedString(city)).append("\n"); sb.append(" state: ").append(toIndentedString(state)).append("\n"); sb.append(" zip: ").append(toIndentedString(zip)).append("\n"); - sb.append(" nonUsProvince: ").append(toIndentedString(nonUsProvince)).append("\n"); - sb.append(" countryCode: ").append(toIndentedString(countryCode)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); sb.append(" officeCode: ").append(toIndentedString(officeCode)).append("\n"); + sb.append(" nonUsProvince: ").append(toIndentedString(nonUsProvince)).append("\n"); + sb.append(" countryCode: ").append(toIndentedString(countryCode)).append("\n"); + sb.append(" federalEfileDate: ").append(toIndentedString(federalEfileDate)).append("\n"); + sb.append(" postalMail: ").append(toIndentedString(postalMail)).append("\n"); + sb.append(" stateEfileDate: ").append(toIndentedString(stateEfileDate)).append("\n"); + sb.append(" recipientEdeliveryDate: ").append(toIndentedString(recipientEdeliveryDate)).append("\n"); + sb.append(" tinMatch: ").append(toIndentedString(tinMatch)).append("\n"); + sb.append(" noTin: ").append(toIndentedString(noTin)).append("\n"); + sb.append(" addressVerification: ").append(toIndentedString(addressVerification)).append("\n"); + sb.append(" stateAndLocalWithholding: ").append(toIndentedString(stateAndLocalWithholding)).append("\n"); + sb.append(" secondTinNotice: ").append(toIndentedString(secondTinNotice)).append("\n"); + sb.append(" federalEfileStatus: ").append(toIndentedString(federalEfileStatus)).append("\n"); + sb.append(" stateEfileStatus: ").append(toIndentedString(stateEfileStatus)).append("\n"); + sb.append(" postalMailStatus: ").append(toIndentedString(postalMailStatus)).append("\n"); + sb.append(" tinMatchStatus: ").append(toIndentedString(tinMatchStatus)).append("\n"); + sb.append(" addressVerificationStatus: ").append(toIndentedString(addressVerificationStatus)).append("\n"); + sb.append(" eDeliveryStatus: ").append(toIndentedString(eDeliveryStatus)).append("\n"); sb.append(" validationErrors: ").append(toIndentedString(validationErrors)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append(" stateAndLocalWithholding: ").append(toIndentedString(stateAndLocalWithholding)).append("\n"); sb.append("}"); return sb.toString(); } @@ -1463,48 +1542,53 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("id"); openapiFields.add("type"); + openapiFields.add("id"); openapiFields.add("issuerId"); openapiFields.add("issuerReferenceId"); openapiFields.add("issuerTin"); openapiFields.add("taxYear"); - openapiFields.add("federalEfile"); - openapiFields.add("federalEfileStatus"); - openapiFields.add("stateEfile"); - openapiFields.add("stateEfileStatus"); - openapiFields.add("postalMail"); - openapiFields.add("postalMailStatus"); - openapiFields.add("tinMatch"); - openapiFields.add("tinMatchStatus"); - openapiFields.add("addressVerification"); - openapiFields.add("addressVerificationStatus"); - openapiFields.add("eDeliveryStatus"); openapiFields.add("referenceId"); - openapiFields.add("email"); - openapiFields.add("tinType"); - openapiFields.add("fatcaFilingRequirement"); openapiFields.add("tin"); - openapiFields.add("noTin"); - openapiFields.add("secondTinNotice"); openapiFields.add("recipientName"); + openapiFields.add("tinType"); openapiFields.add("recipientSecondName"); openapiFields.add("address"); openapiFields.add("address2"); openapiFields.add("city"); openapiFields.add("state"); openapiFields.add("zip"); - openapiFields.add("nonUsProvince"); - openapiFields.add("countryCode"); + openapiFields.add("email"); openapiFields.add("accountNumber"); openapiFields.add("officeCode"); + openapiFields.add("nonUsProvince"); + openapiFields.add("countryCode"); + openapiFields.add("federalEfileDate"); + openapiFields.add("postalMail"); + openapiFields.add("stateEfileDate"); + openapiFields.add("recipientEdeliveryDate"); + openapiFields.add("tinMatch"); + openapiFields.add("noTin"); + openapiFields.add("addressVerification"); + openapiFields.add("stateAndLocalWithholding"); + openapiFields.add("secondTinNotice"); + openapiFields.add("federalEfileStatus"); + openapiFields.add("stateEfileStatus"); + openapiFields.add("postalMailStatus"); + openapiFields.add("tinMatchStatus"); + openapiFields.add("addressVerificationStatus"); + openapiFields.add("eDeliveryStatus"); openapiFields.add("validationErrors"); openapiFields.add("createdAt"); openapiFields.add("updatedAt"); - openapiFields.add("stateAndLocalWithholding"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("recipientName"); + openapiRequiredFields.add("address"); + openapiRequiredFields.add("city"); + openapiRequiredFields.add("countryCode"); } /** @@ -1527,12 +1611,24 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Form1099Misc` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Form1099Misc.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("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); 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("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + if ((jsonObj.get("issuerId") != null && !jsonObj.get("issuerId").isJsonNull()) && !jsonObj.get("issuerId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `issuerId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerId").toString())); } if ((jsonObj.get("issuerReferenceId") != null && !jsonObj.get("issuerReferenceId").isJsonNull()) && !jsonObj.get("issuerReferenceId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `issuerReferenceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerReferenceId").toString())); @@ -1540,55 +1636,22 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("issuerTin") != null && !jsonObj.get("issuerTin").isJsonNull()) && !jsonObj.get("issuerTin").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `issuerTin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerTin").toString())); } - // validate the optional field `federalEfileStatus` - if (jsonObj.get("federalEfileStatus") != null && !jsonObj.get("federalEfileStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("federalEfileStatus")); - } - if (jsonObj.get("stateEfileStatus") != null && !jsonObj.get("stateEfileStatus").isJsonNull()) { - JsonArray jsonArraystateEfileStatus = jsonObj.getAsJsonArray("stateEfileStatus"); - if (jsonArraystateEfileStatus != null) { - // ensure the json data is an array - if (!jsonObj.get("stateEfileStatus").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `stateEfileStatus` to be an array in the JSON string but got `%s`", jsonObj.get("stateEfileStatus").toString())); - } - - // validate the optional field `stateEfileStatus` (array) - for (int i = 0; i < jsonArraystateEfileStatus.size(); i++) { - StateEfileStatusDetail.validateJsonElement(jsonArraystateEfileStatus.get(i)); - }; - } - } - // validate the optional field `postalMailStatus` - if (jsonObj.get("postalMailStatus") != null && !jsonObj.get("postalMailStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("postalMailStatus")); - } - // validate the optional field `tinMatchStatus` - if (jsonObj.get("tinMatchStatus") != null && !jsonObj.get("tinMatchStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("tinMatchStatus")); - } - // validate the optional field `addressVerificationStatus` - if (jsonObj.get("addressVerificationStatus") != null && !jsonObj.get("addressVerificationStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("addressVerificationStatus")); - } - // validate the optional field `eDeliveryStatus` - if (jsonObj.get("eDeliveryStatus") != null && !jsonObj.get("eDeliveryStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("eDeliveryStatus")); - } if ((jsonObj.get("referenceId") != null && !jsonObj.get("referenceId").isJsonNull()) && !jsonObj.get("referenceId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `referenceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("referenceId").toString())); } - if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); - } - if ((jsonObj.get("tinType") != null && !jsonObj.get("tinType").isJsonNull()) && !jsonObj.get("tinType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `tinType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tinType").toString())); - } if ((jsonObj.get("tin") != null && !jsonObj.get("tin").isJsonNull()) && !jsonObj.get("tin").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `tin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tin").toString())); } if ((jsonObj.get("recipientName") != null && !jsonObj.get("recipientName").isJsonNull()) && !jsonObj.get("recipientName").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `recipientName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientName").toString())); } + if ((jsonObj.get("tinType") != null && !jsonObj.get("tinType").isJsonNull()) && !jsonObj.get("tinType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `tinType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tinType").toString())); + } + // validate the optional field `tinType` + if (jsonObj.get("tinType") != null && !jsonObj.get("tinType").isJsonNull()) { + TinTypeEnum.validateJsonElement(jsonObj.get("tinType")); + } if ((jsonObj.get("recipientSecondName") != null && !jsonObj.get("recipientSecondName").isJsonNull()) && !jsonObj.get("recipientSecondName").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `recipientSecondName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientSecondName").toString())); } @@ -1607,17 +1670,58 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("zip") != null && !jsonObj.get("zip").isJsonNull()) && !jsonObj.get("zip").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `zip` to be a primitive type in the JSON string but got `%s`", jsonObj.get("zip").toString())); } + if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if ((jsonObj.get("accountNumber") != null && !jsonObj.get("accountNumber").isJsonNull()) && !jsonObj.get("accountNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); + } + if ((jsonObj.get("officeCode") != null && !jsonObj.get("officeCode").isJsonNull()) && !jsonObj.get("officeCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `officeCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("officeCode").toString())); + } if ((jsonObj.get("nonUsProvince") != null && !jsonObj.get("nonUsProvince").isJsonNull()) && !jsonObj.get("nonUsProvince").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `nonUsProvince` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nonUsProvince").toString())); } if ((jsonObj.get("countryCode") != null && !jsonObj.get("countryCode").isJsonNull()) && !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("accountNumber") != null && !jsonObj.get("accountNumber").isJsonNull()) && !jsonObj.get("accountNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); + // validate the optional field `stateAndLocalWithholding` + if (jsonObj.get("stateAndLocalWithholding") != null && !jsonObj.get("stateAndLocalWithholding").isJsonNull()) { + StateAndLocalWithholding.validateJsonElement(jsonObj.get("stateAndLocalWithholding")); } - if ((jsonObj.get("officeCode") != null && !jsonObj.get("officeCode").isJsonNull()) && !jsonObj.get("officeCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `officeCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("officeCode").toString())); + // validate the optional field `federalEfileStatus` + if (jsonObj.get("federalEfileStatus") != null && !jsonObj.get("federalEfileStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("federalEfileStatus")); + } + if (jsonObj.get("stateEfileStatus") != null && !jsonObj.get("stateEfileStatus").isJsonNull()) { + JsonArray jsonArraystateEfileStatus = jsonObj.getAsJsonArray("stateEfileStatus"); + if (jsonArraystateEfileStatus != null) { + // ensure the json data is an array + if (!jsonObj.get("stateEfileStatus").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `stateEfileStatus` to be an array in the JSON string but got `%s`", jsonObj.get("stateEfileStatus").toString())); + } + + // validate the optional field `stateEfileStatus` (array) + for (int i = 0; i < jsonArraystateEfileStatus.size(); i++) { + StateEfileStatusDetail.validateJsonElement(jsonArraystateEfileStatus.get(i)); + }; + } + } + // validate the optional field `postalMailStatus` + if (jsonObj.get("postalMailStatus") != null && !jsonObj.get("postalMailStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("postalMailStatus")); + } + // validate the optional field `tinMatchStatus` + if (jsonObj.get("tinMatchStatus") != null && !jsonObj.get("tinMatchStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("tinMatchStatus")); + } + // validate the optional field `addressVerificationStatus` + if (jsonObj.get("addressVerificationStatus") != null && !jsonObj.get("addressVerificationStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("addressVerificationStatus")); + } + // validate the optional field `eDeliveryStatus` + if (jsonObj.get("eDeliveryStatus") != null && !jsonObj.get("eDeliveryStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("eDeliveryStatus")); } if (jsonObj.get("validationErrors") != null && !jsonObj.get("validationErrors").isJsonNull()) { JsonArray jsonArrayvalidationErrors = jsonObj.getAsJsonArray("validationErrors"); @@ -1633,10 +1737,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti }; } } - // validate the optional field `stateAndLocalWithholding` - if (jsonObj.get("stateAndLocalWithholding") != null && !jsonObj.get("stateAndLocalWithholding").isJsonNull()) { - StateAndLocalWithholding.validateJsonElement(jsonObj.get("stateAndLocalWithholding")); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/Form1099Nec.java b/src/main/java/Avalara/SDK/model/A1099/V2/Form1099Nec.java index 08f576d..03f1c2e 100644 --- a/src/main/java/Avalara/SDK/model/A1099/V2/Form1099Nec.java +++ b/src/main/java/Avalara/SDK/model/A1099/V2/Form1099Nec.java @@ -30,6 +30,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.Arrays; @@ -69,25 +70,91 @@ public class Form1099Nec { @SerializedName(SERIALIZED_NAME_NONEMPLOYEE_COMPENSATION) private Double nonemployeeCompensation; + public static final String SERIALIZED_NAME_DIRECT_SALES_INDICATOR = "directSalesIndicator"; + @SerializedName(SERIALIZED_NAME_DIRECT_SALES_INDICATOR) + private Boolean directSalesIndicator; + public static final String SERIALIZED_NAME_FEDERAL_INCOME_TAX_WITHHELD = "federalIncomeTaxWithheld"; @SerializedName(SERIALIZED_NAME_FEDERAL_INCOME_TAX_WITHHELD) private Double federalIncomeTaxWithheld; - public static final String SERIALIZED_NAME_DIRECT_SALES_INDICATOR = "directSalesIndicator"; - @SerializedName(SERIALIZED_NAME_DIRECT_SALES_INDICATOR) - private Boolean directSalesIndicator; + /** + * Form type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + _1099_NEC("1099-NEC"), + + _1099_MISC("1099-MISC"), + + _1099_DIV("1099-DIV"), + + _1099_R("1099-R"), + + _1099_K("1099-K"), + + _1095_B("1095-B"), + + _1042_S("1042-S"), + + _1095_C("1095-C"), + + _1099_INT("1099-INT"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.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 TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) - private String type; + private TypeEnum type; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; public static final String SERIALIZED_NAME_ISSUER_ID = "issuerId"; @SerializedName(SERIALIZED_NAME_ISSUER_ID) - private Integer issuerId; + private String issuerId; public static final String SERIALIZED_NAME_ISSUER_REFERENCE_ID = "issuerReferenceId"; @SerializedName(SERIALIZED_NAME_ISSUER_REFERENCE_ID) @@ -101,81 +168,79 @@ public class Form1099Nec { @SerializedName(SERIALIZED_NAME_TAX_YEAR) private Integer taxYear; - public static final String SERIALIZED_NAME_FEDERAL_EFILE = "federalEfile"; - @SerializedName(SERIALIZED_NAME_FEDERAL_EFILE) - private Boolean federalEfile; - - public static final String SERIALIZED_NAME_FEDERAL_EFILE_STATUS = "federalEfileStatus"; - @SerializedName(SERIALIZED_NAME_FEDERAL_EFILE_STATUS) - private Form1099StatusDetail federalEfileStatus; - - public static final String SERIALIZED_NAME_STATE_EFILE = "stateEfile"; - @SerializedName(SERIALIZED_NAME_STATE_EFILE) - private Boolean stateEfile; - - public static final String SERIALIZED_NAME_STATE_EFILE_STATUS = "stateEfileStatus"; - @SerializedName(SERIALIZED_NAME_STATE_EFILE_STATUS) - private List stateEfileStatus; + public static final String SERIALIZED_NAME_REFERENCE_ID = "referenceId"; + @SerializedName(SERIALIZED_NAME_REFERENCE_ID) + private String referenceId; - public static final String SERIALIZED_NAME_POSTAL_MAIL = "postalMail"; - @SerializedName(SERIALIZED_NAME_POSTAL_MAIL) - private Boolean postalMail; + public static final String SERIALIZED_NAME_TIN = "tin"; + @SerializedName(SERIALIZED_NAME_TIN) + private String tin; - public static final String SERIALIZED_NAME_POSTAL_MAIL_STATUS = "postalMailStatus"; - @SerializedName(SERIALIZED_NAME_POSTAL_MAIL_STATUS) - private Form1099StatusDetail postalMailStatus; + public static final String SERIALIZED_NAME_RECIPIENT_NAME = "recipientName"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_NAME) + private String recipientName; - public static final String SERIALIZED_NAME_TIN_MATCH = "tinMatch"; - @SerializedName(SERIALIZED_NAME_TIN_MATCH) - private Boolean tinMatch; + /** + * Type of TIN (Tax ID Number) + */ + @JsonAdapter(TinTypeEnum.Adapter.class) + public enum TinTypeEnum { + EMPTY("Empty"), + + EIN("EIN"), + + SSN("SSN"), + + ITIN("ITIN"), + + ATIN("ATIN"); + + private String value; + + TinTypeEnum(String value) { + this.value = value; + } - public static final String SERIALIZED_NAME_TIN_MATCH_STATUS = "tinMatchStatus"; - @SerializedName(SERIALIZED_NAME_TIN_MATCH_STATUS) - private Form1099StatusDetail tinMatchStatus; + public String getValue() { + return value; + } - public static final String SERIALIZED_NAME_ADDRESS_VERIFICATION = "addressVerification"; - @SerializedName(SERIALIZED_NAME_ADDRESS_VERIFICATION) - private Boolean addressVerification; + @Override + public String toString() { + return String.valueOf(value); + } - public static final String SERIALIZED_NAME_ADDRESS_VERIFICATION_STATUS = "addressVerificationStatus"; - @SerializedName(SERIALIZED_NAME_ADDRESS_VERIFICATION_STATUS) - private Form1099StatusDetail addressVerificationStatus; + public static TinTypeEnum fromValue(String value) { + for (TinTypeEnum b : TinTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } - public static final String SERIALIZED_NAME_E_DELIVERY_STATUS = "eDeliveryStatus"; - @SerializedName(SERIALIZED_NAME_E_DELIVERY_STATUS) - private Form1099StatusDetail eDeliveryStatus; + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TinTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } - public static final String SERIALIZED_NAME_REFERENCE_ID = "referenceId"; - @SerializedName(SERIALIZED_NAME_REFERENCE_ID) - private String referenceId; + @Override + public TinTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TinTypeEnum.fromValue(value); + } + } - public static final String SERIALIZED_NAME_EMAIL = "email"; - @SerializedName(SERIALIZED_NAME_EMAIL) - private String email; + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TinTypeEnum.fromValue(value); + } + } public static final String SERIALIZED_NAME_TIN_TYPE = "tinType"; @SerializedName(SERIALIZED_NAME_TIN_TYPE) - private String tinType; - - public static final String SERIALIZED_NAME_FATCA_FILING_REQUIREMENT = "fatcaFilingRequirement"; - @SerializedName(SERIALIZED_NAME_FATCA_FILING_REQUIREMENT) - private Boolean fatcaFilingRequirement; - - public static final String SERIALIZED_NAME_TIN = "tin"; - @SerializedName(SERIALIZED_NAME_TIN) - private String tin; - - public static final String SERIALIZED_NAME_NO_TIN = "noTin"; - @SerializedName(SERIALIZED_NAME_NO_TIN) - private Boolean noTin; - - public static final String SERIALIZED_NAME_SECOND_TIN_NOTICE = "secondTinNotice"; - @SerializedName(SERIALIZED_NAME_SECOND_TIN_NOTICE) - private Boolean secondTinNotice; - - public static final String SERIALIZED_NAME_RECIPIENT_NAME = "recipientName"; - @SerializedName(SERIALIZED_NAME_RECIPIENT_NAME) - private String recipientName; + private TinTypeEnum tinType; public static final String SERIALIZED_NAME_RECIPIENT_SECOND_NAME = "recipientSecondName"; @SerializedName(SERIALIZED_NAME_RECIPIENT_SECOND_NAME) @@ -201,6 +266,18 @@ public class Form1099Nec { @SerializedName(SERIALIZED_NAME_ZIP) private String zip; + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) + private String accountNumber; + + public static final String SERIALIZED_NAME_OFFICE_CODE = "officeCode"; + @SerializedName(SERIALIZED_NAME_OFFICE_CODE) + private String officeCode; + public static final String SERIALIZED_NAME_NON_US_PROVINCE = "nonUsProvince"; @SerializedName(SERIALIZED_NAME_NON_US_PROVINCE) private String nonUsProvince; @@ -209,13 +286,65 @@ public class Form1099Nec { @SerializedName(SERIALIZED_NAME_COUNTRY_CODE) private String countryCode; - public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; - @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) - private String accountNumber; + public static final String SERIALIZED_NAME_FEDERAL_EFILE_DATE = "federalEfileDate"; + @SerializedName(SERIALIZED_NAME_FEDERAL_EFILE_DATE) + private LocalDate federalEfileDate; - public static final String SERIALIZED_NAME_OFFICE_CODE = "officeCode"; - @SerializedName(SERIALIZED_NAME_OFFICE_CODE) - private String officeCode; + public static final String SERIALIZED_NAME_POSTAL_MAIL = "postalMail"; + @SerializedName(SERIALIZED_NAME_POSTAL_MAIL) + private Boolean postalMail; + + public static final String SERIALIZED_NAME_STATE_EFILE_DATE = "stateEfileDate"; + @SerializedName(SERIALIZED_NAME_STATE_EFILE_DATE) + private LocalDate stateEfileDate; + + public static final String SERIALIZED_NAME_RECIPIENT_EDELIVERY_DATE = "recipientEdeliveryDate"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_EDELIVERY_DATE) + private LocalDate recipientEdeliveryDate; + + public static final String SERIALIZED_NAME_TIN_MATCH = "tinMatch"; + @SerializedName(SERIALIZED_NAME_TIN_MATCH) + private Boolean tinMatch; + + public static final String SERIALIZED_NAME_NO_TIN = "noTin"; + @SerializedName(SERIALIZED_NAME_NO_TIN) + private Boolean noTin; + + public static final String SERIALIZED_NAME_ADDRESS_VERIFICATION = "addressVerification"; + @SerializedName(SERIALIZED_NAME_ADDRESS_VERIFICATION) + private Boolean addressVerification; + + public static final String SERIALIZED_NAME_STATE_AND_LOCAL_WITHHOLDING = "stateAndLocalWithholding"; + @SerializedName(SERIALIZED_NAME_STATE_AND_LOCAL_WITHHOLDING) + private StateAndLocalWithholding stateAndLocalWithholding; + + public static final String SERIALIZED_NAME_SECOND_TIN_NOTICE = "secondTinNotice"; + @SerializedName(SERIALIZED_NAME_SECOND_TIN_NOTICE) + private Boolean secondTinNotice; + + public static final String SERIALIZED_NAME_FEDERAL_EFILE_STATUS = "federalEfileStatus"; + @SerializedName(SERIALIZED_NAME_FEDERAL_EFILE_STATUS) + private Form1099StatusDetail federalEfileStatus; + + public static final String SERIALIZED_NAME_STATE_EFILE_STATUS = "stateEfileStatus"; + @SerializedName(SERIALIZED_NAME_STATE_EFILE_STATUS) + private List stateEfileStatus; + + public static final String SERIALIZED_NAME_POSTAL_MAIL_STATUS = "postalMailStatus"; + @SerializedName(SERIALIZED_NAME_POSTAL_MAIL_STATUS) + private Form1099StatusDetail postalMailStatus; + + public static final String SERIALIZED_NAME_TIN_MATCH_STATUS = "tinMatchStatus"; + @SerializedName(SERIALIZED_NAME_TIN_MATCH_STATUS) + private Form1099StatusDetail tinMatchStatus; + + public static final String SERIALIZED_NAME_ADDRESS_VERIFICATION_STATUS = "addressVerificationStatus"; + @SerializedName(SERIALIZED_NAME_ADDRESS_VERIFICATION_STATUS) + private Form1099StatusDetail addressVerificationStatus; + + public static final String SERIALIZED_NAME_E_DELIVERY_STATUS = "eDeliveryStatus"; + @SerializedName(SERIALIZED_NAME_E_DELIVERY_STATUS) + private Form1099StatusDetail eDeliveryStatus; public static final String SERIALIZED_NAME_VALIDATION_ERRORS = "validationErrors"; @SerializedName(SERIALIZED_NAME_VALIDATION_ERRORS) @@ -229,20 +358,41 @@ public class Form1099Nec { @SerializedName(SERIALIZED_NAME_UPDATED_AT) private OffsetDateTime updatedAt; - public static final String SERIALIZED_NAME_STATE_AND_LOCAL_WITHHOLDING = "stateAndLocalWithholding"; - @SerializedName(SERIALIZED_NAME_STATE_AND_LOCAL_WITHHOLDING) - private StateAndLocalWithholding stateAndLocalWithholding; - public Form1099Nec() { } + public Form1099Nec( + String id, + Form1099StatusDetail federalEfileStatus, + List stateEfileStatus, + Form1099StatusDetail postalMailStatus, + Form1099StatusDetail tinMatchStatus, + Form1099StatusDetail addressVerificationStatus, + Form1099StatusDetail eDeliveryStatus, + List validationErrors, + OffsetDateTime createdAt, + OffsetDateTime updatedAt + ) { + this(); + this.id = id; + this.federalEfileStatus = federalEfileStatus; + this.stateEfileStatus = stateEfileStatus; + this.postalMailStatus = postalMailStatus; + this.tinMatchStatus = tinMatchStatus; + this.addressVerificationStatus = addressVerificationStatus; + this.eDeliveryStatus = eDeliveryStatus; + this.validationErrors = validationErrors; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + public Form1099Nec nonemployeeCompensation(Double nonemployeeCompensation) { this.nonemployeeCompensation = nonemployeeCompensation; return this; } /** - * Get nonemployeeCompensation + * Nonemployee compensation * @return nonemployeeCompensation */ @javax.annotation.Nullable @@ -255,32 +405,13 @@ public void setNonemployeeCompensation(Double nonemployeeCompensation) { } - public Form1099Nec federalIncomeTaxWithheld(Double federalIncomeTaxWithheld) { - this.federalIncomeTaxWithheld = federalIncomeTaxWithheld; - return this; - } - - /** - * Get federalIncomeTaxWithheld - * @return federalIncomeTaxWithheld - */ - @javax.annotation.Nullable - public Double getFederalIncomeTaxWithheld() { - return federalIncomeTaxWithheld; - } - - public void setFederalIncomeTaxWithheld(Double federalIncomeTaxWithheld) { - this.federalIncomeTaxWithheld = federalIncomeTaxWithheld; - } - - public Form1099Nec directSalesIndicator(Boolean directSalesIndicator) { this.directSalesIndicator = directSalesIndicator; return this; } /** - * Get directSalesIndicator + * Payer made direct sales totaling $5,000 or more of consumer products to recipient for resale * @return directSalesIndicator */ @javax.annotation.Nullable @@ -293,59 +424,70 @@ public void setDirectSalesIndicator(Boolean directSalesIndicator) { } - public Form1099Nec id(String id) { - this.id = id; + public Form1099Nec federalIncomeTaxWithheld(Double federalIncomeTaxWithheld) { + this.federalIncomeTaxWithheld = federalIncomeTaxWithheld; return this; } /** - * Get id - * @return id + * Federal income tax withheld + * @return federalIncomeTaxWithheld */ @javax.annotation.Nullable - public String getId() { - return id; + public Double getFederalIncomeTaxWithheld() { + return federalIncomeTaxWithheld; } - public void setId(String id) { - this.id = id; + public void setFederalIncomeTaxWithheld(Double federalIncomeTaxWithheld) { + this.federalIncomeTaxWithheld = federalIncomeTaxWithheld; } - public Form1099Nec type(String type) { + public Form1099Nec type(TypeEnum type) { this.type = type; return this; } /** - * Get type + * Form type * @return type */ - @javax.annotation.Nullable - public String getType() { + @javax.annotation.Nonnull + public TypeEnum getType() { return type; } - public void setType(String type) { + public void setType(TypeEnum type) { this.type = type; } - public Form1099Nec issuerId(Integer issuerId) { + /** + * Form ID. Unique identifier set when the record is created. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + + + public Form1099Nec issuerId(String issuerId) { this.issuerId = issuerId; return this; } /** - * Get issuerId + * Issuer ID - only required when creating forms * @return issuerId */ @javax.annotation.Nullable - public Integer getIssuerId() { + public String getIssuerId() { return issuerId; } - public void setIssuerId(Integer issuerId) { + public void setIssuerId(String issuerId) { this.issuerId = issuerId; } @@ -356,7 +498,7 @@ public Form1099Nec issuerReferenceId(String issuerReferenceId) { } /** - * Get issuerReferenceId + * Issuer Reference ID - only required when creating forms * @return issuerReferenceId */ @javax.annotation.Nullable @@ -375,7 +517,7 @@ public Form1099Nec issuerTin(String issuerTin) { } /** - * Get issuerTin + * Issuer TIN - readonly * @return issuerTin */ @javax.annotation.Nullable @@ -394,7 +536,7 @@ public Form1099Nec taxYear(Integer taxYear) { } /** - * Get taxYear + * Tax Year - only required when creating forms * @return taxYear */ @javax.annotation.Nullable @@ -407,580 +549,530 @@ public void setTaxYear(Integer taxYear) { } - public Form1099Nec federalEfile(Boolean federalEfile) { - this.federalEfile = federalEfile; + public Form1099Nec referenceId(String referenceId) { + this.referenceId = referenceId; return this; } /** - * Get federalEfile - * @return federalEfile + * Internal reference ID. Never shown to any agency or recipient. + * @return referenceId */ @javax.annotation.Nullable - public Boolean getFederalEfile() { - return federalEfile; + public String getReferenceId() { + return referenceId; } - public void setFederalEfile(Boolean federalEfile) { - this.federalEfile = federalEfile; + public void setReferenceId(String referenceId) { + this.referenceId = referenceId; } - public Form1099Nec federalEfileStatus(Form1099StatusDetail federalEfileStatus) { - this.federalEfileStatus = federalEfileStatus; + public Form1099Nec tin(String tin) { + this.tin = tin; return this; } /** - * Get federalEfileStatus - * @return federalEfileStatus + * Recipient's Federal Tax Identification Number (TIN). + * @return tin */ @javax.annotation.Nullable - public Form1099StatusDetail getFederalEfileStatus() { - return federalEfileStatus; + public String getTin() { + return tin; } - public void setFederalEfileStatus(Form1099StatusDetail federalEfileStatus) { - this.federalEfileStatus = federalEfileStatus; + public void setTin(String tin) { + this.tin = tin; } - public Form1099Nec stateEfile(Boolean stateEfile) { - this.stateEfile = stateEfile; + public Form1099Nec recipientName(String recipientName) { + this.recipientName = recipientName; return this; } /** - * Get stateEfile - * @return stateEfile + * Recipient name + * @return recipientName */ @javax.annotation.Nullable - public Boolean getStateEfile() { - return stateEfile; - } - - public void setStateEfile(Boolean stateEfile) { - this.stateEfile = stateEfile; + public String getRecipientName() { + return recipientName; } - - public Form1099Nec stateEfileStatus(List stateEfileStatus) { - this.stateEfileStatus = stateEfileStatus; - return this; + public void setRecipientName(String recipientName) { + this.recipientName = recipientName; } - public Form1099Nec addStateEfileStatusItem(StateEfileStatusDetail stateEfileStatusItem) { - if (this.stateEfileStatus == null) { - this.stateEfileStatus = new ArrayList<>(); - } - this.stateEfileStatus.add(stateEfileStatusItem); + + public Form1099Nec tinType(TinTypeEnum tinType) { + this.tinType = tinType; return this; } /** - * Get stateEfileStatus - * @return stateEfileStatus + * Type of TIN (Tax ID Number) + * @return tinType */ @javax.annotation.Nullable - public List getStateEfileStatus() { - return stateEfileStatus; + public TinTypeEnum getTinType() { + return tinType; } - public void setStateEfileStatus(List stateEfileStatus) { - this.stateEfileStatus = stateEfileStatus; + public void setTinType(TinTypeEnum tinType) { + this.tinType = tinType; } - public Form1099Nec postalMail(Boolean postalMail) { - this.postalMail = postalMail; + public Form1099Nec recipientSecondName(String recipientSecondName) { + this.recipientSecondName = recipientSecondName; return this; } /** - * Get postalMail - * @return postalMail + * Recipient second name + * @return recipientSecondName */ @javax.annotation.Nullable - public Boolean getPostalMail() { - return postalMail; + public String getRecipientSecondName() { + return recipientSecondName; } - public void setPostalMail(Boolean postalMail) { - this.postalMail = postalMail; + public void setRecipientSecondName(String recipientSecondName) { + this.recipientSecondName = recipientSecondName; } - public Form1099Nec postalMailStatus(Form1099StatusDetail postalMailStatus) { - this.postalMailStatus = postalMailStatus; + public Form1099Nec address(String address) { + this.address = address; return this; } /** - * Get postalMailStatus - * @return postalMailStatus + * Address. + * @return address */ @javax.annotation.Nullable - public Form1099StatusDetail getPostalMailStatus() { - return postalMailStatus; + public String getAddress() { + return address; } - public void setPostalMailStatus(Form1099StatusDetail postalMailStatus) { - this.postalMailStatus = postalMailStatus; + public void setAddress(String address) { + this.address = address; } - public Form1099Nec tinMatch(Boolean tinMatch) { - this.tinMatch = tinMatch; + public Form1099Nec address2(String address2) { + this.address2 = address2; return this; } /** - * Get tinMatch - * @return tinMatch + * Address line 2. + * @return address2 */ @javax.annotation.Nullable - public Boolean getTinMatch() { - return tinMatch; + public String getAddress2() { + return address2; } - public void setTinMatch(Boolean tinMatch) { - this.tinMatch = tinMatch; + public void setAddress2(String address2) { + this.address2 = address2; } - public Form1099Nec tinMatchStatus(Form1099StatusDetail tinMatchStatus) { - this.tinMatchStatus = tinMatchStatus; + public Form1099Nec city(String city) { + this.city = city; return this; } /** - * Get tinMatchStatus - * @return tinMatchStatus + * City. + * @return city */ @javax.annotation.Nullable - public Form1099StatusDetail getTinMatchStatus() { - return tinMatchStatus; + public String getCity() { + return city; } - public void setTinMatchStatus(Form1099StatusDetail tinMatchStatus) { - this.tinMatchStatus = tinMatchStatus; + public void setCity(String city) { + this.city = city; } - public Form1099Nec addressVerification(Boolean addressVerification) { - this.addressVerification = addressVerification; + public Form1099Nec state(String state) { + this.state = state; return this; } /** - * Get addressVerification - * @return addressVerification + * Two-letter US state or Canadian province code (required for US/CA addresses). + * @return state */ @javax.annotation.Nullable - public Boolean getAddressVerification() { - return addressVerification; + public String getState() { + return state; } - public void setAddressVerification(Boolean addressVerification) { - this.addressVerification = addressVerification; + public void setState(String state) { + this.state = state; } - public Form1099Nec addressVerificationStatus(Form1099StatusDetail addressVerificationStatus) { - this.addressVerificationStatus = addressVerificationStatus; + public Form1099Nec zip(String zip) { + this.zip = zip; return this; } /** - * Get addressVerificationStatus - * @return addressVerificationStatus + * ZIP/postal code. + * @return zip */ @javax.annotation.Nullable - public Form1099StatusDetail getAddressVerificationStatus() { - return addressVerificationStatus; + public String getZip() { + return zip; } - public void setAddressVerificationStatus(Form1099StatusDetail addressVerificationStatus) { - this.addressVerificationStatus = addressVerificationStatus; + public void setZip(String zip) { + this.zip = zip; } - public Form1099Nec eDeliveryStatus(Form1099StatusDetail eDeliveryStatus) { - this.eDeliveryStatus = eDeliveryStatus; + public Form1099Nec email(String email) { + this.email = email; return this; } /** - * Get eDeliveryStatus - * @return eDeliveryStatus + * Recipient's Contact email address. + * @return email */ @javax.annotation.Nullable - public Form1099StatusDetail geteDeliveryStatus() { - return eDeliveryStatus; + public String getEmail() { + return email; } - public void seteDeliveryStatus(Form1099StatusDetail eDeliveryStatus) { - this.eDeliveryStatus = eDeliveryStatus; + public void setEmail(String email) { + this.email = email; } - public Form1099Nec referenceId(String referenceId) { - this.referenceId = referenceId; + public Form1099Nec accountNumber(String accountNumber) { + this.accountNumber = accountNumber; return this; } /** - * Get referenceId - * @return referenceId + * Account number + * @return accountNumber */ @javax.annotation.Nullable - public String getReferenceId() { - return referenceId; + public String getAccountNumber() { + return accountNumber; } - public void setReferenceId(String referenceId) { - this.referenceId = referenceId; + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; } - public Form1099Nec email(String email) { - this.email = email; + public Form1099Nec officeCode(String officeCode) { + this.officeCode = officeCode; return this; } /** - * Get email - * @return email + * Office code + * @return officeCode */ @javax.annotation.Nullable - public String getEmail() { - return email; + public String getOfficeCode() { + return officeCode; } - public void setEmail(String email) { - this.email = email; + public void setOfficeCode(String officeCode) { + this.officeCode = officeCode; } - public Form1099Nec tinType(String tinType) { - this.tinType = tinType; + public Form1099Nec nonUsProvince(String nonUsProvince) { + this.nonUsProvince = nonUsProvince; return this; } /** - * Get tinType - * @return tinType + * Province or region for non-US/CA addresses. + * @return nonUsProvince */ @javax.annotation.Nullable - public String getTinType() { - return tinType; + public String getNonUsProvince() { + return nonUsProvince; } - public void setTinType(String tinType) { - this.tinType = tinType; + public void setNonUsProvince(String nonUsProvince) { + this.nonUsProvince = nonUsProvince; } - public Form1099Nec fatcaFilingRequirement(Boolean fatcaFilingRequirement) { - this.fatcaFilingRequirement = fatcaFilingRequirement; + public Form1099Nec countryCode(String countryCode) { + this.countryCode = countryCode; return this; } /** - * Get fatcaFilingRequirement - * @return fatcaFilingRequirement + * Two-letter IRS country code (e.g., 'US', 'CA'), as defined at https://www.irs.gov/e-file-providers/country-codes. + * @return countryCode */ @javax.annotation.Nullable - public Boolean getFatcaFilingRequirement() { - return fatcaFilingRequirement; + public String getCountryCode() { + return countryCode; } - public void setFatcaFilingRequirement(Boolean fatcaFilingRequirement) { - this.fatcaFilingRequirement = fatcaFilingRequirement; + public void setCountryCode(String countryCode) { + this.countryCode = countryCode; } - public Form1099Nec tin(String tin) { - this.tin = tin; + public Form1099Nec federalEfileDate(LocalDate federalEfileDate) { + this.federalEfileDate = federalEfileDate; return this; } /** - * Get tin - * @return tin + * Date when federal e-filing should be scheduled for this form + * @return federalEfileDate */ @javax.annotation.Nullable - public String getTin() { - return tin; + public LocalDate getFederalEfileDate() { + return federalEfileDate; } - public void setTin(String tin) { - this.tin = tin; + public void setFederalEfileDate(LocalDate federalEfileDate) { + this.federalEfileDate = federalEfileDate; } - public Form1099Nec noTin(Boolean noTin) { - this.noTin = noTin; + public Form1099Nec postalMail(Boolean postalMail) { + this.postalMail = postalMail; return this; } /** - * Get noTin - * @return noTin + * Boolean indicating that postal mailing to the recipient should be scheduled for this form + * @return postalMail */ @javax.annotation.Nullable - public Boolean getNoTin() { - return noTin; + public Boolean getPostalMail() { + return postalMail; } - public void setNoTin(Boolean noTin) { - this.noTin = noTin; + public void setPostalMail(Boolean postalMail) { + this.postalMail = postalMail; } - public Form1099Nec secondTinNotice(Boolean secondTinNotice) { - this.secondTinNotice = secondTinNotice; + public Form1099Nec stateEfileDate(LocalDate stateEfileDate) { + this.stateEfileDate = stateEfileDate; return this; } /** - * Get secondTinNotice - * @return secondTinNotice + * Date when state e-filing should be scheduled for this form + * @return stateEfileDate */ @javax.annotation.Nullable - public Boolean getSecondTinNotice() { - return secondTinNotice; + public LocalDate getStateEfileDate() { + return stateEfileDate; } - public void setSecondTinNotice(Boolean secondTinNotice) { - this.secondTinNotice = secondTinNotice; + public void setStateEfileDate(LocalDate stateEfileDate) { + this.stateEfileDate = stateEfileDate; } - public Form1099Nec recipientName(String recipientName) { - this.recipientName = recipientName; + public Form1099Nec recipientEdeliveryDate(LocalDate recipientEdeliveryDate) { + this.recipientEdeliveryDate = recipientEdeliveryDate; return this; } /** - * Get recipientName - * @return recipientName + * Date when recipient e-delivery should be scheduled for this form + * @return recipientEdeliveryDate */ @javax.annotation.Nullable - public String getRecipientName() { - return recipientName; + public LocalDate getRecipientEdeliveryDate() { + return recipientEdeliveryDate; } - public void setRecipientName(String recipientName) { - this.recipientName = recipientName; + public void setRecipientEdeliveryDate(LocalDate recipientEdeliveryDate) { + this.recipientEdeliveryDate = recipientEdeliveryDate; } - public Form1099Nec recipientSecondName(String recipientSecondName) { - this.recipientSecondName = recipientSecondName; + public Form1099Nec tinMatch(Boolean tinMatch) { + this.tinMatch = tinMatch; return this; } /** - * Get recipientSecondName - * @return recipientSecondName + * Boolean indicating that TIN Matching should be scheduled for this form + * @return tinMatch */ @javax.annotation.Nullable - public String getRecipientSecondName() { - return recipientSecondName; + public Boolean getTinMatch() { + return tinMatch; } - public void setRecipientSecondName(String recipientSecondName) { - this.recipientSecondName = recipientSecondName; + public void setTinMatch(Boolean tinMatch) { + this.tinMatch = tinMatch; } - public Form1099Nec address(String address) { - this.address = address; + public Form1099Nec noTin(Boolean noTin) { + this.noTin = noTin; return this; } /** - * Get address - * @return address + * No TIN indicator + * @return noTin */ @javax.annotation.Nullable - public String getAddress() { - return address; + public Boolean getNoTin() { + return noTin; } - public void setAddress(String address) { - this.address = address; + public void setNoTin(Boolean noTin) { + this.noTin = noTin; } - public Form1099Nec address2(String address2) { - this.address2 = address2; + public Form1099Nec addressVerification(Boolean addressVerification) { + this.addressVerification = addressVerification; return this; } /** - * Get address2 - * @return address2 + * Boolean indicating that address verification should be scheduled for this form + * @return addressVerification */ @javax.annotation.Nullable - public String getAddress2() { - return address2; + public Boolean getAddressVerification() { + return addressVerification; } - public void setAddress2(String address2) { - this.address2 = address2; + public void setAddressVerification(Boolean addressVerification) { + this.addressVerification = addressVerification; } - public Form1099Nec city(String city) { - this.city = city; + public Form1099Nec stateAndLocalWithholding(StateAndLocalWithholding stateAndLocalWithholding) { + this.stateAndLocalWithholding = stateAndLocalWithholding; return this; } /** - * Get city - * @return city + * State and local withholding information + * @return stateAndLocalWithholding */ @javax.annotation.Nullable - public String getCity() { - return city; + public StateAndLocalWithholding getStateAndLocalWithholding() { + return stateAndLocalWithholding; } - public void setCity(String city) { - this.city = city; + public void setStateAndLocalWithholding(StateAndLocalWithholding stateAndLocalWithholding) { + this.stateAndLocalWithholding = stateAndLocalWithholding; } - public Form1099Nec state(String state) { - this.state = state; + public Form1099Nec secondTinNotice(Boolean secondTinNotice) { + this.secondTinNotice = secondTinNotice; return this; } /** - * Get state - * @return state + * Second TIN notice + * @return secondTinNotice */ @javax.annotation.Nullable - public String getState() { - return state; + public Boolean getSecondTinNotice() { + return secondTinNotice; } - public void setState(String state) { - this.state = state; + public void setSecondTinNotice(Boolean secondTinNotice) { + this.secondTinNotice = secondTinNotice; } - public Form1099Nec zip(String zip) { - this.zip = zip; - return this; - } - /** - * Get zip - * @return zip + * Federal e-file status + * @return federalEfileStatus */ @javax.annotation.Nullable - public String getZip() { - return zip; - } - - public void setZip(String zip) { - this.zip = zip; + public Form1099StatusDetail getFederalEfileStatus() { + return federalEfileStatus; } - public Form1099Nec nonUsProvince(String nonUsProvince) { - this.nonUsProvince = nonUsProvince; - return this; - } /** - * Get nonUsProvince - * @return nonUsProvince + * State e-file status + * @return stateEfileStatus */ @javax.annotation.Nullable - public String getNonUsProvince() { - return nonUsProvince; - } - - public void setNonUsProvince(String nonUsProvince) { - this.nonUsProvince = nonUsProvince; + public List getStateEfileStatus() { + return stateEfileStatus; } - public Form1099Nec countryCode(String countryCode) { - this.countryCode = countryCode; - return this; - } /** - * Get countryCode - * @return countryCode + * Postal mail to recipient status + * @return postalMailStatus */ @javax.annotation.Nullable - public String getCountryCode() { - return countryCode; - } - - public void setCountryCode(String countryCode) { - this.countryCode = countryCode; + public Form1099StatusDetail getPostalMailStatus() { + return postalMailStatus; } - public Form1099Nec accountNumber(String accountNumber) { - this.accountNumber = accountNumber; - return this; - } /** - * Get accountNumber - * @return accountNumber + * TIN Match status + * @return tinMatchStatus */ @javax.annotation.Nullable - public String getAccountNumber() { - return accountNumber; + public Form1099StatusDetail getTinMatchStatus() { + return tinMatchStatus; } - public void setAccountNumber(String accountNumber) { - this.accountNumber = accountNumber; - } - public Form1099Nec officeCode(String officeCode) { - this.officeCode = officeCode; - return this; + /** + * Address verification status + * @return addressVerificationStatus + */ + @javax.annotation.Nullable + public Form1099StatusDetail getAddressVerificationStatus() { + return addressVerificationStatus; } + + /** - * Get officeCode - * @return officeCode + * EDelivery status + * @return eDeliveryStatus */ @javax.annotation.Nullable - public String getOfficeCode() { - return officeCode; - } - - public void setOfficeCode(String officeCode) { - this.officeCode = officeCode; + public Form1099StatusDetail geteDeliveryStatus() { + return eDeliveryStatus; } - public Form1099Nec validationErrors(List validationErrors) { - this.validationErrors = validationErrors; - return this; - } - - public Form1099Nec addValidationErrorsItem(ValidationError validationErrorsItem) { - if (this.validationErrors == null) { - this.validationErrors = new ArrayList<>(); - } - this.validationErrors.add(validationErrorsItem); - return this; - } /** - * Get validationErrors + * Validation errors * @return validationErrors */ @javax.annotation.Nullable @@ -988,18 +1080,10 @@ public List getValidationErrors() { return validationErrors; } - public void setValidationErrors(List validationErrors) { - this.validationErrors = validationErrors; - } - - public Form1099Nec createdAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - return this; - } /** - * Get createdAt + * Date time when the record was created. * @return createdAt */ @javax.annotation.Nullable @@ -1007,18 +1091,10 @@ public OffsetDateTime getCreatedAt() { return createdAt; } - public void setCreatedAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - } - - public Form1099Nec updatedAt(OffsetDateTime updatedAt) { - this.updatedAt = updatedAt; - return this; - } /** - * Get updatedAt + * Date time when the record was last updated. * @return updatedAt */ @javax.annotation.Nullable @@ -1026,28 +1102,6 @@ public OffsetDateTime getUpdatedAt() { return updatedAt; } - public void setUpdatedAt(OffsetDateTime updatedAt) { - this.updatedAt = updatedAt; - } - - - public Form1099Nec stateAndLocalWithholding(StateAndLocalWithholding stateAndLocalWithholding) { - this.stateAndLocalWithholding = stateAndLocalWithholding; - return this; - } - - /** - * Get stateAndLocalWithholding - * @return stateAndLocalWithholding - */ - @javax.annotation.Nullable - public StateAndLocalWithholding getStateAndLocalWithholding() { - return stateAndLocalWithholding; - } - - public void setStateAndLocalWithholding(StateAndLocalWithholding stateAndLocalWithholding) { - this.stateAndLocalWithholding = stateAndLocalWithholding; - } @@ -1061,47 +1115,47 @@ public boolean equals(Object o) { } Form1099Nec form1099Nec = (Form1099Nec) o; return Objects.equals(this.nonemployeeCompensation, form1099Nec.nonemployeeCompensation) && - Objects.equals(this.federalIncomeTaxWithheld, form1099Nec.federalIncomeTaxWithheld) && Objects.equals(this.directSalesIndicator, form1099Nec.directSalesIndicator) && - Objects.equals(this.id, form1099Nec.id) && + Objects.equals(this.federalIncomeTaxWithheld, form1099Nec.federalIncomeTaxWithheld) && Objects.equals(this.type, form1099Nec.type) && + Objects.equals(this.id, form1099Nec.id) && Objects.equals(this.issuerId, form1099Nec.issuerId) && Objects.equals(this.issuerReferenceId, form1099Nec.issuerReferenceId) && Objects.equals(this.issuerTin, form1099Nec.issuerTin) && Objects.equals(this.taxYear, form1099Nec.taxYear) && - Objects.equals(this.federalEfile, form1099Nec.federalEfile) && - Objects.equals(this.federalEfileStatus, form1099Nec.federalEfileStatus) && - Objects.equals(this.stateEfile, form1099Nec.stateEfile) && - Objects.equals(this.stateEfileStatus, form1099Nec.stateEfileStatus) && - Objects.equals(this.postalMail, form1099Nec.postalMail) && - Objects.equals(this.postalMailStatus, form1099Nec.postalMailStatus) && - Objects.equals(this.tinMatch, form1099Nec.tinMatch) && - Objects.equals(this.tinMatchStatus, form1099Nec.tinMatchStatus) && - Objects.equals(this.addressVerification, form1099Nec.addressVerification) && - Objects.equals(this.addressVerificationStatus, form1099Nec.addressVerificationStatus) && - Objects.equals(this.eDeliveryStatus, form1099Nec.eDeliveryStatus) && Objects.equals(this.referenceId, form1099Nec.referenceId) && - Objects.equals(this.email, form1099Nec.email) && - Objects.equals(this.tinType, form1099Nec.tinType) && - Objects.equals(this.fatcaFilingRequirement, form1099Nec.fatcaFilingRequirement) && Objects.equals(this.tin, form1099Nec.tin) && - Objects.equals(this.noTin, form1099Nec.noTin) && - Objects.equals(this.secondTinNotice, form1099Nec.secondTinNotice) && Objects.equals(this.recipientName, form1099Nec.recipientName) && + Objects.equals(this.tinType, form1099Nec.tinType) && Objects.equals(this.recipientSecondName, form1099Nec.recipientSecondName) && Objects.equals(this.address, form1099Nec.address) && Objects.equals(this.address2, form1099Nec.address2) && Objects.equals(this.city, form1099Nec.city) && Objects.equals(this.state, form1099Nec.state) && Objects.equals(this.zip, form1099Nec.zip) && - Objects.equals(this.nonUsProvince, form1099Nec.nonUsProvince) && - Objects.equals(this.countryCode, form1099Nec.countryCode) && + Objects.equals(this.email, form1099Nec.email) && Objects.equals(this.accountNumber, form1099Nec.accountNumber) && Objects.equals(this.officeCode, form1099Nec.officeCode) && + Objects.equals(this.nonUsProvince, form1099Nec.nonUsProvince) && + Objects.equals(this.countryCode, form1099Nec.countryCode) && + Objects.equals(this.federalEfileDate, form1099Nec.federalEfileDate) && + Objects.equals(this.postalMail, form1099Nec.postalMail) && + Objects.equals(this.stateEfileDate, form1099Nec.stateEfileDate) && + Objects.equals(this.recipientEdeliveryDate, form1099Nec.recipientEdeliveryDate) && + Objects.equals(this.tinMatch, form1099Nec.tinMatch) && + Objects.equals(this.noTin, form1099Nec.noTin) && + Objects.equals(this.addressVerification, form1099Nec.addressVerification) && + Objects.equals(this.stateAndLocalWithholding, form1099Nec.stateAndLocalWithholding) && + Objects.equals(this.secondTinNotice, form1099Nec.secondTinNotice) && + Objects.equals(this.federalEfileStatus, form1099Nec.federalEfileStatus) && + Objects.equals(this.stateEfileStatus, form1099Nec.stateEfileStatus) && + Objects.equals(this.postalMailStatus, form1099Nec.postalMailStatus) && + Objects.equals(this.tinMatchStatus, form1099Nec.tinMatchStatus) && + Objects.equals(this.addressVerificationStatus, form1099Nec.addressVerificationStatus) && + Objects.equals(this.eDeliveryStatus, form1099Nec.eDeliveryStatus) && Objects.equals(this.validationErrors, form1099Nec.validationErrors) && Objects.equals(this.createdAt, form1099Nec.createdAt) && - Objects.equals(this.updatedAt, form1099Nec.updatedAt) && - Objects.equals(this.stateAndLocalWithholding, form1099Nec.stateAndLocalWithholding); + Objects.equals(this.updatedAt, form1099Nec.updatedAt); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -1110,7 +1164,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(nonemployeeCompensation, federalIncomeTaxWithheld, directSalesIndicator, id, type, issuerId, issuerReferenceId, issuerTin, taxYear, federalEfile, federalEfileStatus, stateEfile, stateEfileStatus, postalMail, postalMailStatus, tinMatch, tinMatchStatus, addressVerification, addressVerificationStatus, eDeliveryStatus, referenceId, email, tinType, fatcaFilingRequirement, tin, noTin, secondTinNotice, recipientName, recipientSecondName, address, address2, city, state, zip, nonUsProvince, countryCode, accountNumber, officeCode, validationErrors, createdAt, updatedAt, stateAndLocalWithholding); + return Objects.hash(nonemployeeCompensation, directSalesIndicator, federalIncomeTaxWithheld, type, id, issuerId, issuerReferenceId, issuerTin, taxYear, referenceId, tin, recipientName, tinType, recipientSecondName, address, address2, city, state, zip, email, accountNumber, officeCode, nonUsProvince, countryCode, federalEfileDate, postalMail, stateEfileDate, recipientEdeliveryDate, tinMatch, noTin, addressVerification, stateAndLocalWithholding, secondTinNotice, federalEfileStatus, stateEfileStatus, postalMailStatus, tinMatchStatus, addressVerificationStatus, eDeliveryStatus, validationErrors, createdAt, updatedAt); } private static int hashCodeNullable(JsonNullable a) { @@ -1125,47 +1179,47 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Form1099Nec {\n"); sb.append(" nonemployeeCompensation: ").append(toIndentedString(nonemployeeCompensation)).append("\n"); - sb.append(" federalIncomeTaxWithheld: ").append(toIndentedString(federalIncomeTaxWithheld)).append("\n"); sb.append(" directSalesIndicator: ").append(toIndentedString(directSalesIndicator)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" federalIncomeTaxWithheld: ").append(toIndentedString(federalIncomeTaxWithheld)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" issuerId: ").append(toIndentedString(issuerId)).append("\n"); sb.append(" issuerReferenceId: ").append(toIndentedString(issuerReferenceId)).append("\n"); sb.append(" issuerTin: ").append(toIndentedString(issuerTin)).append("\n"); sb.append(" taxYear: ").append(toIndentedString(taxYear)).append("\n"); - sb.append(" federalEfile: ").append(toIndentedString(federalEfile)).append("\n"); - sb.append(" federalEfileStatus: ").append(toIndentedString(federalEfileStatus)).append("\n"); - sb.append(" stateEfile: ").append(toIndentedString(stateEfile)).append("\n"); - sb.append(" stateEfileStatus: ").append(toIndentedString(stateEfileStatus)).append("\n"); - sb.append(" postalMail: ").append(toIndentedString(postalMail)).append("\n"); - sb.append(" postalMailStatus: ").append(toIndentedString(postalMailStatus)).append("\n"); - sb.append(" tinMatch: ").append(toIndentedString(tinMatch)).append("\n"); - sb.append(" tinMatchStatus: ").append(toIndentedString(tinMatchStatus)).append("\n"); - sb.append(" addressVerification: ").append(toIndentedString(addressVerification)).append("\n"); - sb.append(" addressVerificationStatus: ").append(toIndentedString(addressVerificationStatus)).append("\n"); - sb.append(" eDeliveryStatus: ").append(toIndentedString(eDeliveryStatus)).append("\n"); sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" tinType: ").append(toIndentedString(tinType)).append("\n"); - sb.append(" fatcaFilingRequirement: ").append(toIndentedString(fatcaFilingRequirement)).append("\n"); sb.append(" tin: ").append(toIndentedString(tin)).append("\n"); - sb.append(" noTin: ").append(toIndentedString(noTin)).append("\n"); - sb.append(" secondTinNotice: ").append(toIndentedString(secondTinNotice)).append("\n"); sb.append(" recipientName: ").append(toIndentedString(recipientName)).append("\n"); + sb.append(" tinType: ").append(toIndentedString(tinType)).append("\n"); sb.append(" recipientSecondName: ").append(toIndentedString(recipientSecondName)).append("\n"); sb.append(" address: ").append(toIndentedString(address)).append("\n"); sb.append(" address2: ").append(toIndentedString(address2)).append("\n"); sb.append(" city: ").append(toIndentedString(city)).append("\n"); sb.append(" state: ").append(toIndentedString(state)).append("\n"); sb.append(" zip: ").append(toIndentedString(zip)).append("\n"); - sb.append(" nonUsProvince: ").append(toIndentedString(nonUsProvince)).append("\n"); - sb.append(" countryCode: ").append(toIndentedString(countryCode)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); sb.append(" officeCode: ").append(toIndentedString(officeCode)).append("\n"); + sb.append(" nonUsProvince: ").append(toIndentedString(nonUsProvince)).append("\n"); + sb.append(" countryCode: ").append(toIndentedString(countryCode)).append("\n"); + sb.append(" federalEfileDate: ").append(toIndentedString(federalEfileDate)).append("\n"); + sb.append(" postalMail: ").append(toIndentedString(postalMail)).append("\n"); + sb.append(" stateEfileDate: ").append(toIndentedString(stateEfileDate)).append("\n"); + sb.append(" recipientEdeliveryDate: ").append(toIndentedString(recipientEdeliveryDate)).append("\n"); + sb.append(" tinMatch: ").append(toIndentedString(tinMatch)).append("\n"); + sb.append(" noTin: ").append(toIndentedString(noTin)).append("\n"); + sb.append(" addressVerification: ").append(toIndentedString(addressVerification)).append("\n"); + sb.append(" stateAndLocalWithholding: ").append(toIndentedString(stateAndLocalWithholding)).append("\n"); + sb.append(" secondTinNotice: ").append(toIndentedString(secondTinNotice)).append("\n"); + sb.append(" federalEfileStatus: ").append(toIndentedString(federalEfileStatus)).append("\n"); + sb.append(" stateEfileStatus: ").append(toIndentedString(stateEfileStatus)).append("\n"); + sb.append(" postalMailStatus: ").append(toIndentedString(postalMailStatus)).append("\n"); + sb.append(" tinMatchStatus: ").append(toIndentedString(tinMatchStatus)).append("\n"); + sb.append(" addressVerificationStatus: ").append(toIndentedString(addressVerificationStatus)).append("\n"); + sb.append(" eDeliveryStatus: ").append(toIndentedString(eDeliveryStatus)).append("\n"); sb.append(" validationErrors: ").append(toIndentedString(validationErrors)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append(" stateAndLocalWithholding: ").append(toIndentedString(stateAndLocalWithholding)).append("\n"); sb.append("}"); return sb.toString(); } @@ -1188,48 +1242,54 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("id"); openapiFields.add("type"); + openapiFields.add("id"); openapiFields.add("issuerId"); openapiFields.add("issuerReferenceId"); openapiFields.add("issuerTin"); openapiFields.add("taxYear"); - openapiFields.add("federalEfile"); - openapiFields.add("federalEfileStatus"); - openapiFields.add("stateEfile"); - openapiFields.add("stateEfileStatus"); - openapiFields.add("postalMail"); - openapiFields.add("postalMailStatus"); - openapiFields.add("tinMatch"); - openapiFields.add("tinMatchStatus"); - openapiFields.add("addressVerification"); - openapiFields.add("addressVerificationStatus"); - openapiFields.add("eDeliveryStatus"); openapiFields.add("referenceId"); - openapiFields.add("email"); - openapiFields.add("tinType"); - openapiFields.add("fatcaFilingRequirement"); openapiFields.add("tin"); - openapiFields.add("noTin"); - openapiFields.add("secondTinNotice"); openapiFields.add("recipientName"); + openapiFields.add("tinType"); openapiFields.add("recipientSecondName"); openapiFields.add("address"); openapiFields.add("address2"); openapiFields.add("city"); openapiFields.add("state"); openapiFields.add("zip"); - openapiFields.add("nonUsProvince"); - openapiFields.add("countryCode"); + openapiFields.add("email"); openapiFields.add("accountNumber"); openapiFields.add("officeCode"); + openapiFields.add("nonUsProvince"); + openapiFields.add("countryCode"); + openapiFields.add("federalEfileDate"); + openapiFields.add("postalMail"); + openapiFields.add("stateEfileDate"); + openapiFields.add("recipientEdeliveryDate"); + openapiFields.add("tinMatch"); + openapiFields.add("noTin"); + openapiFields.add("addressVerification"); + openapiFields.add("stateAndLocalWithholding"); + openapiFields.add("secondTinNotice"); + openapiFields.add("federalEfileStatus"); + openapiFields.add("stateEfileStatus"); + openapiFields.add("postalMailStatus"); + openapiFields.add("tinMatchStatus"); + openapiFields.add("addressVerificationStatus"); + openapiFields.add("eDeliveryStatus"); openapiFields.add("validationErrors"); openapiFields.add("createdAt"); openapiFields.add("updatedAt"); - openapiFields.add("stateAndLocalWithholding"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("nonemployeeCompensation"); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("recipientName"); + openapiRequiredFields.add("address"); + openapiRequiredFields.add("city"); + openapiRequiredFields.add("countryCode"); } /** @@ -1252,12 +1312,24 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Form1099Nec` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Form1099Nec.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("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); 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("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + if ((jsonObj.get("issuerId") != null && !jsonObj.get("issuerId").isJsonNull()) && !jsonObj.get("issuerId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `issuerId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerId").toString())); } if ((jsonObj.get("issuerReferenceId") != null && !jsonObj.get("issuerReferenceId").isJsonNull()) && !jsonObj.get("issuerReferenceId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `issuerReferenceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerReferenceId").toString())); @@ -1265,55 +1337,22 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("issuerTin") != null && !jsonObj.get("issuerTin").isJsonNull()) && !jsonObj.get("issuerTin").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `issuerTin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerTin").toString())); } - // validate the optional field `federalEfileStatus` - if (jsonObj.get("federalEfileStatus") != null && !jsonObj.get("federalEfileStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("federalEfileStatus")); - } - if (jsonObj.get("stateEfileStatus") != null && !jsonObj.get("stateEfileStatus").isJsonNull()) { - JsonArray jsonArraystateEfileStatus = jsonObj.getAsJsonArray("stateEfileStatus"); - if (jsonArraystateEfileStatus != null) { - // ensure the json data is an array - if (!jsonObj.get("stateEfileStatus").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `stateEfileStatus` to be an array in the JSON string but got `%s`", jsonObj.get("stateEfileStatus").toString())); - } - - // validate the optional field `stateEfileStatus` (array) - for (int i = 0; i < jsonArraystateEfileStatus.size(); i++) { - StateEfileStatusDetail.validateJsonElement(jsonArraystateEfileStatus.get(i)); - }; - } - } - // validate the optional field `postalMailStatus` - if (jsonObj.get("postalMailStatus") != null && !jsonObj.get("postalMailStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("postalMailStatus")); - } - // validate the optional field `tinMatchStatus` - if (jsonObj.get("tinMatchStatus") != null && !jsonObj.get("tinMatchStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("tinMatchStatus")); - } - // validate the optional field `addressVerificationStatus` - if (jsonObj.get("addressVerificationStatus") != null && !jsonObj.get("addressVerificationStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("addressVerificationStatus")); - } - // validate the optional field `eDeliveryStatus` - if (jsonObj.get("eDeliveryStatus") != null && !jsonObj.get("eDeliveryStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("eDeliveryStatus")); - } if ((jsonObj.get("referenceId") != null && !jsonObj.get("referenceId").isJsonNull()) && !jsonObj.get("referenceId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `referenceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("referenceId").toString())); } - if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); - } - if ((jsonObj.get("tinType") != null && !jsonObj.get("tinType").isJsonNull()) && !jsonObj.get("tinType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `tinType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tinType").toString())); - } if ((jsonObj.get("tin") != null && !jsonObj.get("tin").isJsonNull()) && !jsonObj.get("tin").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `tin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tin").toString())); } if ((jsonObj.get("recipientName") != null && !jsonObj.get("recipientName").isJsonNull()) && !jsonObj.get("recipientName").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `recipientName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientName").toString())); } + if ((jsonObj.get("tinType") != null && !jsonObj.get("tinType").isJsonNull()) && !jsonObj.get("tinType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `tinType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tinType").toString())); + } + // validate the optional field `tinType` + if (jsonObj.get("tinType") != null && !jsonObj.get("tinType").isJsonNull()) { + TinTypeEnum.validateJsonElement(jsonObj.get("tinType")); + } if ((jsonObj.get("recipientSecondName") != null && !jsonObj.get("recipientSecondName").isJsonNull()) && !jsonObj.get("recipientSecondName").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `recipientSecondName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientSecondName").toString())); } @@ -1332,17 +1371,58 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("zip") != null && !jsonObj.get("zip").isJsonNull()) && !jsonObj.get("zip").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `zip` to be a primitive type in the JSON string but got `%s`", jsonObj.get("zip").toString())); } + if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if ((jsonObj.get("accountNumber") != null && !jsonObj.get("accountNumber").isJsonNull()) && !jsonObj.get("accountNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); + } + if ((jsonObj.get("officeCode") != null && !jsonObj.get("officeCode").isJsonNull()) && !jsonObj.get("officeCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `officeCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("officeCode").toString())); + } if ((jsonObj.get("nonUsProvince") != null && !jsonObj.get("nonUsProvince").isJsonNull()) && !jsonObj.get("nonUsProvince").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `nonUsProvince` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nonUsProvince").toString())); } if ((jsonObj.get("countryCode") != null && !jsonObj.get("countryCode").isJsonNull()) && !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("accountNumber") != null && !jsonObj.get("accountNumber").isJsonNull()) && !jsonObj.get("accountNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); + // validate the optional field `stateAndLocalWithholding` + if (jsonObj.get("stateAndLocalWithholding") != null && !jsonObj.get("stateAndLocalWithholding").isJsonNull()) { + StateAndLocalWithholding.validateJsonElement(jsonObj.get("stateAndLocalWithholding")); } - if ((jsonObj.get("officeCode") != null && !jsonObj.get("officeCode").isJsonNull()) && !jsonObj.get("officeCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `officeCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("officeCode").toString())); + // validate the optional field `federalEfileStatus` + if (jsonObj.get("federalEfileStatus") != null && !jsonObj.get("federalEfileStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("federalEfileStatus")); + } + if (jsonObj.get("stateEfileStatus") != null && !jsonObj.get("stateEfileStatus").isJsonNull()) { + JsonArray jsonArraystateEfileStatus = jsonObj.getAsJsonArray("stateEfileStatus"); + if (jsonArraystateEfileStatus != null) { + // ensure the json data is an array + if (!jsonObj.get("stateEfileStatus").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `stateEfileStatus` to be an array in the JSON string but got `%s`", jsonObj.get("stateEfileStatus").toString())); + } + + // validate the optional field `stateEfileStatus` (array) + for (int i = 0; i < jsonArraystateEfileStatus.size(); i++) { + StateEfileStatusDetail.validateJsonElement(jsonArraystateEfileStatus.get(i)); + }; + } + } + // validate the optional field `postalMailStatus` + if (jsonObj.get("postalMailStatus") != null && !jsonObj.get("postalMailStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("postalMailStatus")); + } + // validate the optional field `tinMatchStatus` + if (jsonObj.get("tinMatchStatus") != null && !jsonObj.get("tinMatchStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("tinMatchStatus")); + } + // validate the optional field `addressVerificationStatus` + if (jsonObj.get("addressVerificationStatus") != null && !jsonObj.get("addressVerificationStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("addressVerificationStatus")); + } + // validate the optional field `eDeliveryStatus` + if (jsonObj.get("eDeliveryStatus") != null && !jsonObj.get("eDeliveryStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("eDeliveryStatus")); } if (jsonObj.get("validationErrors") != null && !jsonObj.get("validationErrors").isJsonNull()) { JsonArray jsonArrayvalidationErrors = jsonObj.getAsJsonArray("validationErrors"); @@ -1358,10 +1438,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti }; } } - // validate the optional field `stateAndLocalWithholding` - if (jsonObj.get("stateAndLocalWithholding") != null && !jsonObj.get("stateAndLocalWithholding").isJsonNull()) { - StateAndLocalWithholding.validateJsonElement(jsonObj.get("stateAndLocalWithholding")); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/Form1099R.java b/src/main/java/Avalara/SDK/model/A1099/V2/Form1099R.java index 8da8c18..5c01c04 100644 --- a/src/main/java/Avalara/SDK/model/A1099/V2/Form1099R.java +++ b/src/main/java/Avalara/SDK/model/A1099/V2/Form1099R.java @@ -30,6 +30,7 @@ import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.Arrays; @@ -61,13 +62,13 @@ import Avalara.SDK.JSON; /** - * Form1099R + * Form 1099-R: Distributions From Pensions, Annuities, Retirement or Profit-Sharing Plans, IRAs, Insurance Contracts, etc. */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class Form1099R { - public static final String SERIALIZED_NAME_GROSS_DISTRIBUTIONS = "grossDistributions"; - @SerializedName(SERIALIZED_NAME_GROSS_DISTRIBUTIONS) - private Double grossDistributions; + public static final String SERIALIZED_NAME_GROSS_DISTRIBUTION = "grossDistribution"; + @SerializedName(SERIALIZED_NAME_GROSS_DISTRIBUTION) + private Double grossDistribution; public static final String SERIALIZED_NAME_TAXABLE_AMOUNT = "taxableAmount"; @SerializedName(SERIALIZED_NAME_TAXABLE_AMOUNT) @@ -77,81 +78,151 @@ public class Form1099R { @SerializedName(SERIALIZED_NAME_TAXABLE_AMOUNT_NOT_DETERMINED) private Boolean taxableAmountNotDetermined; - public static final String SERIALIZED_NAME_TOTAL_DISTRIBUTION_INDICATOR = "totalDistributionIndicator"; - @SerializedName(SERIALIZED_NAME_TOTAL_DISTRIBUTION_INDICATOR) - private Boolean totalDistributionIndicator; + public static final String SERIALIZED_NAME_TOTAL_DISTRIBUTION_DETERMINED = "totalDistributionDetermined"; + @SerializedName(SERIALIZED_NAME_TOTAL_DISTRIBUTION_DETERMINED) + private Boolean totalDistributionDetermined; public static final String SERIALIZED_NAME_CAPITAL_GAIN = "capitalGain"; @SerializedName(SERIALIZED_NAME_CAPITAL_GAIN) private Double capitalGain; - public static final String SERIALIZED_NAME_FED_INCOME_TAX_WITHHELD = "fedIncomeTaxWithheld"; - @SerializedName(SERIALIZED_NAME_FED_INCOME_TAX_WITHHELD) - private Double fedIncomeTaxWithheld; + public static final String SERIALIZED_NAME_FEDERAL_INCOME_TAX_WITHHELD = "federalIncomeTaxWithheld"; + @SerializedName(SERIALIZED_NAME_FEDERAL_INCOME_TAX_WITHHELD) + private Double federalIncomeTaxWithheld; - public static final String SERIALIZED_NAME_EMPLOYEE_CONTRIBUTIONS = "employeeContributions"; - @SerializedName(SERIALIZED_NAME_EMPLOYEE_CONTRIBUTIONS) - private Double employeeContributions; + public static final String SERIALIZED_NAME_EMPLOYEE_CONTRIBUTIONS_OR_DESIGNATED_ROTH_OR_INSURANCE_PREMIUMS = "employeeContributionsOrDesignatedRothOrInsurancePremiums"; + @SerializedName(SERIALIZED_NAME_EMPLOYEE_CONTRIBUTIONS_OR_DESIGNATED_ROTH_OR_INSURANCE_PREMIUMS) + private Double employeeContributionsOrDesignatedRothOrInsurancePremiums; - public static final String SERIALIZED_NAME_NET_UNREALIZED_APPRECIATION = "netUnrealizedAppreciation"; - @SerializedName(SERIALIZED_NAME_NET_UNREALIZED_APPRECIATION) - private Double netUnrealizedAppreciation; + public static final String SERIALIZED_NAME_NET_UNREALIZED_APPRECIATION_IN_EMPLOYER_SECURITIES = "netUnrealizedAppreciationInEmployerSecurities"; + @SerializedName(SERIALIZED_NAME_NET_UNREALIZED_APPRECIATION_IN_EMPLOYER_SECURITIES) + private Double netUnrealizedAppreciationInEmployerSecurities; - public static final String SERIALIZED_NAME_DISTRIBUTION_CODE_REQUIRED = "distributionCodeRequired"; - @SerializedName(SERIALIZED_NAME_DISTRIBUTION_CODE_REQUIRED) - private String distributionCodeRequired; + public static final String SERIALIZED_NAME_DISTRIBUTION_CODE = "distributionCode"; + @SerializedName(SERIALIZED_NAME_DISTRIBUTION_CODE) + private String distributionCode; - public static final String SERIALIZED_NAME_DISTRIBUTION_CODE_OPTIONAL = "distributionCodeOptional"; - @SerializedName(SERIALIZED_NAME_DISTRIBUTION_CODE_OPTIONAL) - private String distributionCodeOptional; + public static final String SERIALIZED_NAME_SECOND_DISTRIBUTION_CODE = "secondDistributionCode"; + @SerializedName(SERIALIZED_NAME_SECOND_DISTRIBUTION_CODE) + private String secondDistributionCode; - public static final String SERIALIZED_NAME_IRA_SEP_SIMPLE_INDICATOR = "iraSepSimpleIndicator"; - @SerializedName(SERIALIZED_NAME_IRA_SEP_SIMPLE_INDICATOR) - private Boolean iraSepSimpleIndicator; + public static final String SERIALIZED_NAME_IRA_SEP_SIMPLE = "iraSepSimple"; + @SerializedName(SERIALIZED_NAME_IRA_SEP_SIMPLE) + private Boolean iraSepSimple; - public static final String SERIALIZED_NAME_TOTAL_IRA_SEP_SIMPLE_DISTRIBUTION = "totalIraSepSimpleDistribution"; - @SerializedName(SERIALIZED_NAME_TOTAL_IRA_SEP_SIMPLE_DISTRIBUTION) - private Double totalIraSepSimpleDistribution; + public static final String SERIALIZED_NAME_TRADITIONAL_IRA_SEP_SIMPLE_OR_ROTH_CONVERSION_AMOUNT = "traditionalIraSepSimpleOrRothConversionAmount"; + @SerializedName(SERIALIZED_NAME_TRADITIONAL_IRA_SEP_SIMPLE_OR_ROTH_CONVERSION_AMOUNT) + private Double traditionalIraSepSimpleOrRothConversionAmount; - public static final String SERIALIZED_NAME_OTHER = "other"; - @SerializedName(SERIALIZED_NAME_OTHER) - private Double other; + public static final String SERIALIZED_NAME_OTHER_AMOUNT = "otherAmount"; + @SerializedName(SERIALIZED_NAME_OTHER_AMOUNT) + private Double otherAmount; - public static final String SERIALIZED_NAME_OTHER_PERCENT = "otherPercent"; - @SerializedName(SERIALIZED_NAME_OTHER_PERCENT) - private String otherPercent; + public static final String SERIALIZED_NAME_OTHER_PERCENTAGE = "otherPercentage"; + @SerializedName(SERIALIZED_NAME_OTHER_PERCENTAGE) + private String otherPercentage; - public static final String SERIALIZED_NAME_PERCENTAGE_TOTAL_DISTRIBUTION = "percentageTotalDistribution"; - @SerializedName(SERIALIZED_NAME_PERCENTAGE_TOTAL_DISTRIBUTION) - private String percentageTotalDistribution; + public static final String SERIALIZED_NAME_TOTAL_DISTRIBUTION_PERCENTAGE = "totalDistributionPercentage"; + @SerializedName(SERIALIZED_NAME_TOTAL_DISTRIBUTION_PERCENTAGE) + private String totalDistributionPercentage; public static final String SERIALIZED_NAME_TOTAL_EMPLOYEE_CONTRIBUTIONS = "totalEmployeeContributions"; @SerializedName(SERIALIZED_NAME_TOTAL_EMPLOYEE_CONTRIBUTIONS) private Double totalEmployeeContributions; - public static final String SERIALIZED_NAME_AMOUNT_ALLOCABLE_TO_IRR = "amountAllocableToIrr"; - @SerializedName(SERIALIZED_NAME_AMOUNT_ALLOCABLE_TO_IRR) - private Double amountAllocableToIrr; + public static final String SERIALIZED_NAME_AMOUNT_ALLOCABLE_TO_IRR_WITHIN5_YEARS = "amountAllocableToIrrWithin5Years"; + @SerializedName(SERIALIZED_NAME_AMOUNT_ALLOCABLE_TO_IRR_WITHIN5_YEARS) + private Double amountAllocableToIrrWithin5Years; - public static final String SERIALIZED_NAME_FIRST_YEAR_DESIGNATED_ROTH_CONTRIB = "firstYearDesignatedRothContrib"; - @SerializedName(SERIALIZED_NAME_FIRST_YEAR_DESIGNATED_ROTH_CONTRIB) - private String firstYearDesignatedRothContrib; + public static final String SERIALIZED_NAME_FIRST_YEAR_OF_DESIGNATED_ROTH_CONTRIBUTION = "firstYearOfDesignatedRothContribution"; + @SerializedName(SERIALIZED_NAME_FIRST_YEAR_OF_DESIGNATED_ROTH_CONTRIBUTION) + private String firstYearOfDesignatedRothContribution; public static final String SERIALIZED_NAME_DATE_OF_PAYMENT = "dateOfPayment"; @SerializedName(SERIALIZED_NAME_DATE_OF_PAYMENT) - private String dateOfPayment; + private LocalDate dateOfPayment; - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; + public static final String SERIALIZED_NAME_FATCA_FILING_REQUIREMENT = "fatcaFilingRequirement"; + @SerializedName(SERIALIZED_NAME_FATCA_FILING_REQUIREMENT) + private Boolean fatcaFilingRequirement; + + /** + * Form type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + _1099_NEC("1099-NEC"), + + _1099_MISC("1099-MISC"), + + _1099_DIV("1099-DIV"), + + _1099_R("1099-R"), + + _1099_K("1099-K"), + + _1095_B("1095-B"), + + _1042_S("1042-S"), + + _1095_C("1095-C"), + + _1099_INT("1099-INT"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.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 TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) - private String type; + private TypeEnum type; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; public static final String SERIALIZED_NAME_ISSUER_ID = "issuerId"; @SerializedName(SERIALIZED_NAME_ISSUER_ID) - private Integer issuerId; + private String issuerId; public static final String SERIALIZED_NAME_ISSUER_REFERENCE_ID = "issuerReferenceId"; @SerializedName(SERIALIZED_NAME_ISSUER_REFERENCE_ID) @@ -165,81 +236,79 @@ public class Form1099R { @SerializedName(SERIALIZED_NAME_TAX_YEAR) private Integer taxYear; - public static final String SERIALIZED_NAME_FEDERAL_EFILE = "federalEfile"; - @SerializedName(SERIALIZED_NAME_FEDERAL_EFILE) - private Boolean federalEfile; - - public static final String SERIALIZED_NAME_FEDERAL_EFILE_STATUS = "federalEfileStatus"; - @SerializedName(SERIALIZED_NAME_FEDERAL_EFILE_STATUS) - private Form1099StatusDetail federalEfileStatus; - - public static final String SERIALIZED_NAME_STATE_EFILE = "stateEfile"; - @SerializedName(SERIALIZED_NAME_STATE_EFILE) - private Boolean stateEfile; - - public static final String SERIALIZED_NAME_STATE_EFILE_STATUS = "stateEfileStatus"; - @SerializedName(SERIALIZED_NAME_STATE_EFILE_STATUS) - private List stateEfileStatus; + public static final String SERIALIZED_NAME_REFERENCE_ID = "referenceId"; + @SerializedName(SERIALIZED_NAME_REFERENCE_ID) + private String referenceId; - public static final String SERIALIZED_NAME_POSTAL_MAIL = "postalMail"; - @SerializedName(SERIALIZED_NAME_POSTAL_MAIL) - private Boolean postalMail; + public static final String SERIALIZED_NAME_TIN = "tin"; + @SerializedName(SERIALIZED_NAME_TIN) + private String tin; - public static final String SERIALIZED_NAME_POSTAL_MAIL_STATUS = "postalMailStatus"; - @SerializedName(SERIALIZED_NAME_POSTAL_MAIL_STATUS) - private Form1099StatusDetail postalMailStatus; + public static final String SERIALIZED_NAME_RECIPIENT_NAME = "recipientName"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_NAME) + private String recipientName; - public static final String SERIALIZED_NAME_TIN_MATCH = "tinMatch"; - @SerializedName(SERIALIZED_NAME_TIN_MATCH) - private Boolean tinMatch; + /** + * Type of TIN (Tax ID Number) + */ + @JsonAdapter(TinTypeEnum.Adapter.class) + public enum TinTypeEnum { + EMPTY("Empty"), + + EIN("EIN"), + + SSN("SSN"), + + ITIN("ITIN"), + + ATIN("ATIN"); + + private String value; + + TinTypeEnum(String value) { + this.value = value; + } - public static final String SERIALIZED_NAME_TIN_MATCH_STATUS = "tinMatchStatus"; - @SerializedName(SERIALIZED_NAME_TIN_MATCH_STATUS) - private Form1099StatusDetail tinMatchStatus; + public String getValue() { + return value; + } - public static final String SERIALIZED_NAME_ADDRESS_VERIFICATION = "addressVerification"; - @SerializedName(SERIALIZED_NAME_ADDRESS_VERIFICATION) - private Boolean addressVerification; + @Override + public String toString() { + return String.valueOf(value); + } - public static final String SERIALIZED_NAME_ADDRESS_VERIFICATION_STATUS = "addressVerificationStatus"; - @SerializedName(SERIALIZED_NAME_ADDRESS_VERIFICATION_STATUS) - private Form1099StatusDetail addressVerificationStatus; + public static TinTypeEnum fromValue(String value) { + for (TinTypeEnum b : TinTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } - public static final String SERIALIZED_NAME_E_DELIVERY_STATUS = "eDeliveryStatus"; - @SerializedName(SERIALIZED_NAME_E_DELIVERY_STATUS) - private Form1099StatusDetail eDeliveryStatus; + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TinTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } - public static final String SERIALIZED_NAME_REFERENCE_ID = "referenceId"; - @SerializedName(SERIALIZED_NAME_REFERENCE_ID) - private String referenceId; + @Override + public TinTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TinTypeEnum.fromValue(value); + } + } - public static final String SERIALIZED_NAME_EMAIL = "email"; - @SerializedName(SERIALIZED_NAME_EMAIL) - private String email; + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TinTypeEnum.fromValue(value); + } + } public static final String SERIALIZED_NAME_TIN_TYPE = "tinType"; @SerializedName(SERIALIZED_NAME_TIN_TYPE) - private String tinType; - - public static final String SERIALIZED_NAME_FATCA_FILING_REQUIREMENT = "fatcaFilingRequirement"; - @SerializedName(SERIALIZED_NAME_FATCA_FILING_REQUIREMENT) - private Boolean fatcaFilingRequirement; - - public static final String SERIALIZED_NAME_TIN = "tin"; - @SerializedName(SERIALIZED_NAME_TIN) - private String tin; - - public static final String SERIALIZED_NAME_NO_TIN = "noTin"; - @SerializedName(SERIALIZED_NAME_NO_TIN) - private Boolean noTin; - - public static final String SERIALIZED_NAME_SECOND_TIN_NOTICE = "secondTinNotice"; - @SerializedName(SERIALIZED_NAME_SECOND_TIN_NOTICE) - private Boolean secondTinNotice; - - public static final String SERIALIZED_NAME_RECIPIENT_NAME = "recipientName"; - @SerializedName(SERIALIZED_NAME_RECIPIENT_NAME) - private String recipientName; + private TinTypeEnum tinType; public static final String SERIALIZED_NAME_RECIPIENT_SECOND_NAME = "recipientSecondName"; @SerializedName(SERIALIZED_NAME_RECIPIENT_SECOND_NAME) @@ -265,6 +334,18 @@ public class Form1099R { @SerializedName(SERIALIZED_NAME_ZIP) private String zip; + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) + private String accountNumber; + + public static final String SERIALIZED_NAME_OFFICE_CODE = "officeCode"; + @SerializedName(SERIALIZED_NAME_OFFICE_CODE) + private String officeCode; + public static final String SERIALIZED_NAME_NON_US_PROVINCE = "nonUsProvince"; @SerializedName(SERIALIZED_NAME_NON_US_PROVINCE) private String nonUsProvince; @@ -273,13 +354,65 @@ public class Form1099R { @SerializedName(SERIALIZED_NAME_COUNTRY_CODE) private String countryCode; - public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; - @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) - private String accountNumber; + public static final String SERIALIZED_NAME_FEDERAL_EFILE_DATE = "federalEfileDate"; + @SerializedName(SERIALIZED_NAME_FEDERAL_EFILE_DATE) + private LocalDate federalEfileDate; - public static final String SERIALIZED_NAME_OFFICE_CODE = "officeCode"; - @SerializedName(SERIALIZED_NAME_OFFICE_CODE) - private String officeCode; + public static final String SERIALIZED_NAME_POSTAL_MAIL = "postalMail"; + @SerializedName(SERIALIZED_NAME_POSTAL_MAIL) + private Boolean postalMail; + + public static final String SERIALIZED_NAME_STATE_EFILE_DATE = "stateEfileDate"; + @SerializedName(SERIALIZED_NAME_STATE_EFILE_DATE) + private LocalDate stateEfileDate; + + public static final String SERIALIZED_NAME_RECIPIENT_EDELIVERY_DATE = "recipientEdeliveryDate"; + @SerializedName(SERIALIZED_NAME_RECIPIENT_EDELIVERY_DATE) + private LocalDate recipientEdeliveryDate; + + public static final String SERIALIZED_NAME_TIN_MATCH = "tinMatch"; + @SerializedName(SERIALIZED_NAME_TIN_MATCH) + private Boolean tinMatch; + + public static final String SERIALIZED_NAME_NO_TIN = "noTin"; + @SerializedName(SERIALIZED_NAME_NO_TIN) + private Boolean noTin; + + public static final String SERIALIZED_NAME_ADDRESS_VERIFICATION = "addressVerification"; + @SerializedName(SERIALIZED_NAME_ADDRESS_VERIFICATION) + private Boolean addressVerification; + + public static final String SERIALIZED_NAME_STATE_AND_LOCAL_WITHHOLDING = "stateAndLocalWithholding"; + @SerializedName(SERIALIZED_NAME_STATE_AND_LOCAL_WITHHOLDING) + private StateAndLocalWithholding stateAndLocalWithholding; + + public static final String SERIALIZED_NAME_SECOND_TIN_NOTICE = "secondTinNotice"; + @SerializedName(SERIALIZED_NAME_SECOND_TIN_NOTICE) + private Boolean secondTinNotice; + + public static final String SERIALIZED_NAME_FEDERAL_EFILE_STATUS = "federalEfileStatus"; + @SerializedName(SERIALIZED_NAME_FEDERAL_EFILE_STATUS) + private Form1099StatusDetail federalEfileStatus; + + public static final String SERIALIZED_NAME_STATE_EFILE_STATUS = "stateEfileStatus"; + @SerializedName(SERIALIZED_NAME_STATE_EFILE_STATUS) + private List stateEfileStatus; + + public static final String SERIALIZED_NAME_POSTAL_MAIL_STATUS = "postalMailStatus"; + @SerializedName(SERIALIZED_NAME_POSTAL_MAIL_STATUS) + private Form1099StatusDetail postalMailStatus; + + public static final String SERIALIZED_NAME_TIN_MATCH_STATUS = "tinMatchStatus"; + @SerializedName(SERIALIZED_NAME_TIN_MATCH_STATUS) + private Form1099StatusDetail tinMatchStatus; + + public static final String SERIALIZED_NAME_ADDRESS_VERIFICATION_STATUS = "addressVerificationStatus"; + @SerializedName(SERIALIZED_NAME_ADDRESS_VERIFICATION_STATUS) + private Form1099StatusDetail addressVerificationStatus; + + public static final String SERIALIZED_NAME_E_DELIVERY_STATUS = "eDeliveryStatus"; + @SerializedName(SERIALIZED_NAME_E_DELIVERY_STATUS) + private Form1099StatusDetail eDeliveryStatus; public static final String SERIALIZED_NAME_VALIDATION_ERRORS = "validationErrors"; @SerializedName(SERIALIZED_NAME_VALIDATION_ERRORS) @@ -293,29 +426,50 @@ public class Form1099R { @SerializedName(SERIALIZED_NAME_UPDATED_AT) private OffsetDateTime updatedAt; - public static final String SERIALIZED_NAME_STATE_AND_LOCAL_WITHHOLDING = "stateAndLocalWithholding"; - @SerializedName(SERIALIZED_NAME_STATE_AND_LOCAL_WITHHOLDING) - private StateAndLocalWithholding stateAndLocalWithholding; - public Form1099R() { } - public Form1099R grossDistributions(Double grossDistributions) { - this.grossDistributions = grossDistributions; + public Form1099R( + String id, + Form1099StatusDetail federalEfileStatus, + List stateEfileStatus, + Form1099StatusDetail postalMailStatus, + Form1099StatusDetail tinMatchStatus, + Form1099StatusDetail addressVerificationStatus, + Form1099StatusDetail eDeliveryStatus, + List validationErrors, + OffsetDateTime createdAt, + OffsetDateTime updatedAt + ) { + this(); + this.id = id; + this.federalEfileStatus = federalEfileStatus; + this.stateEfileStatus = stateEfileStatus; + this.postalMailStatus = postalMailStatus; + this.tinMatchStatus = tinMatchStatus; + this.addressVerificationStatus = addressVerificationStatus; + this.eDeliveryStatus = eDeliveryStatus; + this.validationErrors = validationErrors; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + + public Form1099R grossDistribution(Double grossDistribution) { + this.grossDistribution = grossDistribution; return this; } /** - * Get grossDistributions - * @return grossDistributions + * Gross distribution + * @return grossDistribution */ @javax.annotation.Nullable - public Double getGrossDistributions() { - return grossDistributions; + public Double getGrossDistribution() { + return grossDistribution; } - public void setGrossDistributions(Double grossDistributions) { - this.grossDistributions = grossDistributions; + public void setGrossDistribution(Double grossDistribution) { + this.grossDistribution = grossDistribution; } @@ -325,7 +479,7 @@ public Form1099R taxableAmount(Double taxableAmount) { } /** - * Get taxableAmount + * Taxable amount * @return taxableAmount */ @javax.annotation.Nullable @@ -344,7 +498,7 @@ public Form1099R taxableAmountNotDetermined(Boolean taxableAmountNotDetermined) } /** - * Get taxableAmountNotDetermined + * Taxable amount not determined * @return taxableAmountNotDetermined */ @javax.annotation.Nullable @@ -357,22 +511,22 @@ public void setTaxableAmountNotDetermined(Boolean taxableAmountNotDetermined) { } - public Form1099R totalDistributionIndicator(Boolean totalDistributionIndicator) { - this.totalDistributionIndicator = totalDistributionIndicator; + public Form1099R totalDistributionDetermined(Boolean totalDistributionDetermined) { + this.totalDistributionDetermined = totalDistributionDetermined; return this; } /** - * Get totalDistributionIndicator - * @return totalDistributionIndicator + * Total distribution + * @return totalDistributionDetermined */ @javax.annotation.Nullable - public Boolean getTotalDistributionIndicator() { - return totalDistributionIndicator; + public Boolean getTotalDistributionDetermined() { + return totalDistributionDetermined; } - public void setTotalDistributionIndicator(Boolean totalDistributionIndicator) { - this.totalDistributionIndicator = totalDistributionIndicator; + public void setTotalDistributionDetermined(Boolean totalDistributionDetermined) { + this.totalDistributionDetermined = totalDistributionDetermined; } @@ -382,7 +536,7 @@ public Form1099R capitalGain(Double capitalGain) { } /** - * Get capitalGain + * Capital gain (included in Box 2a) * @return capitalGain */ @javax.annotation.Nullable @@ -395,193 +549,193 @@ public void setCapitalGain(Double capitalGain) { } - public Form1099R fedIncomeTaxWithheld(Double fedIncomeTaxWithheld) { - this.fedIncomeTaxWithheld = fedIncomeTaxWithheld; + public Form1099R federalIncomeTaxWithheld(Double federalIncomeTaxWithheld) { + this.federalIncomeTaxWithheld = federalIncomeTaxWithheld; return this; } /** - * Get fedIncomeTaxWithheld - * @return fedIncomeTaxWithheld + * Federal income tax withheld + * @return federalIncomeTaxWithheld */ @javax.annotation.Nullable - public Double getFedIncomeTaxWithheld() { - return fedIncomeTaxWithheld; + public Double getFederalIncomeTaxWithheld() { + return federalIncomeTaxWithheld; } - public void setFedIncomeTaxWithheld(Double fedIncomeTaxWithheld) { - this.fedIncomeTaxWithheld = fedIncomeTaxWithheld; + public void setFederalIncomeTaxWithheld(Double federalIncomeTaxWithheld) { + this.federalIncomeTaxWithheld = federalIncomeTaxWithheld; } - public Form1099R employeeContributions(Double employeeContributions) { - this.employeeContributions = employeeContributions; + public Form1099R employeeContributionsOrDesignatedRothOrInsurancePremiums(Double employeeContributionsOrDesignatedRothOrInsurancePremiums) { + this.employeeContributionsOrDesignatedRothOrInsurancePremiums = employeeContributionsOrDesignatedRothOrInsurancePremiums; return this; } /** - * Get employeeContributions - * @return employeeContributions + * Employee contributions/Designated Roth contributions or insurance premiums + * @return employeeContributionsOrDesignatedRothOrInsurancePremiums */ @javax.annotation.Nullable - public Double getEmployeeContributions() { - return employeeContributions; + public Double getEmployeeContributionsOrDesignatedRothOrInsurancePremiums() { + return employeeContributionsOrDesignatedRothOrInsurancePremiums; } - public void setEmployeeContributions(Double employeeContributions) { - this.employeeContributions = employeeContributions; + public void setEmployeeContributionsOrDesignatedRothOrInsurancePremiums(Double employeeContributionsOrDesignatedRothOrInsurancePremiums) { + this.employeeContributionsOrDesignatedRothOrInsurancePremiums = employeeContributionsOrDesignatedRothOrInsurancePremiums; } - public Form1099R netUnrealizedAppreciation(Double netUnrealizedAppreciation) { - this.netUnrealizedAppreciation = netUnrealizedAppreciation; + public Form1099R netUnrealizedAppreciationInEmployerSecurities(Double netUnrealizedAppreciationInEmployerSecurities) { + this.netUnrealizedAppreciationInEmployerSecurities = netUnrealizedAppreciationInEmployerSecurities; return this; } /** - * Get netUnrealizedAppreciation - * @return netUnrealizedAppreciation + * Net unrealized appreciation in employer's securities + * @return netUnrealizedAppreciationInEmployerSecurities */ @javax.annotation.Nullable - public Double getNetUnrealizedAppreciation() { - return netUnrealizedAppreciation; + public Double getNetUnrealizedAppreciationInEmployerSecurities() { + return netUnrealizedAppreciationInEmployerSecurities; } - public void setNetUnrealizedAppreciation(Double netUnrealizedAppreciation) { - this.netUnrealizedAppreciation = netUnrealizedAppreciation; + public void setNetUnrealizedAppreciationInEmployerSecurities(Double netUnrealizedAppreciationInEmployerSecurities) { + this.netUnrealizedAppreciationInEmployerSecurities = netUnrealizedAppreciationInEmployerSecurities; } - public Form1099R distributionCodeRequired(String distributionCodeRequired) { - this.distributionCodeRequired = distributionCodeRequired; + public Form1099R distributionCode(String distributionCode) { + this.distributionCode = distributionCode; return this; } /** - * Get distributionCodeRequired - * @return distributionCodeRequired + * Distribution code + * @return distributionCode */ @javax.annotation.Nullable - public String getDistributionCodeRequired() { - return distributionCodeRequired; + public String getDistributionCode() { + return distributionCode; } - public void setDistributionCodeRequired(String distributionCodeRequired) { - this.distributionCodeRequired = distributionCodeRequired; + public void setDistributionCode(String distributionCode) { + this.distributionCode = distributionCode; } - public Form1099R distributionCodeOptional(String distributionCodeOptional) { - this.distributionCodeOptional = distributionCodeOptional; + public Form1099R secondDistributionCode(String secondDistributionCode) { + this.secondDistributionCode = secondDistributionCode; return this; } /** - * Get distributionCodeOptional - * @return distributionCodeOptional + * Second distribution code + * @return secondDistributionCode */ @javax.annotation.Nullable - public String getDistributionCodeOptional() { - return distributionCodeOptional; + public String getSecondDistributionCode() { + return secondDistributionCode; } - public void setDistributionCodeOptional(String distributionCodeOptional) { - this.distributionCodeOptional = distributionCodeOptional; + public void setSecondDistributionCode(String secondDistributionCode) { + this.secondDistributionCode = secondDistributionCode; } - public Form1099R iraSepSimpleIndicator(Boolean iraSepSimpleIndicator) { - this.iraSepSimpleIndicator = iraSepSimpleIndicator; + public Form1099R iraSepSimple(Boolean iraSepSimple) { + this.iraSepSimple = iraSepSimple; return this; } /** - * Get iraSepSimpleIndicator - * @return iraSepSimpleIndicator + * IRA/SEP/SIMPLE + * @return iraSepSimple */ @javax.annotation.Nullable - public Boolean getIraSepSimpleIndicator() { - return iraSepSimpleIndicator; + public Boolean getIraSepSimple() { + return iraSepSimple; } - public void setIraSepSimpleIndicator(Boolean iraSepSimpleIndicator) { - this.iraSepSimpleIndicator = iraSepSimpleIndicator; + public void setIraSepSimple(Boolean iraSepSimple) { + this.iraSepSimple = iraSepSimple; } - public Form1099R totalIraSepSimpleDistribution(Double totalIraSepSimpleDistribution) { - this.totalIraSepSimpleDistribution = totalIraSepSimpleDistribution; + public Form1099R traditionalIraSepSimpleOrRothConversionAmount(Double traditionalIraSepSimpleOrRothConversionAmount) { + this.traditionalIraSepSimpleOrRothConversionAmount = traditionalIraSepSimpleOrRothConversionAmount; return this; } /** - * Get totalIraSepSimpleDistribution - * @return totalIraSepSimpleDistribution + * Traditional IRA/SEP/SIMPLE or Roth conversion amount + * @return traditionalIraSepSimpleOrRothConversionAmount */ @javax.annotation.Nullable - public Double getTotalIraSepSimpleDistribution() { - return totalIraSepSimpleDistribution; + public Double getTraditionalIraSepSimpleOrRothConversionAmount() { + return traditionalIraSepSimpleOrRothConversionAmount; } - public void setTotalIraSepSimpleDistribution(Double totalIraSepSimpleDistribution) { - this.totalIraSepSimpleDistribution = totalIraSepSimpleDistribution; + public void setTraditionalIraSepSimpleOrRothConversionAmount(Double traditionalIraSepSimpleOrRothConversionAmount) { + this.traditionalIraSepSimpleOrRothConversionAmount = traditionalIraSepSimpleOrRothConversionAmount; } - public Form1099R other(Double other) { - this.other = other; + public Form1099R otherAmount(Double otherAmount) { + this.otherAmount = otherAmount; return this; } /** - * Get other - * @return other + * Other amount + * @return otherAmount */ @javax.annotation.Nullable - public Double getOther() { - return other; + public Double getOtherAmount() { + return otherAmount; } - public void setOther(Double other) { - this.other = other; + public void setOtherAmount(Double otherAmount) { + this.otherAmount = otherAmount; } - public Form1099R otherPercent(String otherPercent) { - this.otherPercent = otherPercent; + public Form1099R otherPercentage(String otherPercentage) { + this.otherPercentage = otherPercentage; return this; } /** - * Get otherPercent - * @return otherPercent + * Other percentage + * @return otherPercentage */ @javax.annotation.Nullable - public String getOtherPercent() { - return otherPercent; + public String getOtherPercentage() { + return otherPercentage; } - public void setOtherPercent(String otherPercent) { - this.otherPercent = otherPercent; + public void setOtherPercentage(String otherPercentage) { + this.otherPercentage = otherPercentage; } - public Form1099R percentageTotalDistribution(String percentageTotalDistribution) { - this.percentageTotalDistribution = percentageTotalDistribution; + public Form1099R totalDistributionPercentage(String totalDistributionPercentage) { + this.totalDistributionPercentage = totalDistributionPercentage; return this; } /** - * Get percentageTotalDistribution - * @return percentageTotalDistribution + * Total distribution percentage + * @return totalDistributionPercentage */ @javax.annotation.Nullable - public String getPercentageTotalDistribution() { - return percentageTotalDistribution; + public String getTotalDistributionPercentage() { + return totalDistributionPercentage; } - public void setPercentageTotalDistribution(String percentageTotalDistribution) { - this.percentageTotalDistribution = percentageTotalDistribution; + public void setTotalDistributionPercentage(String totalDistributionPercentage) { + this.totalDistributionPercentage = totalDistributionPercentage; } @@ -591,7 +745,7 @@ public Form1099R totalEmployeeContributions(Double totalEmployeeContributions) { } /** - * Get totalEmployeeContributions + * Total employee contributions * @return totalEmployeeContributions */ @javax.annotation.Nullable @@ -604,116 +758,127 @@ public void setTotalEmployeeContributions(Double totalEmployeeContributions) { } - public Form1099R amountAllocableToIrr(Double amountAllocableToIrr) { - this.amountAllocableToIrr = amountAllocableToIrr; + public Form1099R amountAllocableToIrrWithin5Years(Double amountAllocableToIrrWithin5Years) { + this.amountAllocableToIrrWithin5Years = amountAllocableToIrrWithin5Years; return this; } /** - * Get amountAllocableToIrr - * @return amountAllocableToIrr + * Amount allocable to IRR within 5 years + * @return amountAllocableToIrrWithin5Years */ @javax.annotation.Nullable - public Double getAmountAllocableToIrr() { - return amountAllocableToIrr; + public Double getAmountAllocableToIrrWithin5Years() { + return amountAllocableToIrrWithin5Years; } - public void setAmountAllocableToIrr(Double amountAllocableToIrr) { - this.amountAllocableToIrr = amountAllocableToIrr; + public void setAmountAllocableToIrrWithin5Years(Double amountAllocableToIrrWithin5Years) { + this.amountAllocableToIrrWithin5Years = amountAllocableToIrrWithin5Years; } - public Form1099R firstYearDesignatedRothContrib(String firstYearDesignatedRothContrib) { - this.firstYearDesignatedRothContrib = firstYearDesignatedRothContrib; + public Form1099R firstYearOfDesignatedRothContribution(String firstYearOfDesignatedRothContribution) { + this.firstYearOfDesignatedRothContribution = firstYearOfDesignatedRothContribution; return this; } /** - * Get firstYearDesignatedRothContrib - * @return firstYearDesignatedRothContrib + * First year of designated Roth contribution + * @return firstYearOfDesignatedRothContribution */ @javax.annotation.Nullable - public String getFirstYearDesignatedRothContrib() { - return firstYearDesignatedRothContrib; + public String getFirstYearOfDesignatedRothContribution() { + return firstYearOfDesignatedRothContribution; } - public void setFirstYearDesignatedRothContrib(String firstYearDesignatedRothContrib) { - this.firstYearDesignatedRothContrib = firstYearDesignatedRothContrib; + public void setFirstYearOfDesignatedRothContribution(String firstYearOfDesignatedRothContribution) { + this.firstYearOfDesignatedRothContribution = firstYearOfDesignatedRothContribution; } - public Form1099R dateOfPayment(String dateOfPayment) { + public Form1099R dateOfPayment(LocalDate dateOfPayment) { this.dateOfPayment = dateOfPayment; return this; } /** - * Get dateOfPayment + * Date of payment * @return dateOfPayment */ @javax.annotation.Nullable - public String getDateOfPayment() { + public LocalDate getDateOfPayment() { return dateOfPayment; } - public void setDateOfPayment(String dateOfPayment) { + public void setDateOfPayment(LocalDate dateOfPayment) { this.dateOfPayment = dateOfPayment; } - public Form1099R id(String id) { - this.id = id; + public Form1099R fatcaFilingRequirement(Boolean fatcaFilingRequirement) { + this.fatcaFilingRequirement = fatcaFilingRequirement; return this; } /** - * Get id - * @return id + * FATCA filing requirement + * @return fatcaFilingRequirement */ @javax.annotation.Nullable - public String getId() { - return id; + public Boolean getFatcaFilingRequirement() { + return fatcaFilingRequirement; } - public void setId(String id) { - this.id = id; + public void setFatcaFilingRequirement(Boolean fatcaFilingRequirement) { + this.fatcaFilingRequirement = fatcaFilingRequirement; } - public Form1099R type(String type) { + public Form1099R type(TypeEnum type) { this.type = type; return this; } /** - * Get type + * Form type * @return type */ - @javax.annotation.Nullable - public String getType() { + @javax.annotation.Nonnull + public TypeEnum getType() { return type; } - public void setType(String type) { + public void setType(TypeEnum type) { this.type = type; } - public Form1099R issuerId(Integer issuerId) { + /** + * Form ID. Unique identifier set when the record is created. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + + + public Form1099R issuerId(String issuerId) { this.issuerId = issuerId; return this; } /** - * Get issuerId + * Issuer ID - only required when creating forms * @return issuerId */ @javax.annotation.Nullable - public Integer getIssuerId() { + public String getIssuerId() { return issuerId; } - public void setIssuerId(Integer issuerId) { + public void setIssuerId(String issuerId) { this.issuerId = issuerId; } @@ -724,7 +889,7 @@ public Form1099R issuerReferenceId(String issuerReferenceId) { } /** - * Get issuerReferenceId + * Issuer Reference ID - only required when creating forms * @return issuerReferenceId */ @javax.annotation.Nullable @@ -743,7 +908,7 @@ public Form1099R issuerTin(String issuerTin) { } /** - * Get issuerTin + * Issuer TIN - readonly * @return issuerTin */ @javax.annotation.Nullable @@ -762,7 +927,7 @@ public Form1099R taxYear(Integer taxYear) { } /** - * Get taxYear + * Tax Year - only required when creating forms * @return taxYear */ @javax.annotation.Nullable @@ -775,580 +940,530 @@ public void setTaxYear(Integer taxYear) { } - public Form1099R federalEfile(Boolean federalEfile) { - this.federalEfile = federalEfile; + public Form1099R referenceId(String referenceId) { + this.referenceId = referenceId; return this; } /** - * Get federalEfile - * @return federalEfile + * Internal reference ID. Never shown to any agency or recipient. + * @return referenceId */ @javax.annotation.Nullable - public Boolean getFederalEfile() { - return federalEfile; + public String getReferenceId() { + return referenceId; } - public void setFederalEfile(Boolean federalEfile) { - this.federalEfile = federalEfile; + public void setReferenceId(String referenceId) { + this.referenceId = referenceId; } - public Form1099R federalEfileStatus(Form1099StatusDetail federalEfileStatus) { - this.federalEfileStatus = federalEfileStatus; + public Form1099R tin(String tin) { + this.tin = tin; return this; } /** - * Get federalEfileStatus - * @return federalEfileStatus + * Recipient's Federal Tax Identification Number (TIN). + * @return tin */ @javax.annotation.Nullable - public Form1099StatusDetail getFederalEfileStatus() { - return federalEfileStatus; + public String getTin() { + return tin; } - public void setFederalEfileStatus(Form1099StatusDetail federalEfileStatus) { - this.federalEfileStatus = federalEfileStatus; + public void setTin(String tin) { + this.tin = tin; } - public Form1099R stateEfile(Boolean stateEfile) { - this.stateEfile = stateEfile; + public Form1099R recipientName(String recipientName) { + this.recipientName = recipientName; return this; } /** - * Get stateEfile - * @return stateEfile + * Recipient name + * @return recipientName */ @javax.annotation.Nullable - public Boolean getStateEfile() { - return stateEfile; + public String getRecipientName() { + return recipientName; } - public void setStateEfile(Boolean stateEfile) { - this.stateEfile = stateEfile; + public void setRecipientName(String recipientName) { + this.recipientName = recipientName; } - public Form1099R stateEfileStatus(List stateEfileStatus) { - this.stateEfileStatus = stateEfileStatus; - return this; - } - - public Form1099R addStateEfileStatusItem(StateEfileStatusDetail stateEfileStatusItem) { - if (this.stateEfileStatus == null) { - this.stateEfileStatus = new ArrayList<>(); - } - this.stateEfileStatus.add(stateEfileStatusItem); + public Form1099R tinType(TinTypeEnum tinType) { + this.tinType = tinType; return this; } /** - * Get stateEfileStatus - * @return stateEfileStatus + * Type of TIN (Tax ID Number) + * @return tinType */ @javax.annotation.Nullable - public List getStateEfileStatus() { - return stateEfileStatus; + public TinTypeEnum getTinType() { + return tinType; } - public void setStateEfileStatus(List stateEfileStatus) { - this.stateEfileStatus = stateEfileStatus; + public void setTinType(TinTypeEnum tinType) { + this.tinType = tinType; } - public Form1099R postalMail(Boolean postalMail) { - this.postalMail = postalMail; + public Form1099R recipientSecondName(String recipientSecondName) { + this.recipientSecondName = recipientSecondName; return this; } /** - * Get postalMail - * @return postalMail + * Recipient second name + * @return recipientSecondName */ @javax.annotation.Nullable - public Boolean getPostalMail() { - return postalMail; + public String getRecipientSecondName() { + return recipientSecondName; } - public void setPostalMail(Boolean postalMail) { - this.postalMail = postalMail; + public void setRecipientSecondName(String recipientSecondName) { + this.recipientSecondName = recipientSecondName; } - public Form1099R postalMailStatus(Form1099StatusDetail postalMailStatus) { - this.postalMailStatus = postalMailStatus; + public Form1099R address(String address) { + this.address = address; return this; } /** - * Get postalMailStatus - * @return postalMailStatus + * Address. + * @return address */ @javax.annotation.Nullable - public Form1099StatusDetail getPostalMailStatus() { - return postalMailStatus; + public String getAddress() { + return address; } - public void setPostalMailStatus(Form1099StatusDetail postalMailStatus) { - this.postalMailStatus = postalMailStatus; + public void setAddress(String address) { + this.address = address; } - public Form1099R tinMatch(Boolean tinMatch) { - this.tinMatch = tinMatch; + public Form1099R address2(String address2) { + this.address2 = address2; return this; } /** - * Get tinMatch - * @return tinMatch + * Address line 2. + * @return address2 */ @javax.annotation.Nullable - public Boolean getTinMatch() { - return tinMatch; + public String getAddress2() { + return address2; } - public void setTinMatch(Boolean tinMatch) { - this.tinMatch = tinMatch; + public void setAddress2(String address2) { + this.address2 = address2; } - public Form1099R tinMatchStatus(Form1099StatusDetail tinMatchStatus) { - this.tinMatchStatus = tinMatchStatus; + public Form1099R city(String city) { + this.city = city; return this; } /** - * Get tinMatchStatus - * @return tinMatchStatus + * City. + * @return city */ @javax.annotation.Nullable - public Form1099StatusDetail getTinMatchStatus() { - return tinMatchStatus; + public String getCity() { + return city; } - public void setTinMatchStatus(Form1099StatusDetail tinMatchStatus) { - this.tinMatchStatus = tinMatchStatus; + public void setCity(String city) { + this.city = city; } - public Form1099R addressVerification(Boolean addressVerification) { - this.addressVerification = addressVerification; + public Form1099R state(String state) { + this.state = state; return this; } /** - * Get addressVerification - * @return addressVerification + * Two-letter US state or Canadian province code (required for US/CA addresses). + * @return state */ @javax.annotation.Nullable - public Boolean getAddressVerification() { - return addressVerification; + public String getState() { + return state; } - public void setAddressVerification(Boolean addressVerification) { - this.addressVerification = addressVerification; + public void setState(String state) { + this.state = state; } - public Form1099R addressVerificationStatus(Form1099StatusDetail addressVerificationStatus) { - this.addressVerificationStatus = addressVerificationStatus; + public Form1099R zip(String zip) { + this.zip = zip; return this; } /** - * Get addressVerificationStatus - * @return addressVerificationStatus + * ZIP/postal code. + * @return zip */ @javax.annotation.Nullable - public Form1099StatusDetail getAddressVerificationStatus() { - return addressVerificationStatus; + public String getZip() { + return zip; } - public void setAddressVerificationStatus(Form1099StatusDetail addressVerificationStatus) { - this.addressVerificationStatus = addressVerificationStatus; + public void setZip(String zip) { + this.zip = zip; } - public Form1099R eDeliveryStatus(Form1099StatusDetail eDeliveryStatus) { - this.eDeliveryStatus = eDeliveryStatus; + public Form1099R email(String email) { + this.email = email; return this; } /** - * Get eDeliveryStatus - * @return eDeliveryStatus + * Recipient's Contact email address. + * @return email */ @javax.annotation.Nullable - public Form1099StatusDetail geteDeliveryStatus() { - return eDeliveryStatus; + public String getEmail() { + return email; } - public void seteDeliveryStatus(Form1099StatusDetail eDeliveryStatus) { - this.eDeliveryStatus = eDeliveryStatus; + public void setEmail(String email) { + this.email = email; } - public Form1099R referenceId(String referenceId) { - this.referenceId = referenceId; + public Form1099R accountNumber(String accountNumber) { + this.accountNumber = accountNumber; return this; } /** - * Get referenceId - * @return referenceId + * Account number + * @return accountNumber */ @javax.annotation.Nullable - public String getReferenceId() { - return referenceId; + public String getAccountNumber() { + return accountNumber; } - public void setReferenceId(String referenceId) { - this.referenceId = referenceId; + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; } - public Form1099R email(String email) { - this.email = email; + public Form1099R officeCode(String officeCode) { + this.officeCode = officeCode; return this; } /** - * Get email - * @return email + * Office code + * @return officeCode */ @javax.annotation.Nullable - public String getEmail() { - return email; + public String getOfficeCode() { + return officeCode; } - public void setEmail(String email) { - this.email = email; + public void setOfficeCode(String officeCode) { + this.officeCode = officeCode; } - public Form1099R tinType(String tinType) { - this.tinType = tinType; + public Form1099R nonUsProvince(String nonUsProvince) { + this.nonUsProvince = nonUsProvince; return this; } /** - * Get tinType - * @return tinType + * Province or region for non-US/CA addresses. + * @return nonUsProvince */ @javax.annotation.Nullable - public String getTinType() { - return tinType; + public String getNonUsProvince() { + return nonUsProvince; } - public void setTinType(String tinType) { - this.tinType = tinType; + public void setNonUsProvince(String nonUsProvince) { + this.nonUsProvince = nonUsProvince; } - public Form1099R fatcaFilingRequirement(Boolean fatcaFilingRequirement) { - this.fatcaFilingRequirement = fatcaFilingRequirement; + public Form1099R countryCode(String countryCode) { + this.countryCode = countryCode; return this; } /** - * Get fatcaFilingRequirement - * @return fatcaFilingRequirement + * Two-letter IRS country code (e.g., 'US', 'CA'), as defined at https://www.irs.gov/e-file-providers/country-codes. + * @return countryCode */ @javax.annotation.Nullable - public Boolean getFatcaFilingRequirement() { - return fatcaFilingRequirement; + public String getCountryCode() { + return countryCode; } - public void setFatcaFilingRequirement(Boolean fatcaFilingRequirement) { - this.fatcaFilingRequirement = fatcaFilingRequirement; + public void setCountryCode(String countryCode) { + this.countryCode = countryCode; } - public Form1099R tin(String tin) { - this.tin = tin; + public Form1099R federalEfileDate(LocalDate federalEfileDate) { + this.federalEfileDate = federalEfileDate; return this; } /** - * Get tin - * @return tin + * Date when federal e-filing should be scheduled for this form + * @return federalEfileDate */ @javax.annotation.Nullable - public String getTin() { - return tin; + public LocalDate getFederalEfileDate() { + return federalEfileDate; } - public void setTin(String tin) { - this.tin = tin; + public void setFederalEfileDate(LocalDate federalEfileDate) { + this.federalEfileDate = federalEfileDate; } - public Form1099R noTin(Boolean noTin) { - this.noTin = noTin; + public Form1099R postalMail(Boolean postalMail) { + this.postalMail = postalMail; return this; } /** - * Get noTin - * @return noTin + * Boolean indicating that postal mailing to the recipient should be scheduled for this form + * @return postalMail */ @javax.annotation.Nullable - public Boolean getNoTin() { - return noTin; + public Boolean getPostalMail() { + return postalMail; } - public void setNoTin(Boolean noTin) { - this.noTin = noTin; + public void setPostalMail(Boolean postalMail) { + this.postalMail = postalMail; } - public Form1099R secondTinNotice(Boolean secondTinNotice) { - this.secondTinNotice = secondTinNotice; + public Form1099R stateEfileDate(LocalDate stateEfileDate) { + this.stateEfileDate = stateEfileDate; return this; } /** - * Get secondTinNotice - * @return secondTinNotice + * Date when state e-filing should be scheduled for this form + * @return stateEfileDate */ @javax.annotation.Nullable - public Boolean getSecondTinNotice() { - return secondTinNotice; + public LocalDate getStateEfileDate() { + return stateEfileDate; } - public void setSecondTinNotice(Boolean secondTinNotice) { - this.secondTinNotice = secondTinNotice; + public void setStateEfileDate(LocalDate stateEfileDate) { + this.stateEfileDate = stateEfileDate; } - public Form1099R recipientName(String recipientName) { - this.recipientName = recipientName; + public Form1099R recipientEdeliveryDate(LocalDate recipientEdeliveryDate) { + this.recipientEdeliveryDate = recipientEdeliveryDate; return this; } /** - * Get recipientName - * @return recipientName + * Date when recipient e-delivery should be scheduled for this form + * @return recipientEdeliveryDate */ @javax.annotation.Nullable - public String getRecipientName() { - return recipientName; + public LocalDate getRecipientEdeliveryDate() { + return recipientEdeliveryDate; } - public void setRecipientName(String recipientName) { - this.recipientName = recipientName; + public void setRecipientEdeliveryDate(LocalDate recipientEdeliveryDate) { + this.recipientEdeliveryDate = recipientEdeliveryDate; } - public Form1099R recipientSecondName(String recipientSecondName) { - this.recipientSecondName = recipientSecondName; + public Form1099R tinMatch(Boolean tinMatch) { + this.tinMatch = tinMatch; return this; } /** - * Get recipientSecondName - * @return recipientSecondName + * Boolean indicating that TIN Matching should be scheduled for this form + * @return tinMatch */ @javax.annotation.Nullable - public String getRecipientSecondName() { - return recipientSecondName; + public Boolean getTinMatch() { + return tinMatch; } - public void setRecipientSecondName(String recipientSecondName) { - this.recipientSecondName = recipientSecondName; + public void setTinMatch(Boolean tinMatch) { + this.tinMatch = tinMatch; } - public Form1099R address(String address) { - this.address = address; + public Form1099R noTin(Boolean noTin) { + this.noTin = noTin; return this; } /** - * Get address - * @return address + * No TIN indicator + * @return noTin */ @javax.annotation.Nullable - public String getAddress() { - return address; + public Boolean getNoTin() { + return noTin; } - public void setAddress(String address) { - this.address = address; + public void setNoTin(Boolean noTin) { + this.noTin = noTin; } - public Form1099R address2(String address2) { - this.address2 = address2; + public Form1099R addressVerification(Boolean addressVerification) { + this.addressVerification = addressVerification; return this; } /** - * Get address2 - * @return address2 + * Boolean indicating that address verification should be scheduled for this form + * @return addressVerification */ @javax.annotation.Nullable - public String getAddress2() { - return address2; + public Boolean getAddressVerification() { + return addressVerification; } - public void setAddress2(String address2) { - this.address2 = address2; + public void setAddressVerification(Boolean addressVerification) { + this.addressVerification = addressVerification; } - public Form1099R city(String city) { - this.city = city; + public Form1099R stateAndLocalWithholding(StateAndLocalWithholding stateAndLocalWithholding) { + this.stateAndLocalWithholding = stateAndLocalWithholding; return this; } /** - * Get city - * @return city + * State and local withholding information + * @return stateAndLocalWithholding */ @javax.annotation.Nullable - public String getCity() { - return city; + public StateAndLocalWithholding getStateAndLocalWithholding() { + return stateAndLocalWithholding; } - public void setCity(String city) { - this.city = city; + public void setStateAndLocalWithholding(StateAndLocalWithholding stateAndLocalWithholding) { + this.stateAndLocalWithholding = stateAndLocalWithholding; } - public Form1099R state(String state) { - this.state = state; + public Form1099R secondTinNotice(Boolean secondTinNotice) { + this.secondTinNotice = secondTinNotice; return this; } /** - * Get state - * @return state + * Second TIN notice + * @return secondTinNotice */ @javax.annotation.Nullable - public String getState() { - return state; + public Boolean getSecondTinNotice() { + return secondTinNotice; } - public void setState(String state) { - this.state = state; + public void setSecondTinNotice(Boolean secondTinNotice) { + this.secondTinNotice = secondTinNotice; } - public Form1099R zip(String zip) { - this.zip = zip; - return this; - } - /** - * Get zip - * @return zip + * Federal e-file status + * @return federalEfileStatus */ @javax.annotation.Nullable - public String getZip() { - return zip; + public Form1099StatusDetail getFederalEfileStatus() { + return federalEfileStatus; } - public void setZip(String zip) { - this.zip = zip; - } - public Form1099R nonUsProvince(String nonUsProvince) { - this.nonUsProvince = nonUsProvince; - return this; - } - /** - * Get nonUsProvince - * @return nonUsProvince + * State e-file status + * @return stateEfileStatus */ @javax.annotation.Nullable - public String getNonUsProvince() { - return nonUsProvince; - } - - public void setNonUsProvince(String nonUsProvince) { - this.nonUsProvince = nonUsProvince; + public List getStateEfileStatus() { + return stateEfileStatus; } - public Form1099R countryCode(String countryCode) { - this.countryCode = countryCode; - return this; - } /** - * Get countryCode - * @return countryCode + * Postal mail to recipient status + * @return postalMailStatus */ @javax.annotation.Nullable - public String getCountryCode() { - return countryCode; - } - - public void setCountryCode(String countryCode) { - this.countryCode = countryCode; + public Form1099StatusDetail getPostalMailStatus() { + return postalMailStatus; } - public Form1099R accountNumber(String accountNumber) { - this.accountNumber = accountNumber; - return this; - } /** - * Get accountNumber - * @return accountNumber + * TIN Match status + * @return tinMatchStatus */ @javax.annotation.Nullable - public String getAccountNumber() { - return accountNumber; + public Form1099StatusDetail getTinMatchStatus() { + return tinMatchStatus; } - public void setAccountNumber(String accountNumber) { - this.accountNumber = accountNumber; - } - public Form1099R officeCode(String officeCode) { - this.officeCode = officeCode; - return this; + /** + * Address verification status + * @return addressVerificationStatus + */ + @javax.annotation.Nullable + public Form1099StatusDetail getAddressVerificationStatus() { + return addressVerificationStatus; } + + /** - * Get officeCode - * @return officeCode + * EDelivery status + * @return eDeliveryStatus */ @javax.annotation.Nullable - public String getOfficeCode() { - return officeCode; - } - - public void setOfficeCode(String officeCode) { - this.officeCode = officeCode; + public Form1099StatusDetail geteDeliveryStatus() { + return eDeliveryStatus; } - public Form1099R validationErrors(List validationErrors) { - this.validationErrors = validationErrors; - return this; - } - - public Form1099R addValidationErrorsItem(ValidationError validationErrorsItem) { - if (this.validationErrors == null) { - this.validationErrors = new ArrayList<>(); - } - this.validationErrors.add(validationErrorsItem); - return this; - } /** - * Get validationErrors + * Validation errors * @return validationErrors */ @javax.annotation.Nullable @@ -1356,18 +1471,10 @@ public List getValidationErrors() { return validationErrors; } - public void setValidationErrors(List validationErrors) { - this.validationErrors = validationErrors; - } - - public Form1099R createdAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - return this; - } /** - * Get createdAt + * Date time when the record was created. * @return createdAt */ @javax.annotation.Nullable @@ -1375,18 +1482,10 @@ public OffsetDateTime getCreatedAt() { return createdAt; } - public void setCreatedAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - } - public Form1099R updatedAt(OffsetDateTime updatedAt) { - this.updatedAt = updatedAt; - return this; - } - /** - * Get updatedAt + * Date time when the record was last updated. * @return updatedAt */ @javax.annotation.Nullable @@ -1394,28 +1493,6 @@ public OffsetDateTime getUpdatedAt() { return updatedAt; } - public void setUpdatedAt(OffsetDateTime updatedAt) { - this.updatedAt = updatedAt; - } - - - public Form1099R stateAndLocalWithholding(StateAndLocalWithholding stateAndLocalWithholding) { - this.stateAndLocalWithholding = stateAndLocalWithholding; - return this; - } - - /** - * Get stateAndLocalWithholding - * @return stateAndLocalWithholding - */ - @javax.annotation.Nullable - public StateAndLocalWithholding getStateAndLocalWithholding() { - return stateAndLocalWithholding; - } - - public void setStateAndLocalWithholding(StateAndLocalWithholding stateAndLocalWithholding) { - this.stateAndLocalWithholding = stateAndLocalWithholding; - } @@ -1428,64 +1505,65 @@ public boolean equals(Object o) { return false; } Form1099R form1099R = (Form1099R) o; - return Objects.equals(this.grossDistributions, form1099R.grossDistributions) && + return Objects.equals(this.grossDistribution, form1099R.grossDistribution) && Objects.equals(this.taxableAmount, form1099R.taxableAmount) && Objects.equals(this.taxableAmountNotDetermined, form1099R.taxableAmountNotDetermined) && - Objects.equals(this.totalDistributionIndicator, form1099R.totalDistributionIndicator) && + Objects.equals(this.totalDistributionDetermined, form1099R.totalDistributionDetermined) && Objects.equals(this.capitalGain, form1099R.capitalGain) && - Objects.equals(this.fedIncomeTaxWithheld, form1099R.fedIncomeTaxWithheld) && - Objects.equals(this.employeeContributions, form1099R.employeeContributions) && - Objects.equals(this.netUnrealizedAppreciation, form1099R.netUnrealizedAppreciation) && - Objects.equals(this.distributionCodeRequired, form1099R.distributionCodeRequired) && - Objects.equals(this.distributionCodeOptional, form1099R.distributionCodeOptional) && - Objects.equals(this.iraSepSimpleIndicator, form1099R.iraSepSimpleIndicator) && - Objects.equals(this.totalIraSepSimpleDistribution, form1099R.totalIraSepSimpleDistribution) && - Objects.equals(this.other, form1099R.other) && - Objects.equals(this.otherPercent, form1099R.otherPercent) && - Objects.equals(this.percentageTotalDistribution, form1099R.percentageTotalDistribution) && + Objects.equals(this.federalIncomeTaxWithheld, form1099R.federalIncomeTaxWithheld) && + Objects.equals(this.employeeContributionsOrDesignatedRothOrInsurancePremiums, form1099R.employeeContributionsOrDesignatedRothOrInsurancePremiums) && + Objects.equals(this.netUnrealizedAppreciationInEmployerSecurities, form1099R.netUnrealizedAppreciationInEmployerSecurities) && + Objects.equals(this.distributionCode, form1099R.distributionCode) && + Objects.equals(this.secondDistributionCode, form1099R.secondDistributionCode) && + Objects.equals(this.iraSepSimple, form1099R.iraSepSimple) && + Objects.equals(this.traditionalIraSepSimpleOrRothConversionAmount, form1099R.traditionalIraSepSimpleOrRothConversionAmount) && + Objects.equals(this.otherAmount, form1099R.otherAmount) && + Objects.equals(this.otherPercentage, form1099R.otherPercentage) && + Objects.equals(this.totalDistributionPercentage, form1099R.totalDistributionPercentage) && Objects.equals(this.totalEmployeeContributions, form1099R.totalEmployeeContributions) && - Objects.equals(this.amountAllocableToIrr, form1099R.amountAllocableToIrr) && - Objects.equals(this.firstYearDesignatedRothContrib, form1099R.firstYearDesignatedRothContrib) && + Objects.equals(this.amountAllocableToIrrWithin5Years, form1099R.amountAllocableToIrrWithin5Years) && + Objects.equals(this.firstYearOfDesignatedRothContribution, form1099R.firstYearOfDesignatedRothContribution) && Objects.equals(this.dateOfPayment, form1099R.dateOfPayment) && - Objects.equals(this.id, form1099R.id) && + Objects.equals(this.fatcaFilingRequirement, form1099R.fatcaFilingRequirement) && Objects.equals(this.type, form1099R.type) && + Objects.equals(this.id, form1099R.id) && Objects.equals(this.issuerId, form1099R.issuerId) && Objects.equals(this.issuerReferenceId, form1099R.issuerReferenceId) && Objects.equals(this.issuerTin, form1099R.issuerTin) && Objects.equals(this.taxYear, form1099R.taxYear) && - Objects.equals(this.federalEfile, form1099R.federalEfile) && - Objects.equals(this.federalEfileStatus, form1099R.federalEfileStatus) && - Objects.equals(this.stateEfile, form1099R.stateEfile) && - Objects.equals(this.stateEfileStatus, form1099R.stateEfileStatus) && - Objects.equals(this.postalMail, form1099R.postalMail) && - Objects.equals(this.postalMailStatus, form1099R.postalMailStatus) && - Objects.equals(this.tinMatch, form1099R.tinMatch) && - Objects.equals(this.tinMatchStatus, form1099R.tinMatchStatus) && - Objects.equals(this.addressVerification, form1099R.addressVerification) && - Objects.equals(this.addressVerificationStatus, form1099R.addressVerificationStatus) && - Objects.equals(this.eDeliveryStatus, form1099R.eDeliveryStatus) && Objects.equals(this.referenceId, form1099R.referenceId) && - Objects.equals(this.email, form1099R.email) && - Objects.equals(this.tinType, form1099R.tinType) && - Objects.equals(this.fatcaFilingRequirement, form1099R.fatcaFilingRequirement) && Objects.equals(this.tin, form1099R.tin) && - Objects.equals(this.noTin, form1099R.noTin) && - Objects.equals(this.secondTinNotice, form1099R.secondTinNotice) && Objects.equals(this.recipientName, form1099R.recipientName) && + Objects.equals(this.tinType, form1099R.tinType) && Objects.equals(this.recipientSecondName, form1099R.recipientSecondName) && Objects.equals(this.address, form1099R.address) && Objects.equals(this.address2, form1099R.address2) && Objects.equals(this.city, form1099R.city) && Objects.equals(this.state, form1099R.state) && Objects.equals(this.zip, form1099R.zip) && - Objects.equals(this.nonUsProvince, form1099R.nonUsProvince) && - Objects.equals(this.countryCode, form1099R.countryCode) && + Objects.equals(this.email, form1099R.email) && Objects.equals(this.accountNumber, form1099R.accountNumber) && Objects.equals(this.officeCode, form1099R.officeCode) && + Objects.equals(this.nonUsProvince, form1099R.nonUsProvince) && + Objects.equals(this.countryCode, form1099R.countryCode) && + Objects.equals(this.federalEfileDate, form1099R.federalEfileDate) && + Objects.equals(this.postalMail, form1099R.postalMail) && + Objects.equals(this.stateEfileDate, form1099R.stateEfileDate) && + Objects.equals(this.recipientEdeliveryDate, form1099R.recipientEdeliveryDate) && + Objects.equals(this.tinMatch, form1099R.tinMatch) && + Objects.equals(this.noTin, form1099R.noTin) && + Objects.equals(this.addressVerification, form1099R.addressVerification) && + Objects.equals(this.stateAndLocalWithholding, form1099R.stateAndLocalWithholding) && + Objects.equals(this.secondTinNotice, form1099R.secondTinNotice) && + Objects.equals(this.federalEfileStatus, form1099R.federalEfileStatus) && + Objects.equals(this.stateEfileStatus, form1099R.stateEfileStatus) && + Objects.equals(this.postalMailStatus, form1099R.postalMailStatus) && + Objects.equals(this.tinMatchStatus, form1099R.tinMatchStatus) && + Objects.equals(this.addressVerificationStatus, form1099R.addressVerificationStatus) && + Objects.equals(this.eDeliveryStatus, form1099R.eDeliveryStatus) && Objects.equals(this.validationErrors, form1099R.validationErrors) && Objects.equals(this.createdAt, form1099R.createdAt) && - Objects.equals(this.updatedAt, form1099R.updatedAt) && - Objects.equals(this.stateAndLocalWithholding, form1099R.stateAndLocalWithholding); + Objects.equals(this.updatedAt, form1099R.updatedAt); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -1494,7 +1572,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(grossDistributions, taxableAmount, taxableAmountNotDetermined, totalDistributionIndicator, capitalGain, fedIncomeTaxWithheld, employeeContributions, netUnrealizedAppreciation, distributionCodeRequired, distributionCodeOptional, iraSepSimpleIndicator, totalIraSepSimpleDistribution, other, otherPercent, percentageTotalDistribution, totalEmployeeContributions, amountAllocableToIrr, firstYearDesignatedRothContrib, dateOfPayment, id, type, issuerId, issuerReferenceId, issuerTin, taxYear, federalEfile, federalEfileStatus, stateEfile, stateEfileStatus, postalMail, postalMailStatus, tinMatch, tinMatchStatus, addressVerification, addressVerificationStatus, eDeliveryStatus, referenceId, email, tinType, fatcaFilingRequirement, tin, noTin, secondTinNotice, recipientName, recipientSecondName, address, address2, city, state, zip, nonUsProvince, countryCode, accountNumber, officeCode, validationErrors, createdAt, updatedAt, stateAndLocalWithholding); + return Objects.hash(grossDistribution, taxableAmount, taxableAmountNotDetermined, totalDistributionDetermined, capitalGain, federalIncomeTaxWithheld, employeeContributionsOrDesignatedRothOrInsurancePremiums, netUnrealizedAppreciationInEmployerSecurities, distributionCode, secondDistributionCode, iraSepSimple, traditionalIraSepSimpleOrRothConversionAmount, otherAmount, otherPercentage, totalDistributionPercentage, totalEmployeeContributions, amountAllocableToIrrWithin5Years, firstYearOfDesignatedRothContribution, dateOfPayment, fatcaFilingRequirement, type, id, issuerId, issuerReferenceId, issuerTin, taxYear, referenceId, tin, recipientName, tinType, recipientSecondName, address, address2, city, state, zip, email, accountNumber, officeCode, nonUsProvince, countryCode, federalEfileDate, postalMail, stateEfileDate, recipientEdeliveryDate, tinMatch, noTin, addressVerification, stateAndLocalWithholding, secondTinNotice, federalEfileStatus, stateEfileStatus, postalMailStatus, tinMatchStatus, addressVerificationStatus, eDeliveryStatus, validationErrors, createdAt, updatedAt); } private static int hashCodeNullable(JsonNullable a) { @@ -1508,64 +1586,65 @@ private static int hashCodeNullable(JsonNullable a) { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Form1099R {\n"); - sb.append(" grossDistributions: ").append(toIndentedString(grossDistributions)).append("\n"); + sb.append(" grossDistribution: ").append(toIndentedString(grossDistribution)).append("\n"); sb.append(" taxableAmount: ").append(toIndentedString(taxableAmount)).append("\n"); sb.append(" taxableAmountNotDetermined: ").append(toIndentedString(taxableAmountNotDetermined)).append("\n"); - sb.append(" totalDistributionIndicator: ").append(toIndentedString(totalDistributionIndicator)).append("\n"); + sb.append(" totalDistributionDetermined: ").append(toIndentedString(totalDistributionDetermined)).append("\n"); sb.append(" capitalGain: ").append(toIndentedString(capitalGain)).append("\n"); - sb.append(" fedIncomeTaxWithheld: ").append(toIndentedString(fedIncomeTaxWithheld)).append("\n"); - sb.append(" employeeContributions: ").append(toIndentedString(employeeContributions)).append("\n"); - sb.append(" netUnrealizedAppreciation: ").append(toIndentedString(netUnrealizedAppreciation)).append("\n"); - sb.append(" distributionCodeRequired: ").append(toIndentedString(distributionCodeRequired)).append("\n"); - sb.append(" distributionCodeOptional: ").append(toIndentedString(distributionCodeOptional)).append("\n"); - sb.append(" iraSepSimpleIndicator: ").append(toIndentedString(iraSepSimpleIndicator)).append("\n"); - sb.append(" totalIraSepSimpleDistribution: ").append(toIndentedString(totalIraSepSimpleDistribution)).append("\n"); - sb.append(" other: ").append(toIndentedString(other)).append("\n"); - sb.append(" otherPercent: ").append(toIndentedString(otherPercent)).append("\n"); - sb.append(" percentageTotalDistribution: ").append(toIndentedString(percentageTotalDistribution)).append("\n"); + sb.append(" federalIncomeTaxWithheld: ").append(toIndentedString(federalIncomeTaxWithheld)).append("\n"); + sb.append(" employeeContributionsOrDesignatedRothOrInsurancePremiums: ").append(toIndentedString(employeeContributionsOrDesignatedRothOrInsurancePremiums)).append("\n"); + sb.append(" netUnrealizedAppreciationInEmployerSecurities: ").append(toIndentedString(netUnrealizedAppreciationInEmployerSecurities)).append("\n"); + sb.append(" distributionCode: ").append(toIndentedString(distributionCode)).append("\n"); + sb.append(" secondDistributionCode: ").append(toIndentedString(secondDistributionCode)).append("\n"); + sb.append(" iraSepSimple: ").append(toIndentedString(iraSepSimple)).append("\n"); + sb.append(" traditionalIraSepSimpleOrRothConversionAmount: ").append(toIndentedString(traditionalIraSepSimpleOrRothConversionAmount)).append("\n"); + sb.append(" otherAmount: ").append(toIndentedString(otherAmount)).append("\n"); + sb.append(" otherPercentage: ").append(toIndentedString(otherPercentage)).append("\n"); + sb.append(" totalDistributionPercentage: ").append(toIndentedString(totalDistributionPercentage)).append("\n"); sb.append(" totalEmployeeContributions: ").append(toIndentedString(totalEmployeeContributions)).append("\n"); - sb.append(" amountAllocableToIrr: ").append(toIndentedString(amountAllocableToIrr)).append("\n"); - sb.append(" firstYearDesignatedRothContrib: ").append(toIndentedString(firstYearDesignatedRothContrib)).append("\n"); + sb.append(" amountAllocableToIrrWithin5Years: ").append(toIndentedString(amountAllocableToIrrWithin5Years)).append("\n"); + sb.append(" firstYearOfDesignatedRothContribution: ").append(toIndentedString(firstYearOfDesignatedRothContribution)).append("\n"); sb.append(" dateOfPayment: ").append(toIndentedString(dateOfPayment)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" fatcaFilingRequirement: ").append(toIndentedString(fatcaFilingRequirement)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" issuerId: ").append(toIndentedString(issuerId)).append("\n"); sb.append(" issuerReferenceId: ").append(toIndentedString(issuerReferenceId)).append("\n"); sb.append(" issuerTin: ").append(toIndentedString(issuerTin)).append("\n"); sb.append(" taxYear: ").append(toIndentedString(taxYear)).append("\n"); - sb.append(" federalEfile: ").append(toIndentedString(federalEfile)).append("\n"); - sb.append(" federalEfileStatus: ").append(toIndentedString(federalEfileStatus)).append("\n"); - sb.append(" stateEfile: ").append(toIndentedString(stateEfile)).append("\n"); - sb.append(" stateEfileStatus: ").append(toIndentedString(stateEfileStatus)).append("\n"); - sb.append(" postalMail: ").append(toIndentedString(postalMail)).append("\n"); - sb.append(" postalMailStatus: ").append(toIndentedString(postalMailStatus)).append("\n"); - sb.append(" tinMatch: ").append(toIndentedString(tinMatch)).append("\n"); - sb.append(" tinMatchStatus: ").append(toIndentedString(tinMatchStatus)).append("\n"); - sb.append(" addressVerification: ").append(toIndentedString(addressVerification)).append("\n"); - sb.append(" addressVerificationStatus: ").append(toIndentedString(addressVerificationStatus)).append("\n"); - sb.append(" eDeliveryStatus: ").append(toIndentedString(eDeliveryStatus)).append("\n"); sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" tinType: ").append(toIndentedString(tinType)).append("\n"); - sb.append(" fatcaFilingRequirement: ").append(toIndentedString(fatcaFilingRequirement)).append("\n"); sb.append(" tin: ").append(toIndentedString(tin)).append("\n"); - sb.append(" noTin: ").append(toIndentedString(noTin)).append("\n"); - sb.append(" secondTinNotice: ").append(toIndentedString(secondTinNotice)).append("\n"); sb.append(" recipientName: ").append(toIndentedString(recipientName)).append("\n"); + sb.append(" tinType: ").append(toIndentedString(tinType)).append("\n"); sb.append(" recipientSecondName: ").append(toIndentedString(recipientSecondName)).append("\n"); sb.append(" address: ").append(toIndentedString(address)).append("\n"); sb.append(" address2: ").append(toIndentedString(address2)).append("\n"); sb.append(" city: ").append(toIndentedString(city)).append("\n"); sb.append(" state: ").append(toIndentedString(state)).append("\n"); sb.append(" zip: ").append(toIndentedString(zip)).append("\n"); - sb.append(" nonUsProvince: ").append(toIndentedString(nonUsProvince)).append("\n"); - sb.append(" countryCode: ").append(toIndentedString(countryCode)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); sb.append(" officeCode: ").append(toIndentedString(officeCode)).append("\n"); + sb.append(" nonUsProvince: ").append(toIndentedString(nonUsProvince)).append("\n"); + sb.append(" countryCode: ").append(toIndentedString(countryCode)).append("\n"); + sb.append(" federalEfileDate: ").append(toIndentedString(federalEfileDate)).append("\n"); + sb.append(" postalMail: ").append(toIndentedString(postalMail)).append("\n"); + sb.append(" stateEfileDate: ").append(toIndentedString(stateEfileDate)).append("\n"); + sb.append(" recipientEdeliveryDate: ").append(toIndentedString(recipientEdeliveryDate)).append("\n"); + sb.append(" tinMatch: ").append(toIndentedString(tinMatch)).append("\n"); + sb.append(" noTin: ").append(toIndentedString(noTin)).append("\n"); + sb.append(" addressVerification: ").append(toIndentedString(addressVerification)).append("\n"); + sb.append(" stateAndLocalWithholding: ").append(toIndentedString(stateAndLocalWithholding)).append("\n"); + sb.append(" secondTinNotice: ").append(toIndentedString(secondTinNotice)).append("\n"); + sb.append(" federalEfileStatus: ").append(toIndentedString(federalEfileStatus)).append("\n"); + sb.append(" stateEfileStatus: ").append(toIndentedString(stateEfileStatus)).append("\n"); + sb.append(" postalMailStatus: ").append(toIndentedString(postalMailStatus)).append("\n"); + sb.append(" tinMatchStatus: ").append(toIndentedString(tinMatchStatus)).append("\n"); + sb.append(" addressVerificationStatus: ").append(toIndentedString(addressVerificationStatus)).append("\n"); + sb.append(" eDeliveryStatus: ").append(toIndentedString(eDeliveryStatus)).append("\n"); sb.append(" validationErrors: ").append(toIndentedString(validationErrors)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); - sb.append(" stateAndLocalWithholding: ").append(toIndentedString(stateAndLocalWithholding)).append("\n"); sb.append("}"); return sb.toString(); } @@ -1588,48 +1667,53 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("id"); openapiFields.add("type"); + openapiFields.add("id"); openapiFields.add("issuerId"); openapiFields.add("issuerReferenceId"); openapiFields.add("issuerTin"); openapiFields.add("taxYear"); - openapiFields.add("federalEfile"); - openapiFields.add("federalEfileStatus"); - openapiFields.add("stateEfile"); - openapiFields.add("stateEfileStatus"); - openapiFields.add("postalMail"); - openapiFields.add("postalMailStatus"); - openapiFields.add("tinMatch"); - openapiFields.add("tinMatchStatus"); - openapiFields.add("addressVerification"); - openapiFields.add("addressVerificationStatus"); - openapiFields.add("eDeliveryStatus"); openapiFields.add("referenceId"); - openapiFields.add("email"); - openapiFields.add("tinType"); - openapiFields.add("fatcaFilingRequirement"); openapiFields.add("tin"); - openapiFields.add("noTin"); - openapiFields.add("secondTinNotice"); openapiFields.add("recipientName"); + openapiFields.add("tinType"); openapiFields.add("recipientSecondName"); openapiFields.add("address"); openapiFields.add("address2"); openapiFields.add("city"); openapiFields.add("state"); openapiFields.add("zip"); - openapiFields.add("nonUsProvince"); - openapiFields.add("countryCode"); + openapiFields.add("email"); openapiFields.add("accountNumber"); openapiFields.add("officeCode"); + openapiFields.add("nonUsProvince"); + openapiFields.add("countryCode"); + openapiFields.add("federalEfileDate"); + openapiFields.add("postalMail"); + openapiFields.add("stateEfileDate"); + openapiFields.add("recipientEdeliveryDate"); + openapiFields.add("tinMatch"); + openapiFields.add("noTin"); + openapiFields.add("addressVerification"); + openapiFields.add("stateAndLocalWithholding"); + openapiFields.add("secondTinNotice"); + openapiFields.add("federalEfileStatus"); + openapiFields.add("stateEfileStatus"); + openapiFields.add("postalMailStatus"); + openapiFields.add("tinMatchStatus"); + openapiFields.add("addressVerificationStatus"); + openapiFields.add("eDeliveryStatus"); openapiFields.add("validationErrors"); openapiFields.add("createdAt"); openapiFields.add("updatedAt"); - openapiFields.add("stateAndLocalWithholding"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("recipientName"); + openapiRequiredFields.add("address"); + openapiRequiredFields.add("city"); + openapiRequiredFields.add("countryCode"); } /** @@ -1652,30 +1736,39 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Form1099R` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Form1099R.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("distributionCodeRequired") != null && !jsonObj.get("distributionCodeRequired").isJsonNull()) && !jsonObj.get("distributionCodeRequired").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `distributionCodeRequired` to be a primitive type in the JSON string but got `%s`", jsonObj.get("distributionCodeRequired").toString())); + if ((jsonObj.get("distributionCode") != null && !jsonObj.get("distributionCode").isJsonNull()) && !jsonObj.get("distributionCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `distributionCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("distributionCode").toString())); } - if ((jsonObj.get("distributionCodeOptional") != null && !jsonObj.get("distributionCodeOptional").isJsonNull()) && !jsonObj.get("distributionCodeOptional").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `distributionCodeOptional` to be a primitive type in the JSON string but got `%s`", jsonObj.get("distributionCodeOptional").toString())); + if ((jsonObj.get("secondDistributionCode") != null && !jsonObj.get("secondDistributionCode").isJsonNull()) && !jsonObj.get("secondDistributionCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `secondDistributionCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secondDistributionCode").toString())); } - if ((jsonObj.get("otherPercent") != null && !jsonObj.get("otherPercent").isJsonNull()) && !jsonObj.get("otherPercent").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `otherPercent` to be a primitive type in the JSON string but got `%s`", jsonObj.get("otherPercent").toString())); + if ((jsonObj.get("otherPercentage") != null && !jsonObj.get("otherPercentage").isJsonNull()) && !jsonObj.get("otherPercentage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `otherPercentage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("otherPercentage").toString())); } - if ((jsonObj.get("percentageTotalDistribution") != null && !jsonObj.get("percentageTotalDistribution").isJsonNull()) && !jsonObj.get("percentageTotalDistribution").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `percentageTotalDistribution` to be a primitive type in the JSON string but got `%s`", jsonObj.get("percentageTotalDistribution").toString())); + if ((jsonObj.get("totalDistributionPercentage") != null && !jsonObj.get("totalDistributionPercentage").isJsonNull()) && !jsonObj.get("totalDistributionPercentage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `totalDistributionPercentage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("totalDistributionPercentage").toString())); } - if ((jsonObj.get("firstYearDesignatedRothContrib") != null && !jsonObj.get("firstYearDesignatedRothContrib").isJsonNull()) && !jsonObj.get("firstYearDesignatedRothContrib").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `firstYearDesignatedRothContrib` to be a primitive type in the JSON string but got `%s`", jsonObj.get("firstYearDesignatedRothContrib").toString())); + if ((jsonObj.get("firstYearOfDesignatedRothContribution") != null && !jsonObj.get("firstYearOfDesignatedRothContribution").isJsonNull()) && !jsonObj.get("firstYearOfDesignatedRothContribution").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `firstYearOfDesignatedRothContribution` to be a primitive type in the JSON string but got `%s`", jsonObj.get("firstYearOfDesignatedRothContribution").toString())); } - if ((jsonObj.get("dateOfPayment") != null && !jsonObj.get("dateOfPayment").isJsonNull()) && !jsonObj.get("dateOfPayment").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `dateOfPayment` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dateOfPayment").toString())); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); 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("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + if ((jsonObj.get("issuerId") != null && !jsonObj.get("issuerId").isJsonNull()) && !jsonObj.get("issuerId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `issuerId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerId").toString())); } if ((jsonObj.get("issuerReferenceId") != null && !jsonObj.get("issuerReferenceId").isJsonNull()) && !jsonObj.get("issuerReferenceId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `issuerReferenceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerReferenceId").toString())); @@ -1683,55 +1776,22 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("issuerTin") != null && !jsonObj.get("issuerTin").isJsonNull()) && !jsonObj.get("issuerTin").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `issuerTin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerTin").toString())); } - // validate the optional field `federalEfileStatus` - if (jsonObj.get("federalEfileStatus") != null && !jsonObj.get("federalEfileStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("federalEfileStatus")); - } - if (jsonObj.get("stateEfileStatus") != null && !jsonObj.get("stateEfileStatus").isJsonNull()) { - JsonArray jsonArraystateEfileStatus = jsonObj.getAsJsonArray("stateEfileStatus"); - if (jsonArraystateEfileStatus != null) { - // ensure the json data is an array - if (!jsonObj.get("stateEfileStatus").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `stateEfileStatus` to be an array in the JSON string but got `%s`", jsonObj.get("stateEfileStatus").toString())); - } - - // validate the optional field `stateEfileStatus` (array) - for (int i = 0; i < jsonArraystateEfileStatus.size(); i++) { - StateEfileStatusDetail.validateJsonElement(jsonArraystateEfileStatus.get(i)); - }; - } - } - // validate the optional field `postalMailStatus` - if (jsonObj.get("postalMailStatus") != null && !jsonObj.get("postalMailStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("postalMailStatus")); - } - // validate the optional field `tinMatchStatus` - if (jsonObj.get("tinMatchStatus") != null && !jsonObj.get("tinMatchStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("tinMatchStatus")); - } - // validate the optional field `addressVerificationStatus` - if (jsonObj.get("addressVerificationStatus") != null && !jsonObj.get("addressVerificationStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("addressVerificationStatus")); - } - // validate the optional field `eDeliveryStatus` - if (jsonObj.get("eDeliveryStatus") != null && !jsonObj.get("eDeliveryStatus").isJsonNull()) { - Form1099StatusDetail.validateJsonElement(jsonObj.get("eDeliveryStatus")); - } if ((jsonObj.get("referenceId") != null && !jsonObj.get("referenceId").isJsonNull()) && !jsonObj.get("referenceId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `referenceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("referenceId").toString())); } - if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); - } - if ((jsonObj.get("tinType") != null && !jsonObj.get("tinType").isJsonNull()) && !jsonObj.get("tinType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `tinType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tinType").toString())); - } if ((jsonObj.get("tin") != null && !jsonObj.get("tin").isJsonNull()) && !jsonObj.get("tin").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `tin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tin").toString())); } if ((jsonObj.get("recipientName") != null && !jsonObj.get("recipientName").isJsonNull()) && !jsonObj.get("recipientName").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `recipientName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientName").toString())); } + if ((jsonObj.get("tinType") != null && !jsonObj.get("tinType").isJsonNull()) && !jsonObj.get("tinType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `tinType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tinType").toString())); + } + // validate the optional field `tinType` + if (jsonObj.get("tinType") != null && !jsonObj.get("tinType").isJsonNull()) { + TinTypeEnum.validateJsonElement(jsonObj.get("tinType")); + } if ((jsonObj.get("recipientSecondName") != null && !jsonObj.get("recipientSecondName").isJsonNull()) && !jsonObj.get("recipientSecondName").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `recipientSecondName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientSecondName").toString())); } @@ -1750,17 +1810,58 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("zip") != null && !jsonObj.get("zip").isJsonNull()) && !jsonObj.get("zip").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `zip` to be a primitive type in the JSON string but got `%s`", jsonObj.get("zip").toString())); } + if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if ((jsonObj.get("accountNumber") != null && !jsonObj.get("accountNumber").isJsonNull()) && !jsonObj.get("accountNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); + } + if ((jsonObj.get("officeCode") != null && !jsonObj.get("officeCode").isJsonNull()) && !jsonObj.get("officeCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `officeCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("officeCode").toString())); + } if ((jsonObj.get("nonUsProvince") != null && !jsonObj.get("nonUsProvince").isJsonNull()) && !jsonObj.get("nonUsProvince").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `nonUsProvince` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nonUsProvince").toString())); } if ((jsonObj.get("countryCode") != null && !jsonObj.get("countryCode").isJsonNull()) && !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("accountNumber") != null && !jsonObj.get("accountNumber").isJsonNull()) && !jsonObj.get("accountNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); + // validate the optional field `stateAndLocalWithholding` + if (jsonObj.get("stateAndLocalWithholding") != null && !jsonObj.get("stateAndLocalWithholding").isJsonNull()) { + StateAndLocalWithholding.validateJsonElement(jsonObj.get("stateAndLocalWithholding")); } - if ((jsonObj.get("officeCode") != null && !jsonObj.get("officeCode").isJsonNull()) && !jsonObj.get("officeCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `officeCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("officeCode").toString())); + // validate the optional field `federalEfileStatus` + if (jsonObj.get("federalEfileStatus") != null && !jsonObj.get("federalEfileStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("federalEfileStatus")); + } + if (jsonObj.get("stateEfileStatus") != null && !jsonObj.get("stateEfileStatus").isJsonNull()) { + JsonArray jsonArraystateEfileStatus = jsonObj.getAsJsonArray("stateEfileStatus"); + if (jsonArraystateEfileStatus != null) { + // ensure the json data is an array + if (!jsonObj.get("stateEfileStatus").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `stateEfileStatus` to be an array in the JSON string but got `%s`", jsonObj.get("stateEfileStatus").toString())); + } + + // validate the optional field `stateEfileStatus` (array) + for (int i = 0; i < jsonArraystateEfileStatus.size(); i++) { + StateEfileStatusDetail.validateJsonElement(jsonArraystateEfileStatus.get(i)); + }; + } + } + // validate the optional field `postalMailStatus` + if (jsonObj.get("postalMailStatus") != null && !jsonObj.get("postalMailStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("postalMailStatus")); + } + // validate the optional field `tinMatchStatus` + if (jsonObj.get("tinMatchStatus") != null && !jsonObj.get("tinMatchStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("tinMatchStatus")); + } + // validate the optional field `addressVerificationStatus` + if (jsonObj.get("addressVerificationStatus") != null && !jsonObj.get("addressVerificationStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("addressVerificationStatus")); + } + // validate the optional field `eDeliveryStatus` + if (jsonObj.get("eDeliveryStatus") != null && !jsonObj.get("eDeliveryStatus").isJsonNull()) { + Form1099StatusDetail.validateJsonElement(jsonObj.get("eDeliveryStatus")); } if (jsonObj.get("validationErrors") != null && !jsonObj.get("validationErrors").isJsonNull()) { JsonArray jsonArrayvalidationErrors = jsonObj.getAsJsonArray("validationErrors"); @@ -1776,10 +1877,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti }; } } - // validate the optional field `stateAndLocalWithholding` - if (jsonObj.get("stateAndLocalWithholding") != null && !jsonObj.get("stateAndLocalWithholding").isJsonNull()) { - StateAndLocalWithholding.validateJsonElement(jsonObj.get("stateAndLocalWithholding")); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/FormRequestCsvBase.java b/src/main/java/Avalara/SDK/model/A1099/V2/FormRequestCsvBase.java deleted file mode 100644 index 5cfaf75..0000000 --- a/src/main/java/Avalara/SDK/model/A1099/V2/FormRequestCsvBase.java +++ /dev/null @@ -1,961 +0,0 @@ -/* - * AvaTax Software Development Kit for Java (JRE) - * - * (c) 2004-2025 Avalara, Inc. - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - * - * Avalara 1099 & W-9 API Definition - * - * ## 🔐 Authentication Use **username/password** or generate a **license key** from: *Avalara Portal → Settings → License and API Keys*. [More on authentication methods](https://developer.avalara.com/avatax-dm-combined-erp/common-setup/authentication/authentication-methods/) [Test your credentials](https://developer.avalara.com/avatax/test-credentials/) ## 📘 API & SDK Documentation [Avalara SDK (.NET) on GitHub](https://github.com/avadev/Avalara-SDK-DotNet#avalarasdk--the-unified-c-library-for-next-gen-avalara-services) [Code Examples – 1099 API](https://github.com/avadev/Avalara-SDK-DotNet/blob/main/docs/A1099/V2/Class1099IssuersApi.md#call1099issuersget) - * - * @author Sachin Baijal - * @author Jonathan Wenger - * @copyright 2004-2025 Avalara, Inc. - * @license https://www.apache.org/licenses/LICENSE-2.0 - * @link https://github.com/avadev/Avalara-SDK-Java - */ - -package Avalara.SDK.model.A1099.V2; - -import java.util.Objects; -import Avalara.SDK.model.A1099.V2.StateAndLocalWithholdingRequest; -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 org.openapitools.jackson.nullable.JsonNullable; - -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; - -/** - * FormRequestCsvBase - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") -public class FormRequestCsvBase { - public static final String SERIALIZED_NAME_ISSUER_REFERENCE_ID = "issuerReferenceId"; - @SerializedName(SERIALIZED_NAME_ISSUER_REFERENCE_ID) - private String issuerReferenceId; - - public static final String SERIALIZED_NAME_ISSUER_TIN = "issuerTin"; - @SerializedName(SERIALIZED_NAME_ISSUER_TIN) - private String issuerTin; - - public static final String SERIALIZED_NAME_TAX_YEAR = "taxYear"; - @SerializedName(SERIALIZED_NAME_TAX_YEAR) - private Integer taxYear; - - public static final String SERIALIZED_NAME_ISSUER_ID = "issuerId"; - @SerializedName(SERIALIZED_NAME_ISSUER_ID) - private String issuerId; - - public static final String SERIALIZED_NAME_REFERENCE_ID = "referenceId"; - @SerializedName(SERIALIZED_NAME_REFERENCE_ID) - private String referenceId; - - public static final String SERIALIZED_NAME_RECIPIENT_NAME = "recipientName"; - @SerializedName(SERIALIZED_NAME_RECIPIENT_NAME) - private String recipientName; - - public static final String SERIALIZED_NAME_RECIPIENT_TIN = "recipientTin"; - @SerializedName(SERIALIZED_NAME_RECIPIENT_TIN) - private String recipientTin; - - /** - * Gets or Sets tinType - */ - @JsonAdapter(TinTypeEnum.Adapter.class) - public enum TinTypeEnum { - EIN("EIN"), - - SSN("SSN"), - - ITIN("ITIN"), - - ATIN("ATIN"); - - private String value; - - TinTypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TinTypeEnum fromValue(String value) { - for (TinTypeEnum b : TinTypeEnum.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 TinTypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TinTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TinTypeEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - TinTypeEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_TIN_TYPE = "tinType"; - @SerializedName(SERIALIZED_NAME_TIN_TYPE) - private TinTypeEnum tinType; - - public static final String SERIALIZED_NAME_RECIPIENT_SECOND_NAME = "recipientSecondName"; - @SerializedName(SERIALIZED_NAME_RECIPIENT_SECOND_NAME) - private String recipientSecondName; - - public static final String SERIALIZED_NAME_ADDRESS = "address"; - @SerializedName(SERIALIZED_NAME_ADDRESS) - private String address; - - public static final String SERIALIZED_NAME_ADDRESS2 = "address2"; - @SerializedName(SERIALIZED_NAME_ADDRESS2) - private String address2; - - 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_ZIP = "zip"; - @SerializedName(SERIALIZED_NAME_ZIP) - private String zip; - - public static final String SERIALIZED_NAME_RECIPIENT_EMAIL = "recipientEmail"; - @SerializedName(SERIALIZED_NAME_RECIPIENT_EMAIL) - private String recipientEmail; - - public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; - @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) - private String accountNumber; - - public static final String SERIALIZED_NAME_OFFICE_CODE = "officeCode"; - @SerializedName(SERIALIZED_NAME_OFFICE_CODE) - private String officeCode; - - public static final String SERIALIZED_NAME_RECIPIENT_NON_US_PROVINCE = "recipientNonUsProvince"; - @SerializedName(SERIALIZED_NAME_RECIPIENT_NON_US_PROVINCE) - private String recipientNonUsProvince; - - public static final String SERIALIZED_NAME_COUNTRY_CODE = "countryCode"; - @SerializedName(SERIALIZED_NAME_COUNTRY_CODE) - private String countryCode; - - public static final String SERIALIZED_NAME_FEDERAL_E_FILE = "federalEFile"; - @SerializedName(SERIALIZED_NAME_FEDERAL_E_FILE) - private Boolean federalEFile; - - public static final String SERIALIZED_NAME_POSTAL_MAIL = "postalMail"; - @SerializedName(SERIALIZED_NAME_POSTAL_MAIL) - private Boolean postalMail; - - public static final String SERIALIZED_NAME_STATE_E_FILE = "stateEFile"; - @SerializedName(SERIALIZED_NAME_STATE_E_FILE) - private Boolean stateEFile; - - public static final String SERIALIZED_NAME_TIN_MATCH = "tinMatch"; - @SerializedName(SERIALIZED_NAME_TIN_MATCH) - private Boolean tinMatch; - - public static final String SERIALIZED_NAME_ADDRESS_VERIFICATION = "addressVerification"; - @SerializedName(SERIALIZED_NAME_ADDRESS_VERIFICATION) - private Boolean addressVerification; - - public static final String SERIALIZED_NAME_STATE_AND_LOCAL_WITHHOLDING = "stateAndLocalWithholding"; - @SerializedName(SERIALIZED_NAME_STATE_AND_LOCAL_WITHHOLDING) - private StateAndLocalWithholdingRequest stateAndLocalWithholding; - - public FormRequestCsvBase() { - } - - public FormRequestCsvBase issuerReferenceId(String issuerReferenceId) { - this.issuerReferenceId = issuerReferenceId; - return this; - } - - /** - * Get issuerReferenceId - * @return issuerReferenceId - */ - @javax.annotation.Nullable - public String getIssuerReferenceId() { - return issuerReferenceId; - } - - public void setIssuerReferenceId(String issuerReferenceId) { - this.issuerReferenceId = issuerReferenceId; - } - - - public FormRequestCsvBase issuerTin(String issuerTin) { - this.issuerTin = issuerTin; - return this; - } - - /** - * Get issuerTin - * @return issuerTin - */ - @javax.annotation.Nullable - public String getIssuerTin() { - return issuerTin; - } - - public void setIssuerTin(String issuerTin) { - this.issuerTin = issuerTin; - } - - - public FormRequestCsvBase taxYear(Integer taxYear) { - this.taxYear = taxYear; - return this; - } - - /** - * Get taxYear - * @return taxYear - */ - @javax.annotation.Nullable - public Integer getTaxYear() { - return taxYear; - } - - public void setTaxYear(Integer taxYear) { - this.taxYear = taxYear; - } - - - public FormRequestCsvBase issuerId(String issuerId) { - this.issuerId = issuerId; - return this; - } - - /** - * Get issuerId - * @return issuerId - */ - @javax.annotation.Nullable - public String getIssuerId() { - return issuerId; - } - - public void setIssuerId(String issuerId) { - this.issuerId = issuerId; - } - - - public FormRequestCsvBase referenceId(String referenceId) { - this.referenceId = referenceId; - return this; - } - - /** - * Get referenceId - * @return referenceId - */ - @javax.annotation.Nullable - public String getReferenceId() { - return referenceId; - } - - public void setReferenceId(String referenceId) { - this.referenceId = referenceId; - } - - - public FormRequestCsvBase recipientName(String recipientName) { - this.recipientName = recipientName; - return this; - } - - /** - * Get recipientName - * @return recipientName - */ - @javax.annotation.Nullable - public String getRecipientName() { - return recipientName; - } - - public void setRecipientName(String recipientName) { - this.recipientName = recipientName; - } - - - public FormRequestCsvBase recipientTin(String recipientTin) { - this.recipientTin = recipientTin; - return this; - } - - /** - * Get recipientTin - * @return recipientTin - */ - @javax.annotation.Nullable - public String getRecipientTin() { - return recipientTin; - } - - public void setRecipientTin(String recipientTin) { - this.recipientTin = recipientTin; - } - - - public FormRequestCsvBase tinType(TinTypeEnum tinType) { - this.tinType = tinType; - return this; - } - - /** - * Get tinType - * @return tinType - */ - @javax.annotation.Nullable - public TinTypeEnum getTinType() { - return tinType; - } - - public void setTinType(TinTypeEnum tinType) { - this.tinType = tinType; - } - - - public FormRequestCsvBase recipientSecondName(String recipientSecondName) { - this.recipientSecondName = recipientSecondName; - return this; - } - - /** - * Get recipientSecondName - * @return recipientSecondName - */ - @javax.annotation.Nullable - public String getRecipientSecondName() { - return recipientSecondName; - } - - public void setRecipientSecondName(String recipientSecondName) { - this.recipientSecondName = recipientSecondName; - } - - - public FormRequestCsvBase address(String address) { - this.address = address; - return this; - } - - /** - * Get address - * @return address - */ - @javax.annotation.Nullable - public String getAddress() { - return address; - } - - public void setAddress(String address) { - this.address = address; - } - - - public FormRequestCsvBase address2(String address2) { - this.address2 = address2; - return this; - } - - /** - * Get address2 - * @return address2 - */ - @javax.annotation.Nullable - public String getAddress2() { - return address2; - } - - public void setAddress2(String address2) { - this.address2 = address2; - } - - - public FormRequestCsvBase city(String city) { - this.city = city; - return this; - } - - /** - * Get city - * @return city - */ - @javax.annotation.Nullable - public String getCity() { - return city; - } - - public void setCity(String city) { - this.city = city; - } - - - public FormRequestCsvBase state(String state) { - this.state = state; - return this; - } - - /** - * Get state - * @return state - */ - @javax.annotation.Nullable - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state; - } - - - public FormRequestCsvBase zip(String zip) { - this.zip = zip; - return this; - } - - /** - * Get zip - * @return zip - */ - @javax.annotation.Nullable - public String getZip() { - return zip; - } - - public void setZip(String zip) { - this.zip = zip; - } - - - public FormRequestCsvBase recipientEmail(String recipientEmail) { - this.recipientEmail = recipientEmail; - return this; - } - - /** - * Get recipientEmail - * @return recipientEmail - */ - @javax.annotation.Nullable - public String getRecipientEmail() { - return recipientEmail; - } - - public void setRecipientEmail(String recipientEmail) { - this.recipientEmail = recipientEmail; - } - - - public FormRequestCsvBase accountNumber(String accountNumber) { - this.accountNumber = accountNumber; - return this; - } - - /** - * Get accountNumber - * @return accountNumber - */ - @javax.annotation.Nullable - public String getAccountNumber() { - return accountNumber; - } - - public void setAccountNumber(String accountNumber) { - this.accountNumber = accountNumber; - } - - - public FormRequestCsvBase officeCode(String officeCode) { - this.officeCode = officeCode; - return this; - } - - /** - * Get officeCode - * @return officeCode - */ - @javax.annotation.Nullable - public String getOfficeCode() { - return officeCode; - } - - public void setOfficeCode(String officeCode) { - this.officeCode = officeCode; - } - - - public FormRequestCsvBase recipientNonUsProvince(String recipientNonUsProvince) { - this.recipientNonUsProvince = recipientNonUsProvince; - return this; - } - - /** - * Get recipientNonUsProvince - * @return recipientNonUsProvince - */ - @javax.annotation.Nullable - public String getRecipientNonUsProvince() { - return recipientNonUsProvince; - } - - public void setRecipientNonUsProvince(String recipientNonUsProvince) { - this.recipientNonUsProvince = recipientNonUsProvince; - } - - - public FormRequestCsvBase countryCode(String countryCode) { - this.countryCode = countryCode; - return this; - } - - /** - * Get countryCode - * @return countryCode - */ - @javax.annotation.Nullable - public String getCountryCode() { - return countryCode; - } - - public void setCountryCode(String countryCode) { - this.countryCode = countryCode; - } - - - public FormRequestCsvBase federalEFile(Boolean federalEFile) { - this.federalEFile = federalEFile; - return this; - } - - /** - * Get federalEFile - * @return federalEFile - */ - @javax.annotation.Nullable - public Boolean getFederalEFile() { - return federalEFile; - } - - public void setFederalEFile(Boolean federalEFile) { - this.federalEFile = federalEFile; - } - - - public FormRequestCsvBase postalMail(Boolean postalMail) { - this.postalMail = postalMail; - return this; - } - - /** - * Get postalMail - * @return postalMail - */ - @javax.annotation.Nullable - public Boolean getPostalMail() { - return postalMail; - } - - public void setPostalMail(Boolean postalMail) { - this.postalMail = postalMail; - } - - - public FormRequestCsvBase stateEFile(Boolean stateEFile) { - this.stateEFile = stateEFile; - return this; - } - - /** - * Get stateEFile - * @return stateEFile - */ - @javax.annotation.Nullable - public Boolean getStateEFile() { - return stateEFile; - } - - public void setStateEFile(Boolean stateEFile) { - this.stateEFile = stateEFile; - } - - - public FormRequestCsvBase tinMatch(Boolean tinMatch) { - this.tinMatch = tinMatch; - return this; - } - - /** - * Get tinMatch - * @return tinMatch - */ - @javax.annotation.Nullable - public Boolean getTinMatch() { - return tinMatch; - } - - public void setTinMatch(Boolean tinMatch) { - this.tinMatch = tinMatch; - } - - - public FormRequestCsvBase addressVerification(Boolean addressVerification) { - this.addressVerification = addressVerification; - return this; - } - - /** - * Get addressVerification - * @return addressVerification - */ - @javax.annotation.Nullable - public Boolean getAddressVerification() { - return addressVerification; - } - - public void setAddressVerification(Boolean addressVerification) { - this.addressVerification = addressVerification; - } - - - public FormRequestCsvBase stateAndLocalWithholding(StateAndLocalWithholdingRequest stateAndLocalWithholding) { - this.stateAndLocalWithholding = stateAndLocalWithholding; - return this; - } - - /** - * Get stateAndLocalWithholding - * @return stateAndLocalWithholding - */ - @javax.annotation.Nullable - public StateAndLocalWithholdingRequest getStateAndLocalWithholding() { - return stateAndLocalWithholding; - } - - public void setStateAndLocalWithholding(StateAndLocalWithholdingRequest stateAndLocalWithholding) { - this.stateAndLocalWithholding = stateAndLocalWithholding; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FormRequestCsvBase formRequestCsvBase = (FormRequestCsvBase) o; - return Objects.equals(this.issuerReferenceId, formRequestCsvBase.issuerReferenceId) && - Objects.equals(this.issuerTin, formRequestCsvBase.issuerTin) && - Objects.equals(this.taxYear, formRequestCsvBase.taxYear) && - Objects.equals(this.issuerId, formRequestCsvBase.issuerId) && - Objects.equals(this.referenceId, formRequestCsvBase.referenceId) && - Objects.equals(this.recipientName, formRequestCsvBase.recipientName) && - Objects.equals(this.recipientTin, formRequestCsvBase.recipientTin) && - Objects.equals(this.tinType, formRequestCsvBase.tinType) && - Objects.equals(this.recipientSecondName, formRequestCsvBase.recipientSecondName) && - Objects.equals(this.address, formRequestCsvBase.address) && - Objects.equals(this.address2, formRequestCsvBase.address2) && - Objects.equals(this.city, formRequestCsvBase.city) && - Objects.equals(this.state, formRequestCsvBase.state) && - Objects.equals(this.zip, formRequestCsvBase.zip) && - Objects.equals(this.recipientEmail, formRequestCsvBase.recipientEmail) && - Objects.equals(this.accountNumber, formRequestCsvBase.accountNumber) && - Objects.equals(this.officeCode, formRequestCsvBase.officeCode) && - Objects.equals(this.recipientNonUsProvince, formRequestCsvBase.recipientNonUsProvince) && - Objects.equals(this.countryCode, formRequestCsvBase.countryCode) && - Objects.equals(this.federalEFile, formRequestCsvBase.federalEFile) && - Objects.equals(this.postalMail, formRequestCsvBase.postalMail) && - Objects.equals(this.stateEFile, formRequestCsvBase.stateEFile) && - Objects.equals(this.tinMatch, formRequestCsvBase.tinMatch) && - Objects.equals(this.addressVerification, formRequestCsvBase.addressVerification) && - Objects.equals(this.stateAndLocalWithholding, formRequestCsvBase.stateAndLocalWithholding); - } - - 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(issuerReferenceId, issuerTin, taxYear, issuerId, referenceId, recipientName, recipientTin, tinType, recipientSecondName, address, address2, city, state, zip, recipientEmail, accountNumber, officeCode, recipientNonUsProvince, countryCode, federalEFile, postalMail, stateEFile, tinMatch, addressVerification, stateAndLocalWithholding); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FormRequestCsvBase {\n"); - sb.append(" issuerReferenceId: ").append(toIndentedString(issuerReferenceId)).append("\n"); - sb.append(" issuerTin: ").append(toIndentedString(issuerTin)).append("\n"); - sb.append(" taxYear: ").append(toIndentedString(taxYear)).append("\n"); - sb.append(" issuerId: ").append(toIndentedString(issuerId)).append("\n"); - sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); - sb.append(" recipientName: ").append(toIndentedString(recipientName)).append("\n"); - sb.append(" recipientTin: ").append(toIndentedString(recipientTin)).append("\n"); - sb.append(" tinType: ").append(toIndentedString(tinType)).append("\n"); - sb.append(" recipientSecondName: ").append(toIndentedString(recipientSecondName)).append("\n"); - sb.append(" address: ").append(toIndentedString(address)).append("\n"); - sb.append(" address2: ").append(toIndentedString(address2)).append("\n"); - sb.append(" city: ").append(toIndentedString(city)).append("\n"); - sb.append(" state: ").append(toIndentedString(state)).append("\n"); - sb.append(" zip: ").append(toIndentedString(zip)).append("\n"); - sb.append(" recipientEmail: ").append(toIndentedString(recipientEmail)).append("\n"); - sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); - sb.append(" officeCode: ").append(toIndentedString(officeCode)).append("\n"); - sb.append(" recipientNonUsProvince: ").append(toIndentedString(recipientNonUsProvince)).append("\n"); - sb.append(" countryCode: ").append(toIndentedString(countryCode)).append("\n"); - sb.append(" federalEFile: ").append(toIndentedString(federalEFile)).append("\n"); - sb.append(" postalMail: ").append(toIndentedString(postalMail)).append("\n"); - sb.append(" stateEFile: ").append(toIndentedString(stateEFile)).append("\n"); - sb.append(" tinMatch: ").append(toIndentedString(tinMatch)).append("\n"); - sb.append(" addressVerification: ").append(toIndentedString(addressVerification)).append("\n"); - sb.append(" stateAndLocalWithholding: ").append(toIndentedString(stateAndLocalWithholding)).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("issuerId"); - openapiFields.add("referenceId"); - openapiFields.add("recipientName"); - openapiFields.add("recipientTin"); - openapiFields.add("tinType"); - openapiFields.add("recipientSecondName"); - openapiFields.add("address"); - openapiFields.add("address2"); - openapiFields.add("city"); - openapiFields.add("state"); - openapiFields.add("zip"); - openapiFields.add("recipientEmail"); - openapiFields.add("accountNumber"); - openapiFields.add("officeCode"); - openapiFields.add("recipientNonUsProvince"); - openapiFields.add("countryCode"); - openapiFields.add("federalEFile"); - openapiFields.add("postalMail"); - openapiFields.add("stateEFile"); - openapiFields.add("tinMatch"); - openapiFields.add("addressVerification"); - openapiFields.add("stateAndLocalWithholding"); - - // 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 FormRequestCsvBase - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!FormRequestCsvBase.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in FormRequestCsvBase is not found in the empty JSON string", FormRequestCsvBase.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!FormRequestCsvBase.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FormRequestCsvBase` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("issuerReferenceId") != null && !jsonObj.get("issuerReferenceId").isJsonNull()) && !jsonObj.get("issuerReferenceId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `issuerReferenceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerReferenceId").toString())); - } - if ((jsonObj.get("issuerTin") != null && !jsonObj.get("issuerTin").isJsonNull()) && !jsonObj.get("issuerTin").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `issuerTin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerTin").toString())); - } - if ((jsonObj.get("issuerId") != null && !jsonObj.get("issuerId").isJsonNull()) && !jsonObj.get("issuerId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `issuerId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerId").toString())); - } - if ((jsonObj.get("referenceId") != null && !jsonObj.get("referenceId").isJsonNull()) && !jsonObj.get("referenceId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `referenceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("referenceId").toString())); - } - if ((jsonObj.get("recipientName") != null && !jsonObj.get("recipientName").isJsonNull()) && !jsonObj.get("recipientName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `recipientName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientName").toString())); - } - if ((jsonObj.get("recipientTin") != null && !jsonObj.get("recipientTin").isJsonNull()) && !jsonObj.get("recipientTin").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `recipientTin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientTin").toString())); - } - if ((jsonObj.get("tinType") != null && !jsonObj.get("tinType").isJsonNull()) && !jsonObj.get("tinType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `tinType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tinType").toString())); - } - // validate the optional field `tinType` - if (jsonObj.get("tinType") != null && !jsonObj.get("tinType").isJsonNull()) { - TinTypeEnum.validateJsonElement(jsonObj.get("tinType")); - } - if ((jsonObj.get("recipientSecondName") != null && !jsonObj.get("recipientSecondName").isJsonNull()) && !jsonObj.get("recipientSecondName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `recipientSecondName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientSecondName").toString())); - } - if ((jsonObj.get("address") != null && !jsonObj.get("address").isJsonNull()) && !jsonObj.get("address").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address").toString())); - } - if ((jsonObj.get("address2") != null && !jsonObj.get("address2").isJsonNull()) && !jsonObj.get("address2").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `address2` to be a primitive type in the JSON string but got `%s`", jsonObj.get("address2").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("zip") != null && !jsonObj.get("zip").isJsonNull()) && !jsonObj.get("zip").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `zip` to be a primitive type in the JSON string but got `%s`", jsonObj.get("zip").toString())); - } - if ((jsonObj.get("recipientEmail") != null && !jsonObj.get("recipientEmail").isJsonNull()) && !jsonObj.get("recipientEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `recipientEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientEmail").toString())); - } - if ((jsonObj.get("accountNumber") != null && !jsonObj.get("accountNumber").isJsonNull()) && !jsonObj.get("accountNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); - } - if ((jsonObj.get("officeCode") != null && !jsonObj.get("officeCode").isJsonNull()) && !jsonObj.get("officeCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `officeCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("officeCode").toString())); - } - if ((jsonObj.get("recipientNonUsProvince") != null && !jsonObj.get("recipientNonUsProvince").isJsonNull()) && !jsonObj.get("recipientNonUsProvince").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `recipientNonUsProvince` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recipientNonUsProvince").toString())); - } - if ((jsonObj.get("countryCode") != null && !jsonObj.get("countryCode").isJsonNull()) && !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())); - } - // validate the optional field `stateAndLocalWithholding` - if (jsonObj.get("stateAndLocalWithholding") != null && !jsonObj.get("stateAndLocalWithholding").isJsonNull()) { - StateAndLocalWithholdingRequest.validateJsonElement(jsonObj.get("stateAndLocalWithholding")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!FormRequestCsvBase.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FormRequestCsvBase' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(FormRequestCsvBase.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, FormRequestCsvBase value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public FormRequestCsvBase read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of FormRequestCsvBase given an JSON string - * - * @param jsonString JSON string - * @return An instance of FormRequestCsvBase - * @throws IOException if the JSON string is invalid with respect to FormRequestCsvBase - */ - public static FormRequestCsvBase fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, FormRequestCsvBase.class); - } - - /** - * Convert an instance of FormRequestCsvBase to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/FormRequestModel.java b/src/main/java/Avalara/SDK/model/A1099/V2/FormRequestModel.java deleted file mode 100644 index fc80194..0000000 --- a/src/main/java/Avalara/SDK/model/A1099/V2/FormRequestModel.java +++ /dev/null @@ -1,647 +0,0 @@ -/* - * AvaTax Software Development Kit for Java (JRE) - * - * (c) 2004-2025 Avalara, Inc. - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - * - * Avalara 1099 & W-9 API Definition - * - * ## 🔐 Authentication Use **username/password** or generate a **license key** from: *Avalara Portal → Settings → License and API Keys*. [More on authentication methods](https://developer.avalara.com/avatax-dm-combined-erp/common-setup/authentication/authentication-methods/) [Test your credentials](https://developer.avalara.com/avatax/test-credentials/) ## 📘 API & SDK Documentation [Avalara SDK (.NET) on GitHub](https://github.com/avadev/Avalara-SDK-DotNet#avalarasdk--the-unified-c-library-for-next-gen-avalara-services) [Code Examples – 1099 API](https://github.com/avadev/Avalara-SDK-DotNet/blob/main/docs/A1099/V2/Class1099IssuersApi.md#call1099issuersget) - * - * @author Sachin Baijal - * @author Jonathan Wenger - * @copyright 2004-2025 Avalara, Inc. - * @license https://www.apache.org/licenses/LICENSE-2.0 - * @link https://github.com/avadev/Avalara-SDK-Java - */ - -package Avalara.SDK.model.A1099.V2; - -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.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; - -/** - * FormRequestModel - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") -public class FormRequestModel { - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private String id; - - /** - * Gets or Sets type - */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - FORM_REQUEST("FormRequest"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.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 TypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - TypeEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; - - /** - * \"W9\" is currently the only supported value - */ - @JsonAdapter(FormTypeEnum.Adapter.class) - public enum FormTypeEnum { - W9("W9"); - - private String value; - - FormTypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static FormTypeEnum fromValue(String value) { - for (FormTypeEnum b : FormTypeEnum.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 FormTypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public FormTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return FormTypeEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - FormTypeEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_FORM_TYPE = "formType"; - @SerializedName(SERIALIZED_NAME_FORM_TYPE) - private FormTypeEnum formType; - - public static final String SERIALIZED_NAME_COMPANY_ID = "companyId"; - @SerializedName(SERIALIZED_NAME_COMPANY_ID) - private Integer companyId; - - public static final String SERIALIZED_NAME_COMPANY_NAME = "companyName"; - @SerializedName(SERIALIZED_NAME_COMPANY_NAME) - private String companyName; - - public static final String SERIALIZED_NAME_COMPANY_EMAIL = "companyEmail"; - @SerializedName(SERIALIZED_NAME_COMPANY_EMAIL) - private String companyEmail; - - public static final String SERIALIZED_NAME_REFERENCE_ID = "referenceId"; - @SerializedName(SERIALIZED_NAME_REFERENCE_ID) - private String referenceId; - - public static final String SERIALIZED_NAME_SIGNED_AT = "signedAt"; - @SerializedName(SERIALIZED_NAME_SIGNED_AT) - private OffsetDateTime signedAt; - - /** - * Result of IRS TIN match query for name and TIN in the last signed form, null if signed_at is null - */ - @JsonAdapter(TinMatchStatusEnum.Adapter.class) - public enum TinMatchStatusEnum { - NONE("None"), - - MATCHED("Matched"); - - private String value; - - TinMatchStatusEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TinMatchStatusEnum fromValue(String value) { - for (TinMatchStatusEnum b : TinMatchStatusEnum.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 TinMatchStatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TinMatchStatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TinMatchStatusEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - TinMatchStatusEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_TIN_MATCH_STATUS = "tinMatchStatus"; - @SerializedName(SERIALIZED_NAME_TIN_MATCH_STATUS) - private TinMatchStatusEnum tinMatchStatus; - - public static final String SERIALIZED_NAME_EXPIRES_AT = "expiresAt"; - @SerializedName(SERIALIZED_NAME_EXPIRES_AT) - private OffsetDateTime expiresAt; - - public static final String SERIALIZED_NAME_SIGNED_PDF = "signedPdf"; - @SerializedName(SERIALIZED_NAME_SIGNED_PDF) - private String signedPdf; - - public FormRequestModel() { - } - - public FormRequestModel id(String id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - @javax.annotation.Nullable - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - - public FormRequestModel type(TypeEnum type) { - this.type = type; - return this; - } - - /** - * Get type - * @return type - */ - @javax.annotation.Nullable - public TypeEnum getType() { - return type; - } - - public void setType(TypeEnum type) { - this.type = type; - } - - - public FormRequestModel formType(FormTypeEnum formType) { - this.formType = formType; - return this; - } - - /** - * \"W9\" is currently the only supported value - * @return formType - */ - @javax.annotation.Nullable - public FormTypeEnum getFormType() { - return formType; - } - - public void setFormType(FormTypeEnum formType) { - this.formType = formType; - } - - - public FormRequestModel companyId(Integer companyId) { - this.companyId = companyId; - return this; - } - - /** - * Track1099's ID of your company, found in the W-9 UI - * @return companyId - */ - @javax.annotation.Nullable - public Integer getCompanyId() { - return companyId; - } - - public void setCompanyId(Integer companyId) { - this.companyId = companyId; - } - - - public FormRequestModel companyName(String companyName) { - this.companyName = companyName; - return this; - } - - /** - * Name of your company, set in the W-9 UI - * @return companyName - */ - @javax.annotation.Nullable - public String getCompanyName() { - return companyName; - } - - public void setCompanyName(String companyName) { - this.companyName = companyName; - } - - - public FormRequestModel companyEmail(String companyEmail) { - this.companyEmail = companyEmail; - return this; - } - - /** - * Contact email of your company, set in the W-9 UI - * @return companyEmail - */ - @javax.annotation.Nullable - public String getCompanyEmail() { - return companyEmail; - } - - public void setCompanyEmail(String companyEmail) { - this.companyEmail = companyEmail; - } - - - public FormRequestModel referenceId(String referenceId) { - this.referenceId = referenceId; - return this; - } - - /** - * Your internal identifier for the vendor from whom you are requesting a form - * @return referenceId - */ - @javax.annotation.Nullable - public String getReferenceId() { - return referenceId; - } - - public void setReferenceId(String referenceId) { - this.referenceId = referenceId; - } - - - public FormRequestModel signedAt(OffsetDateTime signedAt) { - this.signedAt = signedAt; - return this; - } - - /** - * The timestamp this vendor (identified by your ReferenceId) last signed a complete W-9, null if you did not include a ReferenceId or the vendor has not yet signed a W-9 in Track1099 - * @return signedAt - */ - @javax.annotation.Nullable - public OffsetDateTime getSignedAt() { - return signedAt; - } - - public void setSignedAt(OffsetDateTime signedAt) { - this.signedAt = signedAt; - } - - - public FormRequestModel tinMatchStatus(TinMatchStatusEnum tinMatchStatus) { - this.tinMatchStatus = tinMatchStatus; - return this; - } - - /** - * Result of IRS TIN match query for name and TIN in the last signed form, null if signed_at is null - * @return tinMatchStatus - */ - @javax.annotation.Nullable - public TinMatchStatusEnum getTinMatchStatus() { - return tinMatchStatus; - } - - public void setTinMatchStatus(TinMatchStatusEnum tinMatchStatus) { - this.tinMatchStatus = tinMatchStatus; - } - - - public FormRequestModel expiresAt(OffsetDateTime expiresAt) { - this.expiresAt = expiresAt; - return this; - } - - /** - * Timestamp when this FormRequest will expire, ttl (or 3600) seconds from creation - * @return expiresAt - */ - @javax.annotation.Nullable - public OffsetDateTime getExpiresAt() { - return expiresAt; - } - - public void setExpiresAt(OffsetDateTime expiresAt) { - this.expiresAt = expiresAt; - } - - - public FormRequestModel signedPdf(String signedPdf) { - this.signedPdf = signedPdf; - return this; - } - - /** - * URL of PDF representation of just-signed form, otherwise null. Integrations may use this value to offer a \"download for your records\" function after a vendor completes and signs a form. Link expires at the same time as this FormRequest. Treat the format of this URL as opaque and expect it to change in the future. - * @return signedPdf - */ - @javax.annotation.Nullable - public String getSignedPdf() { - return signedPdf; - } - - public void setSignedPdf(String signedPdf) { - this.signedPdf = signedPdf; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FormRequestModel formRequestModel = (FormRequestModel) o; - return Objects.equals(this.id, formRequestModel.id) && - Objects.equals(this.type, formRequestModel.type) && - Objects.equals(this.formType, formRequestModel.formType) && - Objects.equals(this.companyId, formRequestModel.companyId) && - Objects.equals(this.companyName, formRequestModel.companyName) && - Objects.equals(this.companyEmail, formRequestModel.companyEmail) && - Objects.equals(this.referenceId, formRequestModel.referenceId) && - Objects.equals(this.signedAt, formRequestModel.signedAt) && - Objects.equals(this.tinMatchStatus, formRequestModel.tinMatchStatus) && - Objects.equals(this.expiresAt, formRequestModel.expiresAt) && - Objects.equals(this.signedPdf, formRequestModel.signedPdf); - } - - @Override - public int hashCode() { - return Objects.hash(id, type, formType, companyId, companyName, companyEmail, referenceId, signedAt, tinMatchStatus, expiresAt, signedPdf); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FormRequestModel {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" formType: ").append(toIndentedString(formType)).append("\n"); - sb.append(" companyId: ").append(toIndentedString(companyId)).append("\n"); - sb.append(" companyName: ").append(toIndentedString(companyName)).append("\n"); - sb.append(" companyEmail: ").append(toIndentedString(companyEmail)).append("\n"); - sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); - sb.append(" signedAt: ").append(toIndentedString(signedAt)).append("\n"); - sb.append(" tinMatchStatus: ").append(toIndentedString(tinMatchStatus)).append("\n"); - sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); - sb.append(" signedPdf: ").append(toIndentedString(signedPdf)).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(); - - // 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 FormRequestModel - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!FormRequestModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in FormRequestModel is not found in the empty JSON string", FormRequestModel.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!FormRequestModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FormRequestModel` 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("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - // validate the optional field `type` - if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) { - TypeEnum.validateJsonElement(jsonObj.get("type")); - } - if ((jsonObj.get("formType") != null && !jsonObj.get("formType").isJsonNull()) && !jsonObj.get("formType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `formType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("formType").toString())); - } - // validate the optional field `formType` - if (jsonObj.get("formType") != null && !jsonObj.get("formType").isJsonNull()) { - FormTypeEnum.validateJsonElement(jsonObj.get("formType")); - } - if ((jsonObj.get("companyName") != null && !jsonObj.get("companyName").isJsonNull()) && !jsonObj.get("companyName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `companyName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("companyName").toString())); - } - if ((jsonObj.get("companyEmail") != null && !jsonObj.get("companyEmail").isJsonNull()) && !jsonObj.get("companyEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `companyEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("companyEmail").toString())); - } - if ((jsonObj.get("referenceId") != null && !jsonObj.get("referenceId").isJsonNull()) && !jsonObj.get("referenceId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `referenceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("referenceId").toString())); - } - if ((jsonObj.get("tinMatchStatus") != null && !jsonObj.get("tinMatchStatus").isJsonNull()) && !jsonObj.get("tinMatchStatus").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `tinMatchStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tinMatchStatus").toString())); - } - // validate the optional field `tinMatchStatus` - if (jsonObj.get("tinMatchStatus") != null && !jsonObj.get("tinMatchStatus").isJsonNull()) { - TinMatchStatusEnum.validateJsonElement(jsonObj.get("tinMatchStatus")); - } - if ((jsonObj.get("signedPdf") != null && !jsonObj.get("signedPdf").isJsonNull()) && !jsonObj.get("signedPdf").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `signedPdf` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signedPdf").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!FormRequestModel.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FormRequestModel' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(FormRequestModel.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, FormRequestModel value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public FormRequestModel read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of FormRequestModel given an JSON string - * - * @param jsonString JSON string - * @return An instance of FormRequestModel - * @throws IOException if the JSON string is invalid with respect to FormRequestModel - */ - public static FormRequestModel fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, FormRequestModel.class); - } - - /** - * Convert an instance of FormRequestModel to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/Get1099Form200Response.java b/src/main/java/Avalara/SDK/model/A1099/V2/Get1099Form200Response.java index fd74235..abfbeaf 100644 --- a/src/main/java/Avalara/SDK/model/A1099/V2/Get1099Form200Response.java +++ b/src/main/java/Avalara/SDK/model/A1099/V2/Get1099Form200Response.java @@ -20,28 +20,30 @@ package Avalara.SDK.model.A1099.V2; import java.util.Objects; -import Avalara.SDK.model.A1099.V2.CoveredIndividualReferenceResponse; -import Avalara.SDK.model.A1099.V2.Form1042SListItemResponse; -import Avalara.SDK.model.A1099.V2.Form1095BListItemResponse; -import Avalara.SDK.model.A1099.V2.Form1099BaseResponse; -import Avalara.SDK.model.A1099.V2.Form1099DivListItemResponse; -import Avalara.SDK.model.A1099.V2.Form1099IntListItemResponse; -import Avalara.SDK.model.A1099.V2.Form1099KListItemResponse; -import Avalara.SDK.model.A1099.V2.Form1099MiscListItemResponse; -import Avalara.SDK.model.A1099.V2.Form1099NecListItemResponse; -import Avalara.SDK.model.A1099.V2.Form1099RListItemResponse; -import Avalara.SDK.model.A1099.V2.IntermediaryOrFlowThroughResponse; -import Avalara.SDK.model.A1099.V2.PrimaryWithholdingAgentResponse; -import Avalara.SDK.model.A1099.V2.StateAndLocalWithholdingResponse; -import Avalara.SDK.model.A1099.V2.StateEfileStatusDetailResponse; -import Avalara.SDK.model.A1099.V2.StatusDetail; -import Avalara.SDK.model.A1099.V2.ValidationErrorResponse; +import Avalara.SDK.model.A1099.V2.CoveredIndividual; +import Avalara.SDK.model.A1099.V2.Form1042S; +import Avalara.SDK.model.A1099.V2.Form1095B; +import Avalara.SDK.model.A1099.V2.Form1095C; +import Avalara.SDK.model.A1099.V2.Form1099Div; +import Avalara.SDK.model.A1099.V2.Form1099Int; +import Avalara.SDK.model.A1099.V2.Form1099K; +import Avalara.SDK.model.A1099.V2.Form1099Misc; +import Avalara.SDK.model.A1099.V2.Form1099Nec; +import Avalara.SDK.model.A1099.V2.Form1099R; +import Avalara.SDK.model.A1099.V2.Form1099StatusDetail; +import Avalara.SDK.model.A1099.V2.IntermediaryOrFlowThrough; +import Avalara.SDK.model.A1099.V2.OfferAndCoverage; +import Avalara.SDK.model.A1099.V2.PrimaryWithholdingAgent; +import Avalara.SDK.model.A1099.V2.StateAndLocalWithholding; +import Avalara.SDK.model.A1099.V2.StateEfileStatusDetail; +import Avalara.SDK.model.A1099.V2.ValidationError; 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.time.OffsetDateTime; import java.util.ArrayList; import java.util.Arrays; @@ -95,15 +97,15 @@ public TypeAdapter create(Gson gson, TypeToken type) { return null; // this class only serializes 'Get1099Form200Response' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter adapterForm1099BaseResponse = gson.getDelegateAdapter(this, TypeToken.get(Form1099BaseResponse.class)); - final TypeAdapter adapterForm1042SListItemResponse = gson.getDelegateAdapter(this, TypeToken.get(Form1042SListItemResponse.class)); - final TypeAdapter adapterForm1095BListItemResponse = gson.getDelegateAdapter(this, TypeToken.get(Form1095BListItemResponse.class)); - final TypeAdapter adapterForm1099DivListItemResponse = gson.getDelegateAdapter(this, TypeToken.get(Form1099DivListItemResponse.class)); - final TypeAdapter adapterForm1099IntListItemResponse = gson.getDelegateAdapter(this, TypeToken.get(Form1099IntListItemResponse.class)); - final TypeAdapter adapterForm1099KListItemResponse = gson.getDelegateAdapter(this, TypeToken.get(Form1099KListItemResponse.class)); - final TypeAdapter adapterForm1099MiscListItemResponse = gson.getDelegateAdapter(this, TypeToken.get(Form1099MiscListItemResponse.class)); - final TypeAdapter adapterForm1099NecListItemResponse = gson.getDelegateAdapter(this, TypeToken.get(Form1099NecListItemResponse.class)); - final TypeAdapter adapterForm1099RListItemResponse = gson.getDelegateAdapter(this, TypeToken.get(Form1099RListItemResponse.class)); + final TypeAdapter adapterForm1042S = gson.getDelegateAdapter(this, TypeToken.get(Form1042S.class)); + final TypeAdapter adapterForm1095B = gson.getDelegateAdapter(this, TypeToken.get(Form1095B.class)); + final TypeAdapter adapterForm1095C = gson.getDelegateAdapter(this, TypeToken.get(Form1095C.class)); + final TypeAdapter adapterForm1099Div = gson.getDelegateAdapter(this, TypeToken.get(Form1099Div.class)); + final TypeAdapter adapterForm1099Int = gson.getDelegateAdapter(this, TypeToken.get(Form1099Int.class)); + final TypeAdapter adapterForm1099K = gson.getDelegateAdapter(this, TypeToken.get(Form1099K.class)); + final TypeAdapter adapterForm1099Misc = gson.getDelegateAdapter(this, TypeToken.get(Form1099Misc.class)); + final TypeAdapter adapterForm1099Nec = gson.getDelegateAdapter(this, TypeToken.get(Form1099Nec.class)); + final TypeAdapter adapterForm1099R = gson.getDelegateAdapter(this, TypeToken.get(Form1099R.class)); return (TypeAdapter) new TypeAdapter() { @Override @@ -113,61 +115,61 @@ public void write(JsonWriter out, Get1099Form200Response value) throws IOExcepti return; } - // check if the actual instance is of the type `Form1099BaseResponse` - if (value.getActualInstance() instanceof Form1099BaseResponse) { - JsonElement element = adapterForm1099BaseResponse.toJsonTree((Form1099BaseResponse)value.getActualInstance()); + // check if the actual instance is of the type `Form1042S` + if (value.getActualInstance() instanceof Form1042S) { + JsonElement element = adapterForm1042S.toJsonTree((Form1042S)value.getActualInstance()); elementAdapter.write(out, element); return; } - // check if the actual instance is of the type `Form1042SListItemResponse` - if (value.getActualInstance() instanceof Form1042SListItemResponse) { - JsonElement element = adapterForm1042SListItemResponse.toJsonTree((Form1042SListItemResponse)value.getActualInstance()); + // check if the actual instance is of the type `Form1095B` + if (value.getActualInstance() instanceof Form1095B) { + JsonElement element = adapterForm1095B.toJsonTree((Form1095B)value.getActualInstance()); elementAdapter.write(out, element); return; } - // check if the actual instance is of the type `Form1095BListItemResponse` - if (value.getActualInstance() instanceof Form1095BListItemResponse) { - JsonElement element = adapterForm1095BListItemResponse.toJsonTree((Form1095BListItemResponse)value.getActualInstance()); + // check if the actual instance is of the type `Form1095C` + if (value.getActualInstance() instanceof Form1095C) { + JsonElement element = adapterForm1095C.toJsonTree((Form1095C)value.getActualInstance()); elementAdapter.write(out, element); return; } - // check if the actual instance is of the type `Form1099DivListItemResponse` - if (value.getActualInstance() instanceof Form1099DivListItemResponse) { - JsonElement element = adapterForm1099DivListItemResponse.toJsonTree((Form1099DivListItemResponse)value.getActualInstance()); + // check if the actual instance is of the type `Form1099Div` + if (value.getActualInstance() instanceof Form1099Div) { + JsonElement element = adapterForm1099Div.toJsonTree((Form1099Div)value.getActualInstance()); elementAdapter.write(out, element); return; } - // check if the actual instance is of the type `Form1099IntListItemResponse` - if (value.getActualInstance() instanceof Form1099IntListItemResponse) { - JsonElement element = adapterForm1099IntListItemResponse.toJsonTree((Form1099IntListItemResponse)value.getActualInstance()); + // check if the actual instance is of the type `Form1099Int` + if (value.getActualInstance() instanceof Form1099Int) { + JsonElement element = adapterForm1099Int.toJsonTree((Form1099Int)value.getActualInstance()); elementAdapter.write(out, element); return; } - // check if the actual instance is of the type `Form1099KListItemResponse` - if (value.getActualInstance() instanceof Form1099KListItemResponse) { - JsonElement element = adapterForm1099KListItemResponse.toJsonTree((Form1099KListItemResponse)value.getActualInstance()); + // check if the actual instance is of the type `Form1099K` + if (value.getActualInstance() instanceof Form1099K) { + JsonElement element = adapterForm1099K.toJsonTree((Form1099K)value.getActualInstance()); elementAdapter.write(out, element); return; } - // check if the actual instance is of the type `Form1099MiscListItemResponse` - if (value.getActualInstance() instanceof Form1099MiscListItemResponse) { - JsonElement element = adapterForm1099MiscListItemResponse.toJsonTree((Form1099MiscListItemResponse)value.getActualInstance()); + // check if the actual instance is of the type `Form1099Misc` + if (value.getActualInstance() instanceof Form1099Misc) { + JsonElement element = adapterForm1099Misc.toJsonTree((Form1099Misc)value.getActualInstance()); elementAdapter.write(out, element); return; } - // check if the actual instance is of the type `Form1099NecListItemResponse` - if (value.getActualInstance() instanceof Form1099NecListItemResponse) { - JsonElement element = adapterForm1099NecListItemResponse.toJsonTree((Form1099NecListItemResponse)value.getActualInstance()); + // check if the actual instance is of the type `Form1099Nec` + if (value.getActualInstance() instanceof Form1099Nec) { + JsonElement element = adapterForm1099Nec.toJsonTree((Form1099Nec)value.getActualInstance()); elementAdapter.write(out, element); return; } - // check if the actual instance is of the type `Form1099RListItemResponse` - if (value.getActualInstance() instanceof Form1099RListItemResponse) { - JsonElement element = adapterForm1099RListItemResponse.toJsonTree((Form1099RListItemResponse)value.getActualInstance()); + // check if the actual instance is of the type `Form1099R` + if (value.getActualInstance() instanceof Form1099R) { + JsonElement element = adapterForm1099R.toJsonTree((Form1099R)value.getActualInstance()); elementAdapter.write(out, element); return; } - throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Form1042SListItemResponse, Form1095BListItemResponse, Form1099BaseResponse, Form1099DivListItemResponse, Form1099IntListItemResponse, Form1099KListItemResponse, Form1099MiscListItemResponse, Form1099NecListItemResponse, Form1099RListItemResponse"); + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Form1042S, Form1095B, Form1095C, Form1099Div, Form1099Int, Form1099K, Form1099Misc, Form1099Nec, Form1099R"); } @Override @@ -179,113 +181,113 @@ public Get1099Form200Response read(JsonReader in) throws IOException { ArrayList errorMessages = new ArrayList<>(); TypeAdapter actualAdapter = elementAdapter; - // deserialize Form1099BaseResponse + // deserialize Form1042S try { // validate the JSON object to see if any exception is thrown - Form1099BaseResponse.validateJsonElement(jsonElement); - actualAdapter = adapterForm1099BaseResponse; + Form1042S.validateJsonElement(jsonElement); + actualAdapter = adapterForm1042S; match++; - log.log(Level.FINER, "Input data matches schema 'Form1099BaseResponse'"); + log.log(Level.FINER, "Input data matches schema 'Form1042S'"); } catch (Exception e) { // deserialization failed, continue - errorMessages.add(String.format("Deserialization for Form1099BaseResponse failed with `%s`.", e.getMessage())); - log.log(Level.FINER, "Input data does not match schema 'Form1099BaseResponse'", e); + errorMessages.add(String.format("Deserialization for Form1042S failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Form1042S'", e); } - // deserialize Form1042SListItemResponse + // deserialize Form1095B try { // validate the JSON object to see if any exception is thrown - Form1042SListItemResponse.validateJsonElement(jsonElement); - actualAdapter = adapterForm1042SListItemResponse; + Form1095B.validateJsonElement(jsonElement); + actualAdapter = adapterForm1095B; match++; - log.log(Level.FINER, "Input data matches schema 'Form1042SListItemResponse'"); + log.log(Level.FINER, "Input data matches schema 'Form1095B'"); } catch (Exception e) { // deserialization failed, continue - errorMessages.add(String.format("Deserialization for Form1042SListItemResponse failed with `%s`.", e.getMessage())); - log.log(Level.FINER, "Input data does not match schema 'Form1042SListItemResponse'", e); + errorMessages.add(String.format("Deserialization for Form1095B failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Form1095B'", e); } - // deserialize Form1095BListItemResponse + // deserialize Form1095C try { // validate the JSON object to see if any exception is thrown - Form1095BListItemResponse.validateJsonElement(jsonElement); - actualAdapter = adapterForm1095BListItemResponse; + Form1095C.validateJsonElement(jsonElement); + actualAdapter = adapterForm1095C; match++; - log.log(Level.FINER, "Input data matches schema 'Form1095BListItemResponse'"); + log.log(Level.FINER, "Input data matches schema 'Form1095C'"); } catch (Exception e) { // deserialization failed, continue - errorMessages.add(String.format("Deserialization for Form1095BListItemResponse failed with `%s`.", e.getMessage())); - log.log(Level.FINER, "Input data does not match schema 'Form1095BListItemResponse'", e); + errorMessages.add(String.format("Deserialization for Form1095C failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Form1095C'", e); } - // deserialize Form1099DivListItemResponse + // deserialize Form1099Div try { // validate the JSON object to see if any exception is thrown - Form1099DivListItemResponse.validateJsonElement(jsonElement); - actualAdapter = adapterForm1099DivListItemResponse; + Form1099Div.validateJsonElement(jsonElement); + actualAdapter = adapterForm1099Div; match++; - log.log(Level.FINER, "Input data matches schema 'Form1099DivListItemResponse'"); + log.log(Level.FINER, "Input data matches schema 'Form1099Div'"); } catch (Exception e) { // deserialization failed, continue - errorMessages.add(String.format("Deserialization for Form1099DivListItemResponse failed with `%s`.", e.getMessage())); - log.log(Level.FINER, "Input data does not match schema 'Form1099DivListItemResponse'", e); + errorMessages.add(String.format("Deserialization for Form1099Div failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Form1099Div'", e); } - // deserialize Form1099IntListItemResponse + // deserialize Form1099Int try { // validate the JSON object to see if any exception is thrown - Form1099IntListItemResponse.validateJsonElement(jsonElement); - actualAdapter = adapterForm1099IntListItemResponse; + Form1099Int.validateJsonElement(jsonElement); + actualAdapter = adapterForm1099Int; match++; - log.log(Level.FINER, "Input data matches schema 'Form1099IntListItemResponse'"); + log.log(Level.FINER, "Input data matches schema 'Form1099Int'"); } catch (Exception e) { // deserialization failed, continue - errorMessages.add(String.format("Deserialization for Form1099IntListItemResponse failed with `%s`.", e.getMessage())); - log.log(Level.FINER, "Input data does not match schema 'Form1099IntListItemResponse'", e); + errorMessages.add(String.format("Deserialization for Form1099Int failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Form1099Int'", e); } - // deserialize Form1099KListItemResponse + // deserialize Form1099K try { // validate the JSON object to see if any exception is thrown - Form1099KListItemResponse.validateJsonElement(jsonElement); - actualAdapter = adapterForm1099KListItemResponse; + Form1099K.validateJsonElement(jsonElement); + actualAdapter = adapterForm1099K; match++; - log.log(Level.FINER, "Input data matches schema 'Form1099KListItemResponse'"); + log.log(Level.FINER, "Input data matches schema 'Form1099K'"); } catch (Exception e) { // deserialization failed, continue - errorMessages.add(String.format("Deserialization for Form1099KListItemResponse failed with `%s`.", e.getMessage())); - log.log(Level.FINER, "Input data does not match schema 'Form1099KListItemResponse'", e); + errorMessages.add(String.format("Deserialization for Form1099K failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Form1099K'", e); } - // deserialize Form1099MiscListItemResponse + // deserialize Form1099Misc try { // validate the JSON object to see if any exception is thrown - Form1099MiscListItemResponse.validateJsonElement(jsonElement); - actualAdapter = adapterForm1099MiscListItemResponse; + Form1099Misc.validateJsonElement(jsonElement); + actualAdapter = adapterForm1099Misc; match++; - log.log(Level.FINER, "Input data matches schema 'Form1099MiscListItemResponse'"); + log.log(Level.FINER, "Input data matches schema 'Form1099Misc'"); } catch (Exception e) { // deserialization failed, continue - errorMessages.add(String.format("Deserialization for Form1099MiscListItemResponse failed with `%s`.", e.getMessage())); - log.log(Level.FINER, "Input data does not match schema 'Form1099MiscListItemResponse'", e); + errorMessages.add(String.format("Deserialization for Form1099Misc failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Form1099Misc'", e); } - // deserialize Form1099NecListItemResponse + // deserialize Form1099Nec try { // validate the JSON object to see if any exception is thrown - Form1099NecListItemResponse.validateJsonElement(jsonElement); - actualAdapter = adapterForm1099NecListItemResponse; + Form1099Nec.validateJsonElement(jsonElement); + actualAdapter = adapterForm1099Nec; match++; - log.log(Level.FINER, "Input data matches schema 'Form1099NecListItemResponse'"); + log.log(Level.FINER, "Input data matches schema 'Form1099Nec'"); } catch (Exception e) { // deserialization failed, continue - errorMessages.add(String.format("Deserialization for Form1099NecListItemResponse failed with `%s`.", e.getMessage())); - log.log(Level.FINER, "Input data does not match schema 'Form1099NecListItemResponse'", e); + errorMessages.add(String.format("Deserialization for Form1099Nec failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Form1099Nec'", e); } - // deserialize Form1099RListItemResponse + // deserialize Form1099R try { // validate the JSON object to see if any exception is thrown - Form1099RListItemResponse.validateJsonElement(jsonElement); - actualAdapter = adapterForm1099RListItemResponse; + Form1099R.validateJsonElement(jsonElement); + actualAdapter = adapterForm1099R; match++; - log.log(Level.FINER, "Input data matches schema 'Form1099RListItemResponse'"); + log.log(Level.FINER, "Input data matches schema 'Form1099R'"); } catch (Exception e) { // deserialization failed, continue - errorMessages.add(String.format("Deserialization for Form1099RListItemResponse failed with `%s`.", e.getMessage())); - log.log(Level.FINER, "Input data does not match schema 'Form1099RListItemResponse'", e); + errorMessages.add(String.format("Deserialization for Form1099R failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Form1099R'", e); } if (match == 1) { @@ -313,15 +315,15 @@ public Get1099Form200Response(Object o) { } static { - schemas.put("Form1099BaseResponse", Form1099BaseResponse.class); - schemas.put("Form1042SListItemResponse", Form1042SListItemResponse.class); - schemas.put("Form1095BListItemResponse", Form1095BListItemResponse.class); - schemas.put("Form1099DivListItemResponse", Form1099DivListItemResponse.class); - schemas.put("Form1099IntListItemResponse", Form1099IntListItemResponse.class); - schemas.put("Form1099KListItemResponse", Form1099KListItemResponse.class); - schemas.put("Form1099MiscListItemResponse", Form1099MiscListItemResponse.class); - schemas.put("Form1099NecListItemResponse", Form1099NecListItemResponse.class); - schemas.put("Form1099RListItemResponse", Form1099RListItemResponse.class); + schemas.put("Form1042S", Form1042S.class); + schemas.put("Form1095B", Form1095B.class); + schemas.put("Form1095C", Form1095C.class); + schemas.put("Form1099Div", Form1099Div.class); + schemas.put("Form1099Int", Form1099Int.class); + schemas.put("Form1099K", Form1099K.class); + schemas.put("Form1099Misc", Form1099Misc.class); + schemas.put("Form1099Nec", Form1099Nec.class); + schemas.put("Form1099R", Form1099R.class); } @Override @@ -332,65 +334,65 @@ public Map> getSchemas() { /** * Set the instance that matches the oneOf child schema, check * the instance parameter is valid against the oneOf child schemas: - * Form1042SListItemResponse, Form1095BListItemResponse, Form1099BaseResponse, Form1099DivListItemResponse, Form1099IntListItemResponse, Form1099KListItemResponse, Form1099MiscListItemResponse, Form1099NecListItemResponse, Form1099RListItemResponse + * Form1042S, Form1095B, Form1095C, Form1099Div, Form1099Int, Form1099K, Form1099Misc, Form1099Nec, Form1099R * * It could be an instance of the 'oneOf' schemas. */ @Override public void setActualInstance(Object instance) { - if (instance instanceof Form1099BaseResponse) { + if (instance instanceof Form1042S) { super.setActualInstance(instance); return; } - if (instance instanceof Form1042SListItemResponse) { + if (instance instanceof Form1095B) { super.setActualInstance(instance); return; } - if (instance instanceof Form1095BListItemResponse) { + if (instance instanceof Form1095C) { super.setActualInstance(instance); return; } - if (instance instanceof Form1099DivListItemResponse) { + if (instance instanceof Form1099Div) { super.setActualInstance(instance); return; } - if (instance instanceof Form1099IntListItemResponse) { + if (instance instanceof Form1099Int) { super.setActualInstance(instance); return; } - if (instance instanceof Form1099KListItemResponse) { + if (instance instanceof Form1099K) { super.setActualInstance(instance); return; } - if (instance instanceof Form1099MiscListItemResponse) { + if (instance instanceof Form1099Misc) { super.setActualInstance(instance); return; } - if (instance instanceof Form1099NecListItemResponse) { + if (instance instanceof Form1099Nec) { super.setActualInstance(instance); return; } - if (instance instanceof Form1099RListItemResponse) { + if (instance instanceof Form1099R) { super.setActualInstance(instance); return; } - throw new RuntimeException("Invalid instance type. Must be Form1042SListItemResponse, Form1095BListItemResponse, Form1099BaseResponse, Form1099DivListItemResponse, Form1099IntListItemResponse, Form1099KListItemResponse, Form1099MiscListItemResponse, Form1099NecListItemResponse, Form1099RListItemResponse"); + throw new RuntimeException("Invalid instance type. Must be Form1042S, Form1095B, Form1095C, Form1099Div, Form1099Int, Form1099K, Form1099Misc, Form1099Nec, Form1099R"); } /** * Get the actual instance, which can be the following: - * Form1042SListItemResponse, Form1095BListItemResponse, Form1099BaseResponse, Form1099DivListItemResponse, Form1099IntListItemResponse, Form1099KListItemResponse, Form1099MiscListItemResponse, Form1099NecListItemResponse, Form1099RListItemResponse + * Form1042S, Form1095B, Form1095C, Form1099Div, Form1099Int, Form1099K, Form1099Misc, Form1099Nec, Form1099R * - * @return The actual instance (Form1042SListItemResponse, Form1095BListItemResponse, Form1099BaseResponse, Form1099DivListItemResponse, Form1099IntListItemResponse, Form1099KListItemResponse, Form1099MiscListItemResponse, Form1099NecListItemResponse, Form1099RListItemResponse) + * @return The actual instance (Form1042S, Form1095B, Form1095C, Form1099Div, Form1099Int, Form1099K, Form1099Misc, Form1099Nec, Form1099R) */ @SuppressWarnings("unchecked") @Override @@ -399,94 +401,94 @@ public Object getActualInstance() { } /** - * Get the actual instance of `Form1099BaseResponse`. If the actual instance is not `Form1099BaseResponse`, + * Get the actual instance of `Form1042S`. If the actual instance is not `Form1042S`, * the ClassCastException will be thrown. * - * @return The actual instance of `Form1099BaseResponse` - * @throws ClassCastException if the instance is not `Form1099BaseResponse` + * @return The actual instance of `Form1042S` + * @throws ClassCastException if the instance is not `Form1042S` */ - public Form1099BaseResponse getForm1099BaseResponse() throws ClassCastException { - return (Form1099BaseResponse)super.getActualInstance(); + public Form1042S getForm1042S() throws ClassCastException { + return (Form1042S)super.getActualInstance(); } /** - * Get the actual instance of `Form1042SListItemResponse`. If the actual instance is not `Form1042SListItemResponse`, + * Get the actual instance of `Form1095B`. If the actual instance is not `Form1095B`, * the ClassCastException will be thrown. * - * @return The actual instance of `Form1042SListItemResponse` - * @throws ClassCastException if the instance is not `Form1042SListItemResponse` + * @return The actual instance of `Form1095B` + * @throws ClassCastException if the instance is not `Form1095B` */ - public Form1042SListItemResponse getForm1042SListItemResponse() throws ClassCastException { - return (Form1042SListItemResponse)super.getActualInstance(); + public Form1095B getForm1095B() throws ClassCastException { + return (Form1095B)super.getActualInstance(); } /** - * Get the actual instance of `Form1095BListItemResponse`. If the actual instance is not `Form1095BListItemResponse`, + * Get the actual instance of `Form1095C`. If the actual instance is not `Form1095C`, * the ClassCastException will be thrown. * - * @return The actual instance of `Form1095BListItemResponse` - * @throws ClassCastException if the instance is not `Form1095BListItemResponse` + * @return The actual instance of `Form1095C` + * @throws ClassCastException if the instance is not `Form1095C` */ - public Form1095BListItemResponse getForm1095BListItemResponse() throws ClassCastException { - return (Form1095BListItemResponse)super.getActualInstance(); + public Form1095C getForm1095C() throws ClassCastException { + return (Form1095C)super.getActualInstance(); } /** - * Get the actual instance of `Form1099DivListItemResponse`. If the actual instance is not `Form1099DivListItemResponse`, + * Get the actual instance of `Form1099Div`. If the actual instance is not `Form1099Div`, * the ClassCastException will be thrown. * - * @return The actual instance of `Form1099DivListItemResponse` - * @throws ClassCastException if the instance is not `Form1099DivListItemResponse` + * @return The actual instance of `Form1099Div` + * @throws ClassCastException if the instance is not `Form1099Div` */ - public Form1099DivListItemResponse getForm1099DivListItemResponse() throws ClassCastException { - return (Form1099DivListItemResponse)super.getActualInstance(); + public Form1099Div getForm1099Div() throws ClassCastException { + return (Form1099Div)super.getActualInstance(); } /** - * Get the actual instance of `Form1099IntListItemResponse`. If the actual instance is not `Form1099IntListItemResponse`, + * Get the actual instance of `Form1099Int`. If the actual instance is not `Form1099Int`, * the ClassCastException will be thrown. * - * @return The actual instance of `Form1099IntListItemResponse` - * @throws ClassCastException if the instance is not `Form1099IntListItemResponse` + * @return The actual instance of `Form1099Int` + * @throws ClassCastException if the instance is not `Form1099Int` */ - public Form1099IntListItemResponse getForm1099IntListItemResponse() throws ClassCastException { - return (Form1099IntListItemResponse)super.getActualInstance(); + public Form1099Int getForm1099Int() throws ClassCastException { + return (Form1099Int)super.getActualInstance(); } /** - * Get the actual instance of `Form1099KListItemResponse`. If the actual instance is not `Form1099KListItemResponse`, + * Get the actual instance of `Form1099K`. If the actual instance is not `Form1099K`, * the ClassCastException will be thrown. * - * @return The actual instance of `Form1099KListItemResponse` - * @throws ClassCastException if the instance is not `Form1099KListItemResponse` + * @return The actual instance of `Form1099K` + * @throws ClassCastException if the instance is not `Form1099K` */ - public Form1099KListItemResponse getForm1099KListItemResponse() throws ClassCastException { - return (Form1099KListItemResponse)super.getActualInstance(); + public Form1099K getForm1099K() throws ClassCastException { + return (Form1099K)super.getActualInstance(); } /** - * Get the actual instance of `Form1099MiscListItemResponse`. If the actual instance is not `Form1099MiscListItemResponse`, + * Get the actual instance of `Form1099Misc`. If the actual instance is not `Form1099Misc`, * the ClassCastException will be thrown. * - * @return The actual instance of `Form1099MiscListItemResponse` - * @throws ClassCastException if the instance is not `Form1099MiscListItemResponse` + * @return The actual instance of `Form1099Misc` + * @throws ClassCastException if the instance is not `Form1099Misc` */ - public Form1099MiscListItemResponse getForm1099MiscListItemResponse() throws ClassCastException { - return (Form1099MiscListItemResponse)super.getActualInstance(); + public Form1099Misc getForm1099Misc() throws ClassCastException { + return (Form1099Misc)super.getActualInstance(); } /** - * Get the actual instance of `Form1099NecListItemResponse`. If the actual instance is not `Form1099NecListItemResponse`, + * Get the actual instance of `Form1099Nec`. If the actual instance is not `Form1099Nec`, * the ClassCastException will be thrown. * - * @return The actual instance of `Form1099NecListItemResponse` - * @throws ClassCastException if the instance is not `Form1099NecListItemResponse` + * @return The actual instance of `Form1099Nec` + * @throws ClassCastException if the instance is not `Form1099Nec` */ - public Form1099NecListItemResponse getForm1099NecListItemResponse() throws ClassCastException { - return (Form1099NecListItemResponse)super.getActualInstance(); + public Form1099Nec getForm1099Nec() throws ClassCastException { + return (Form1099Nec)super.getActualInstance(); } /** - * Get the actual instance of `Form1099RListItemResponse`. If the actual instance is not `Form1099RListItemResponse`, + * Get the actual instance of `Form1099R`. If the actual instance is not `Form1099R`, * the ClassCastException will be thrown. * - * @return The actual instance of `Form1099RListItemResponse` - * @throws ClassCastException if the instance is not `Form1099RListItemResponse` + * @return The actual instance of `Form1099R` + * @throws ClassCastException if the instance is not `Form1099R` */ - public Form1099RListItemResponse getForm1099RListItemResponse() throws ClassCastException { - return (Form1099RListItemResponse)super.getActualInstance(); + public Form1099R getForm1099R() throws ClassCastException { + return (Form1099R)super.getActualInstance(); } /** @@ -499,80 +501,80 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti // validate oneOf schemas one by one int validCount = 0; ArrayList errorMessages = new ArrayList<>(); - // validate the json string with Form1099BaseResponse + // validate the json string with Form1042S try { - Form1099BaseResponse.validateJsonElement(jsonElement); + Form1042S.validateJsonElement(jsonElement); validCount++; } catch (Exception e) { - errorMessages.add(String.format("Deserialization for Form1099BaseResponse failed with `%s`.", e.getMessage())); + errorMessages.add(String.format("Deserialization for Form1042S failed with `%s`.", e.getMessage())); // continue to the next one } - // validate the json string with Form1042SListItemResponse + // validate the json string with Form1095B try { - Form1042SListItemResponse.validateJsonElement(jsonElement); + Form1095B.validateJsonElement(jsonElement); validCount++; } catch (Exception e) { - errorMessages.add(String.format("Deserialization for Form1042SListItemResponse failed with `%s`.", e.getMessage())); + errorMessages.add(String.format("Deserialization for Form1095B failed with `%s`.", e.getMessage())); // continue to the next one } - // validate the json string with Form1095BListItemResponse + // validate the json string with Form1095C try { - Form1095BListItemResponse.validateJsonElement(jsonElement); + Form1095C.validateJsonElement(jsonElement); validCount++; } catch (Exception e) { - errorMessages.add(String.format("Deserialization for Form1095BListItemResponse failed with `%s`.", e.getMessage())); + errorMessages.add(String.format("Deserialization for Form1095C failed with `%s`.", e.getMessage())); // continue to the next one } - // validate the json string with Form1099DivListItemResponse + // validate the json string with Form1099Div try { - Form1099DivListItemResponse.validateJsonElement(jsonElement); + Form1099Div.validateJsonElement(jsonElement); validCount++; } catch (Exception e) { - errorMessages.add(String.format("Deserialization for Form1099DivListItemResponse failed with `%s`.", e.getMessage())); + errorMessages.add(String.format("Deserialization for Form1099Div failed with `%s`.", e.getMessage())); // continue to the next one } - // validate the json string with Form1099IntListItemResponse + // validate the json string with Form1099Int try { - Form1099IntListItemResponse.validateJsonElement(jsonElement); + Form1099Int.validateJsonElement(jsonElement); validCount++; } catch (Exception e) { - errorMessages.add(String.format("Deserialization for Form1099IntListItemResponse failed with `%s`.", e.getMessage())); + errorMessages.add(String.format("Deserialization for Form1099Int failed with `%s`.", e.getMessage())); // continue to the next one } - // validate the json string with Form1099KListItemResponse + // validate the json string with Form1099K try { - Form1099KListItemResponse.validateJsonElement(jsonElement); + Form1099K.validateJsonElement(jsonElement); validCount++; } catch (Exception e) { - errorMessages.add(String.format("Deserialization for Form1099KListItemResponse failed with `%s`.", e.getMessage())); + errorMessages.add(String.format("Deserialization for Form1099K failed with `%s`.", e.getMessage())); // continue to the next one } - // validate the json string with Form1099MiscListItemResponse + // validate the json string with Form1099Misc try { - Form1099MiscListItemResponse.validateJsonElement(jsonElement); + Form1099Misc.validateJsonElement(jsonElement); validCount++; } catch (Exception e) { - errorMessages.add(String.format("Deserialization for Form1099MiscListItemResponse failed with `%s`.", e.getMessage())); + errorMessages.add(String.format("Deserialization for Form1099Misc failed with `%s`.", e.getMessage())); // continue to the next one } - // validate the json string with Form1099NecListItemResponse + // validate the json string with Form1099Nec try { - Form1099NecListItemResponse.validateJsonElement(jsonElement); + Form1099Nec.validateJsonElement(jsonElement); validCount++; } catch (Exception e) { - errorMessages.add(String.format("Deserialization for Form1099NecListItemResponse failed with `%s`.", e.getMessage())); + errorMessages.add(String.format("Deserialization for Form1099Nec failed with `%s`.", e.getMessage())); // continue to the next one } - // validate the json string with Form1099RListItemResponse + // validate the json string with Form1099R try { - Form1099RListItemResponse.validateJsonElement(jsonElement); + Form1099R.validateJsonElement(jsonElement); validCount++; } catch (Exception e) { - errorMessages.add(String.format("Deserialization for Form1099RListItemResponse failed with `%s`.", e.getMessage())); + errorMessages.add(String.format("Deserialization for Form1099R failed with `%s`.", e.getMessage())); // continue to the next one } if (validCount != 1) { - throw new IOException(String.format("The JSON string is invalid for Get1099Form200Response with oneOf schemas: Form1042SListItemResponse, Form1095BListItemResponse, Form1099BaseResponse, Form1099DivListItemResponse, Form1099IntListItemResponse, Form1099KListItemResponse, Form1099MiscListItemResponse, Form1099NecListItemResponse, Form1099RListItemResponse. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + throw new IOException(String.format("The JSON string is invalid for Get1099Form200Response with oneOf schemas: Form1042S, Form1095B, Form1095C, Form1099Div, Form1099Int, Form1099K, Form1099Misc, Form1099Nec, Form1099R. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); } } diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/IntermediaryOrFlowThrough.java b/src/main/java/Avalara/SDK/model/A1099/V2/IntermediaryOrFlowThrough.java index e4a2045..4c92997 100644 --- a/src/main/java/Avalara/SDK/model/A1099/V2/IntermediaryOrFlowThrough.java +++ b/src/main/java/Avalara/SDK/model/A1099/V2/IntermediaryOrFlowThrough.java @@ -54,7 +54,7 @@ import Avalara.SDK.JSON; /** - * IntermediaryOrFlowThrough + * Intermediary or flow-through entity information for tax forms */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class IntermediaryOrFlowThrough { @@ -111,7 +111,7 @@ public IntermediaryOrFlowThrough ein(String ein) { } /** - * Get ein + * EIN (Employer Identification Number) of the intermediary or flow-through entity * @return ein */ @javax.annotation.Nullable @@ -130,7 +130,7 @@ public IntermediaryOrFlowThrough chap3StatusCode(String chap3StatusCode) { } /** - * Get chap3StatusCode + * Chapter 3 status code for the intermediary or flow-through entity * @return chap3StatusCode */ @javax.annotation.Nullable @@ -149,7 +149,7 @@ public IntermediaryOrFlowThrough chap4StatusCode(String chap4StatusCode) { } /** - * Get chap4StatusCode + * Chapter 4 status code for the intermediary or flow-through entity * @return chap4StatusCode */ @javax.annotation.Nullable @@ -168,7 +168,7 @@ public IntermediaryOrFlowThrough name(String name) { } /** - * Get name + * Name of the intermediary or flow-through entity * @return name */ @javax.annotation.Nullable @@ -187,7 +187,7 @@ public IntermediaryOrFlowThrough giin(String giin) { } /** - * Get giin + * GIIN (Global Intermediary Identification Number) of the intermediary or flow-through entity * @return giin */ @javax.annotation.Nullable @@ -206,7 +206,7 @@ public IntermediaryOrFlowThrough countryCode(String countryCode) { } /** - * Get countryCode + * Country code for the intermediary or flow-through entity * @return countryCode */ @javax.annotation.Nullable @@ -225,7 +225,7 @@ public IntermediaryOrFlowThrough foreignTin(String foreignTin) { } /** - * Get foreignTin + * Foreign TIN of the intermediary or flow-through entity * @return foreignTin */ @javax.annotation.Nullable @@ -244,7 +244,7 @@ public IntermediaryOrFlowThrough address(String address) { } /** - * Get address + * Address of the intermediary or flow-through entity * @return address */ @javax.annotation.Nullable @@ -263,7 +263,7 @@ public IntermediaryOrFlowThrough city(String city) { } /** - * Get city + * City of the intermediary or flow-through entity * @return city */ @javax.annotation.Nullable @@ -282,7 +282,7 @@ public IntermediaryOrFlowThrough state(String state) { } /** - * Get state + * State of the intermediary or flow-through entity * @return state */ @javax.annotation.Nullable @@ -301,7 +301,7 @@ public IntermediaryOrFlowThrough zip(String zip) { } /** - * Get zip + * Zip code of the intermediary or flow-through entity * @return zip */ @javax.annotation.Nullable diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/IssuerCommand.java b/src/main/java/Avalara/SDK/model/A1099/V2/IssuerCommand.java index f264092..17e3247 100644 --- a/src/main/java/Avalara/SDK/model/A1099/V2/IssuerCommand.java +++ b/src/main/java/Avalara/SDK/model/A1099/V2/IssuerCommand.java @@ -62,9 +62,9 @@ public class IssuerCommand { @SerializedName(SERIALIZED_NAME_NAME) private String name; - public static final String SERIALIZED_NAME_NAME_DBA = "nameDba"; - @SerializedName(SERIALIZED_NAME_NAME_DBA) - private String nameDba; + public static final String SERIALIZED_NAME_DBA_NAME = "dbaName"; + @SerializedName(SERIALIZED_NAME_DBA_NAME) + private String dbaName; public static final String SERIALIZED_NAME_TIN = "tin"; @SerializedName(SERIALIZED_NAME_TIN) @@ -127,7 +127,7 @@ public IssuerCommand name(String name) { } /** - * Legal name, not DBA + * Legal name. Not the DBA name. * @return name */ @javax.annotation.Nullable @@ -140,22 +140,22 @@ public void setName(String name) { } - public IssuerCommand nameDba(String nameDba) { - this.nameDba = nameDba; + public IssuerCommand dbaName(String dbaName) { + this.dbaName = dbaName; return this; } /** - * Optional DBA name or continuation of a long legal name - * @return nameDba + * Doing Business As (DBA) name or continuation of a long legal name. Use either this or 'transferAgentName'. + * @return dbaName */ @javax.annotation.Nullable - public String getNameDba() { - return nameDba; + public String getDbaName() { + return dbaName; } - public void setNameDba(String nameDba) { - this.nameDba = nameDba; + public void setDbaName(String dbaName) { + this.dbaName = dbaName; } @@ -165,7 +165,7 @@ public IssuerCommand tin(String tin) { } /** - * Tax identification number + * Federal Tax Identification Number (TIN). * @return tin */ @javax.annotation.Nullable @@ -184,7 +184,7 @@ public IssuerCommand referenceId(String referenceId) { } /** - * Optional identifier for your reference, never shown to any agency or recipient. We will also prefix download filenames with this value, if present. Can only include letters, numbers, dashes, underscores and spaces. + * Internal reference ID. Never shown to any agency or recipient. If present, it will prefix download filenames. Allowed characters: letters, numbers, dashes, underscores, and spaces. * @return referenceId */ @javax.annotation.Nullable @@ -203,7 +203,7 @@ public IssuerCommand telephone(String telephone) { } /** - * Telephone number + * Contact phone number (must contain at least 10 digits, max 15 characters). For recipient inquiries. * @return telephone */ @javax.annotation.Nullable @@ -222,7 +222,7 @@ public IssuerCommand taxYear(Integer taxYear) { } /** - * Tax year + * Tax year for which the forms are being filed (e.g., 2024). Must be within current tax year and current tax year - 4. * @return taxYear */ @javax.annotation.Nullable @@ -241,7 +241,7 @@ public IssuerCommand countryCode(String countryCode) { } /** - * If there is a transfer agent, use the shipping address of the transfer agent. + * Two-letter IRS country code (e.g., 'US', 'CA'), as defined at https://www.irs.gov/e-file-providers/country-codes. If there is a transfer agent, use the transfer agent's shipping address. * @return countryCode */ @javax.annotation.Nullable @@ -260,7 +260,7 @@ public IssuerCommand email(String email) { } /** - * Email address + * Contact email address. For recipient inquiries. * @return email */ @javax.annotation.Nullable @@ -279,7 +279,7 @@ public IssuerCommand address(String address) { } /** - * Address + * Address. * @return address */ @javax.annotation.Nullable @@ -298,7 +298,7 @@ public IssuerCommand city(String city) { } /** - * City + * City. * @return city */ @javax.annotation.Nullable @@ -317,7 +317,7 @@ public IssuerCommand state(String state) { } /** - * State + * Two-letter US state or Canadian province code (required for US/CA addresses). * @return state */ @javax.annotation.Nullable @@ -336,7 +336,7 @@ public IssuerCommand zip(String zip) { } /** - * Zip code + * ZIP/postal code. * @return zip */ @javax.annotation.Nullable @@ -355,7 +355,7 @@ public IssuerCommand foreignProvince(String foreignProvince) { } /** - * Foreign province + * Province or region for non-US/CA addresses. * @return foreignProvince */ @javax.annotation.Nullable @@ -374,7 +374,7 @@ public IssuerCommand transferAgentName(String transferAgentName) { } /** - * Transfer Agent's Name + * Name of the transfer agent, if applicable — optional; use either this or 'dbaName'. * @return transferAgentName */ @javax.annotation.Nullable @@ -393,7 +393,7 @@ public IssuerCommand lastFiling(Boolean lastFiling) { } /** - * Last year of filing for this payer + * Indicates if this is the issuer's final year filing. * @return lastFiling */ @javax.annotation.Nullable @@ -417,7 +417,7 @@ public boolean equals(Object o) { } IssuerCommand issuerCommand = (IssuerCommand) o; return Objects.equals(this.name, issuerCommand.name) && - Objects.equals(this.nameDba, issuerCommand.nameDba) && + Objects.equals(this.dbaName, issuerCommand.dbaName) && Objects.equals(this.tin, issuerCommand.tin) && Objects.equals(this.referenceId, issuerCommand.referenceId) && Objects.equals(this.telephone, issuerCommand.telephone) && @@ -439,7 +439,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(name, nameDba, tin, referenceId, telephone, taxYear, countryCode, email, address, city, state, zip, foreignProvince, transferAgentName, lastFiling); + return Objects.hash(name, dbaName, tin, referenceId, telephone, taxYear, countryCode, email, address, city, state, zip, foreignProvince, transferAgentName, lastFiling); } private static int hashCodeNullable(JsonNullable a) { @@ -454,7 +454,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class IssuerCommand {\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" nameDba: ").append(toIndentedString(nameDba)).append("\n"); + sb.append(" dbaName: ").append(toIndentedString(dbaName)).append("\n"); sb.append(" tin: ").append(toIndentedString(tin)).append("\n"); sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); sb.append(" telephone: ").append(toIndentedString(telephone)).append("\n"); @@ -491,7 +491,7 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("name"); - openapiFields.add("nameDba"); + openapiFields.add("dbaName"); openapiFields.add("tin"); openapiFields.add("referenceId"); openapiFields.add("telephone"); @@ -508,6 +508,15 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("telephone"); + openapiRequiredFields.add("taxYear"); + openapiRequiredFields.add("email"); + openapiRequiredFields.add("address"); + openapiRequiredFields.add("city"); + openapiRequiredFields.add("state"); + openapiRequiredFields.add("zip"); + openapiRequiredFields.add("lastFiling"); } /** @@ -530,12 +539,19 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IssuerCommand` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IssuerCommand.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("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("nameDba") != null && !jsonObj.get("nameDba").isJsonNull()) && !jsonObj.get("nameDba").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `nameDba` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nameDba").toString())); + if ((jsonObj.get("dbaName") != null && !jsonObj.get("dbaName").isJsonNull()) && !jsonObj.get("dbaName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `dbaName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dbaName").toString())); } if ((jsonObj.get("tin") != null && !jsonObj.get("tin").isJsonNull()) && !jsonObj.get("tin").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `tin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tin").toString())); diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/IssuerResponse.java b/src/main/java/Avalara/SDK/model/A1099/V2/IssuerResponse.java index fc4ef2f..c3b4988 100644 --- a/src/main/java/Avalara/SDK/model/A1099/V2/IssuerResponse.java +++ b/src/main/java/Avalara/SDK/model/A1099/V2/IssuerResponse.java @@ -63,13 +63,21 @@ public class IssuerResponse { @SerializedName(SERIALIZED_NAME_ID) private String id; + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private OffsetDateTime updatedAt; + public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) private String name; - public static final String SERIALIZED_NAME_NAME_DBA = "nameDba"; - @SerializedName(SERIALIZED_NAME_NAME_DBA) - private String nameDba; + public static final String SERIALIZED_NAME_DBA_NAME = "dbaName"; + @SerializedName(SERIALIZED_NAME_DBA_NAME) + private String dbaName; public static final String SERIALIZED_NAME_TIN = "tin"; @SerializedName(SERIALIZED_NAME_TIN) @@ -123,30 +131,16 @@ public class IssuerResponse { @SerializedName(SERIALIZED_NAME_LAST_FILING) private Boolean lastFiling; - public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; - @SerializedName(SERIALIZED_NAME_CREATED_AT) - private OffsetDateTime createdAt; - - public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt"; - @SerializedName(SERIALIZED_NAME_UPDATED_AT) - private OffsetDateTime updatedAt; - public IssuerResponse() { } - public IssuerResponse( - String id, - OffsetDateTime createdAt, - OffsetDateTime updatedAt - ) { - this(); + public IssuerResponse id(String id) { this.id = id; - this.createdAt = createdAt; - this.updatedAt = updatedAt; + return this; } /** - * Unique identifier set when the record is created + * Unique identifier set when the record is created. * @return id */ @javax.annotation.Nullable @@ -154,6 +148,47 @@ public String getId() { return id; } + public void setId(String id) { + this.id = id; + } + + + public IssuerResponse createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Date time when the record was created. + * @return createdAt + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public IssuerResponse updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Date time when the record was last updated. + * @return updatedAt + */ + @javax.annotation.Nullable + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } public IssuerResponse name(String name) { @@ -162,7 +197,7 @@ public IssuerResponse name(String name) { } /** - * Legal name, not DBA + * Legal name. Not the DBA name. * @return name */ @javax.annotation.Nullable @@ -175,22 +210,22 @@ public void setName(String name) { } - public IssuerResponse nameDba(String nameDba) { - this.nameDba = nameDba; + public IssuerResponse dbaName(String dbaName) { + this.dbaName = dbaName; return this; } /** - * Optional DBA name or continuation of a long legal name - * @return nameDba + * Doing Business As (DBA) name or continuation of a long legal name. Use either this or 'transferAgentName'. + * @return dbaName */ @javax.annotation.Nullable - public String getNameDba() { - return nameDba; + public String getDbaName() { + return dbaName; } - public void setNameDba(String nameDba) { - this.nameDba = nameDba; + public void setDbaName(String dbaName) { + this.dbaName = dbaName; } @@ -200,7 +235,7 @@ public IssuerResponse tin(String tin) { } /** - * Tax identification number + * Federal Tax Identification Number (TIN). * @return tin */ @javax.annotation.Nullable @@ -219,7 +254,7 @@ public IssuerResponse referenceId(String referenceId) { } /** - * Optional identifier for your reference, never shown to any agency or recipient. We will also prefix download filenames with this value, if present. Can only include letters, numbers, dashes, underscores and spaces. + * Internal reference ID. Never shown to any agency or recipient. If present, it will prefix download filenames. Allowed characters: letters, numbers, dashes, underscores, and spaces. * @return referenceId */ @javax.annotation.Nullable @@ -238,7 +273,7 @@ public IssuerResponse telephone(String telephone) { } /** - * Telephone number + * Contact phone number (must contain at least 10 digits, max 15 characters). For recipient inquiries. * @return telephone */ @javax.annotation.Nullable @@ -257,7 +292,7 @@ public IssuerResponse taxYear(Integer taxYear) { } /** - * Tax year + * Tax year for which the forms are being filed (e.g., 2024). Must be within current tax year and current tax year - 4. * @return taxYear */ @javax.annotation.Nullable @@ -276,7 +311,7 @@ public IssuerResponse countryCode(String countryCode) { } /** - * If there is a transfer agent, use the address of the transfer agent. + * Two-letter IRS country code (e.g., 'US', 'CA'), as defined at https://www.irs.gov/e-file-providers/country-codes. If there is a transfer agent, use the transfer agent's shipping address. * @return countryCode */ @javax.annotation.Nullable @@ -295,7 +330,7 @@ public IssuerResponse email(String email) { } /** - * Email address + * Contact email address. For recipient inquiries. * @return email */ @javax.annotation.Nullable @@ -314,7 +349,7 @@ public IssuerResponse address(String address) { } /** - * Address + * Address. * @return address */ @javax.annotation.Nullable @@ -333,7 +368,7 @@ public IssuerResponse city(String city) { } /** - * City + * City. * @return city */ @javax.annotation.Nullable @@ -352,7 +387,7 @@ public IssuerResponse state(String state) { } /** - * State + * Two-letter US state or Canadian province code (required for US/CA addresses). * @return state */ @javax.annotation.Nullable @@ -371,7 +406,7 @@ public IssuerResponse zip(String zip) { } /** - * Zip code + * ZIP/postal code. * @return zip */ @javax.annotation.Nullable @@ -390,7 +425,7 @@ public IssuerResponse foreignProvince(String foreignProvince) { } /** - * Foreign province + * Province or region for non-US/CA addresses. * @return foreignProvince */ @javax.annotation.Nullable @@ -409,7 +444,7 @@ public IssuerResponse transferAgentName(String transferAgentName) { } /** - * Transfer Agent's Name + * Name of the transfer agent, if applicable — optional; use either this or 'dbaName'. * @return transferAgentName */ @javax.annotation.Nullable @@ -428,7 +463,7 @@ public IssuerResponse lastFiling(Boolean lastFiling) { } /** - * Last year of filing for this payer + * Indicates if this is the issuer's final year filing. * @return lastFiling */ @javax.annotation.Nullable @@ -441,28 +476,6 @@ public void setLastFiling(Boolean lastFiling) { } - /** - * Date time when the issuer was created - * @return createdAt - */ - @javax.annotation.Nullable - public OffsetDateTime getCreatedAt() { - return createdAt; - } - - - - /** - * Date time when the issuer was updated - * @return updatedAt - */ - @javax.annotation.Nullable - public OffsetDateTime getUpdatedAt() { - return updatedAt; - } - - - @Override public boolean equals(Object o) { @@ -474,8 +487,10 @@ public boolean equals(Object o) { } IssuerResponse issuerResponse = (IssuerResponse) o; return Objects.equals(this.id, issuerResponse.id) && + Objects.equals(this.createdAt, issuerResponse.createdAt) && + Objects.equals(this.updatedAt, issuerResponse.updatedAt) && Objects.equals(this.name, issuerResponse.name) && - Objects.equals(this.nameDba, issuerResponse.nameDba) && + Objects.equals(this.dbaName, issuerResponse.dbaName) && Objects.equals(this.tin, issuerResponse.tin) && Objects.equals(this.referenceId, issuerResponse.referenceId) && Objects.equals(this.telephone, issuerResponse.telephone) && @@ -488,9 +503,7 @@ public boolean equals(Object o) { Objects.equals(this.zip, issuerResponse.zip) && Objects.equals(this.foreignProvince, issuerResponse.foreignProvince) && Objects.equals(this.transferAgentName, issuerResponse.transferAgentName) && - Objects.equals(this.lastFiling, issuerResponse.lastFiling) && - Objects.equals(this.createdAt, issuerResponse.createdAt) && - Objects.equals(this.updatedAt, issuerResponse.updatedAt); + Objects.equals(this.lastFiling, issuerResponse.lastFiling); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -499,7 +512,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(id, name, nameDba, tin, referenceId, telephone, taxYear, countryCode, email, address, city, state, zip, foreignProvince, transferAgentName, lastFiling, createdAt, updatedAt); + return Objects.hash(id, createdAt, updatedAt, name, dbaName, tin, referenceId, telephone, taxYear, countryCode, email, address, city, state, zip, foreignProvince, transferAgentName, lastFiling); } private static int hashCodeNullable(JsonNullable a) { @@ -514,8 +527,10 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class IssuerResponse {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" nameDba: ").append(toIndentedString(nameDba)).append("\n"); + sb.append(" dbaName: ").append(toIndentedString(dbaName)).append("\n"); sb.append(" tin: ").append(toIndentedString(tin)).append("\n"); sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); sb.append(" telephone: ").append(toIndentedString(telephone)).append("\n"); @@ -529,8 +544,6 @@ public String toString() { sb.append(" foreignProvince: ").append(toIndentedString(foreignProvince)).append("\n"); sb.append(" transferAgentName: ").append(toIndentedString(transferAgentName)).append("\n"); sb.append(" lastFiling: ").append(toIndentedString(lastFiling)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append("}"); return sb.toString(); } @@ -553,9 +566,33 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("dbaName"); + openapiFields.add("tin"); + openapiFields.add("referenceId"); + openapiFields.add("telephone"); + openapiFields.add("taxYear"); + openapiFields.add("countryCode"); + openapiFields.add("email"); + openapiFields.add("address"); + openapiFields.add("city"); + openapiFields.add("state"); + openapiFields.add("zip"); + openapiFields.add("foreignProvince"); + openapiFields.add("transferAgentName"); + openapiFields.add("lastFiling"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("telephone"); + openapiRequiredFields.add("taxYear"); + openapiRequiredFields.add("email"); + openapiRequiredFields.add("address"); + openapiRequiredFields.add("city"); + openapiRequiredFields.add("state"); + openapiRequiredFields.add("zip"); + openapiRequiredFields.add("lastFiling"); } /** @@ -578,6 +615,13 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IssuerResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IssuerResponse.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("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())); @@ -585,8 +629,8 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti 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("nameDba") != null && !jsonObj.get("nameDba").isJsonNull()) && !jsonObj.get("nameDba").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `nameDba` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nameDba").toString())); + if ((jsonObj.get("dbaName") != null && !jsonObj.get("dbaName").isJsonNull()) && !jsonObj.get("dbaName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `dbaName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dbaName").toString())); } if ((jsonObj.get("tin") != null && !jsonObj.get("tin").isJsonNull()) && !jsonObj.get("tin").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `tin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tin").toString())); diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/JobResponse.java b/src/main/java/Avalara/SDK/model/A1099/V2/JobResponse.java new file mode 100644 index 0000000..81c0699 --- /dev/null +++ b/src/main/java/Avalara/SDK/model/A1099/V2/JobResponse.java @@ -0,0 +1,813 @@ +/* + * AvaTax Software Development Kit for Java (JRE) + * + * (c) 2004-2025 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * Avalara 1099 & W-9 API Definition + * + * ## 🔐 Authentication Generate a **license key** from: *[Avalara Portal](https://www.avalara.com/us/en/signin.html) → Settings → License and API Keys*. [More on authentication methods](https://developer.avalara.com/avatax-dm-combined-erp/common-setup/authentication/authentication-methods/) [Test your credentials](https://developer.avalara.com/avatax/test-credentials/) ## 📘 API & SDK Documentation [Avalara SDK (.NET) on GitHub](https://github.com/avadev/Avalara-SDK-DotNet#avalarasdk--the-unified-c-library-for-next-gen-avalara-services) [Code Examples – 1099 API](https://github.com/avadev/Avalara-SDK-DotNet/blob/main/docs/A1099/V2/Class1099IssuersApi.md#call1099issuersget) + * + * @author Sachin Baijal + * @author Jonathan Wenger + * @copyright 2004-2025 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @link https://github.com/avadev/Avalara-SDK-Java + */ + +package Avalara.SDK.model.A1099.V2; + +import java.util.Objects; +import Avalara.SDK.model.A1099.V2.Get1099Form200Response; +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 org.openapitools.jackson.nullable.JsonNullable; + +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 model for job operations + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") +public class JobResponse { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + /** + * Current status of the job (e.g., Success, Failed, InProgress) + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + IN_PROGRESS("InProgress"), + + SUCCESS("Success"), + + 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_MESSAGE = "errorMessage"; + @SerializedName(SERIALIZED_NAME_ERROR_MESSAGE) + private String errorMessage; + + public static final String SERIALIZED_NAME_TOTAL_PROCESSED = "totalProcessed"; + @SerializedName(SERIALIZED_NAME_TOTAL_PROCESSED) + private Integer totalProcessed; + + public static final String SERIALIZED_NAME_TOTAL_ROWS = "totalRows"; + @SerializedName(SERIALIZED_NAME_TOTAL_ROWS) + private Integer totalRows; + + public static final String SERIALIZED_NAME_UPDATED_VALID = "updatedValid"; + @SerializedName(SERIALIZED_NAME_UPDATED_VALID) + private Integer updatedValid; + + public static final String SERIALIZED_NAME_UPDATED_NO_EMAIL = "updatedNoEmail"; + @SerializedName(SERIALIZED_NAME_UPDATED_NO_EMAIL) + private Integer updatedNoEmail; + + public static final String SERIALIZED_NAME_UPDATED_INVALID = "updatedInvalid"; + @SerializedName(SERIALIZED_NAME_UPDATED_INVALID) + private Integer updatedInvalid; + + public static final String SERIALIZED_NAME_SKIPPED_DUPLICATE = "skippedDuplicate"; + @SerializedName(SERIALIZED_NAME_SKIPPED_DUPLICATE) + private Integer skippedDuplicate; + + public static final String SERIALIZED_NAME_SKIPPED_INVALID = "skippedInvalid"; + @SerializedName(SERIALIZED_NAME_SKIPPED_INVALID) + private Integer skippedInvalid; + + public static final String SERIALIZED_NAME_SKIPPED_MULTIPLE_MATCHES = "skippedMultipleMatches"; + @SerializedName(SERIALIZED_NAME_SKIPPED_MULTIPLE_MATCHES) + private Integer skippedMultipleMatches; + + public static final String SERIALIZED_NAME_NOT_FOUND = "notFound"; + @SerializedName(SERIALIZED_NAME_NOT_FOUND) + private Integer notFound; + + public static final String SERIALIZED_NAME_CREATED_INVALID = "createdInvalid"; + @SerializedName(SERIALIZED_NAME_CREATED_INVALID) + private Integer createdInvalid; + + public static final String SERIALIZED_NAME_CREATED_NO_EMAIL = "createdNoEmail"; + @SerializedName(SERIALIZED_NAME_CREATED_NO_EMAIL) + private Integer createdNoEmail; + + public static final String SERIALIZED_NAME_CREATED_VALID = "createdValid"; + @SerializedName(SERIALIZED_NAME_CREATED_VALID) + private Integer createdValid; + + public static final String SERIALIZED_NAME_DRY_RUN = "dryRun"; + @SerializedName(SERIALIZED_NAME_DRY_RUN) + private Boolean dryRun; + + public static final String SERIALIZED_NAME_UPSERT = "upsert"; + @SerializedName(SERIALIZED_NAME_UPSERT) + private Boolean upsert; + + public static final String SERIALIZED_NAME_LINK = "link"; + @SerializedName(SERIALIZED_NAME_LINK) + private String link; + + public static final String SERIALIZED_NAME_PROCESSED_FORMS = "processedForms"; + @SerializedName(SERIALIZED_NAME_PROCESSED_FORMS) + private List processedForms; + + public JobResponse() { + } + + public JobResponse id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier for the job + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + + public JobResponse type(String type) { + this.type = type; + return this; + } + + /** + * Job type identifier. Will always be \"update_job\" for bulk upsert operations + * @return type + */ + @javax.annotation.Nullable + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + + public JobResponse status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Current status of the job (e.g., Success, Failed, InProgress) + * @return status + */ + @javax.annotation.Nullable + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + public JobResponse errorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Error message if the job failed, null otherwise + * @return errorMessage + */ + @javax.annotation.Nullable + public String getErrorMessage() { + return errorMessage; + } + + public void setErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + } + + + public JobResponse totalProcessed(Integer totalProcessed) { + this.totalProcessed = totalProcessed; + return this; + } + + /** + * Total number of forms processed. Value can be 0 or another value based on what the job has available + * @return totalProcessed + */ + @javax.annotation.Nullable + public Integer getTotalProcessed() { + return totalProcessed; + } + + public void setTotalProcessed(Integer totalProcessed) { + this.totalProcessed = totalProcessed; + } + + + public JobResponse totalRows(Integer totalRows) { + this.totalRows = totalRows; + return this; + } + + /** + * Total number of forms in the request. Value can be 0 or another value based on what the job has available + * @return totalRows + */ + @javax.annotation.Nullable + public Integer getTotalRows() { + return totalRows; + } + + public void setTotalRows(Integer totalRows) { + this.totalRows = totalRows; + } + + + public JobResponse updatedValid(Integer updatedValid) { + this.updatedValid = updatedValid; + return this; + } + + /** + * Number of forms updated and valid for e-filing and e-delivery. Value can be 0 or another value based on what the job has available + * @return updatedValid + */ + @javax.annotation.Nullable + public Integer getUpdatedValid() { + return updatedValid; + } + + public void setUpdatedValid(Integer updatedValid) { + this.updatedValid = updatedValid; + } + + + public JobResponse updatedNoEmail(Integer updatedNoEmail) { + this.updatedNoEmail = updatedNoEmail; + return this; + } + + /** + * Number of forms updated and valid for e-filing but missing email or email is undeliverable. Value can be 0 or another value based on what the job has available + * @return updatedNoEmail + */ + @javax.annotation.Nullable + public Integer getUpdatedNoEmail() { + return updatedNoEmail; + } + + public void setUpdatedNoEmail(Integer updatedNoEmail) { + this.updatedNoEmail = updatedNoEmail; + } + + + public JobResponse updatedInvalid(Integer updatedInvalid) { + this.updatedInvalid = updatedInvalid; + return this; + } + + /** + * Number of forms updated but invalid for e-filing. Value can be 0 or another value based on what the job has available + * @return updatedInvalid + */ + @javax.annotation.Nullable + public Integer getUpdatedInvalid() { + return updatedInvalid; + } + + public void setUpdatedInvalid(Integer updatedInvalid) { + this.updatedInvalid = updatedInvalid; + } + + + public JobResponse skippedDuplicate(Integer skippedDuplicate) { + this.skippedDuplicate = skippedDuplicate; + return this; + } + + /** + * Number of forms skipped because they would have updated a record already updated once in the request. Value can be 0 or another value based on what the job has available + * @return skippedDuplicate + */ + @javax.annotation.Nullable + public Integer getSkippedDuplicate() { + return skippedDuplicate; + } + + public void setSkippedDuplicate(Integer skippedDuplicate) { + this.skippedDuplicate = skippedDuplicate; + } + + + public JobResponse skippedInvalid(Integer skippedInvalid) { + this.skippedInvalid = skippedInvalid; + return this; + } + + /** + * Number of forms skipped because they would have made a form invalid and the form is already e-filed or scheduled for e-filing. Value can be 0 or another value based on what the job has available + * @return skippedInvalid + */ + @javax.annotation.Nullable + public Integer getSkippedInvalid() { + return skippedInvalid; + } + + public void setSkippedInvalid(Integer skippedInvalid) { + this.skippedInvalid = skippedInvalid; + } + + + public JobResponse skippedMultipleMatches(Integer skippedMultipleMatches) { + this.skippedMultipleMatches = skippedMultipleMatches; + return this; + } + + /** + * Number of forms skipped because they matched multiple forms. Value can be 0 or another value based on what the job has available + * @return skippedMultipleMatches + */ + @javax.annotation.Nullable + public Integer getSkippedMultipleMatches() { + return skippedMultipleMatches; + } + + public void setSkippedMultipleMatches(Integer skippedMultipleMatches) { + this.skippedMultipleMatches = skippedMultipleMatches; + } + + + public JobResponse notFound(Integer notFound) { + this.notFound = notFound; + return this; + } + + /** + * Number of forms skipped because no matching form or issuer could be found. Value can be 0 or another value based on what the job has available + * @return notFound + */ + @javax.annotation.Nullable + public Integer getNotFound() { + return notFound; + } + + public void setNotFound(Integer notFound) { + this.notFound = notFound; + } + + + public JobResponse createdInvalid(Integer createdInvalid) { + this.createdInvalid = createdInvalid; + return this; + } + + /** + * Number of new forms created because no matching form could be found (and `upsert` was true) - with errors. Value can be 0 or another value based on what the job has available + * @return createdInvalid + */ + @javax.annotation.Nullable + public Integer getCreatedInvalid() { + return createdInvalid; + } + + public void setCreatedInvalid(Integer createdInvalid) { + this.createdInvalid = createdInvalid; + } + + + public JobResponse createdNoEmail(Integer createdNoEmail) { + this.createdNoEmail = createdNoEmail; + return this; + } + + /** + * Number of new forms created because no matching form could be found (and `upsert` was true) - valid for e-filing but missing email or email is undeliverable. Value can be 0 or another value based on what the job has available + * @return createdNoEmail + */ + @javax.annotation.Nullable + public Integer getCreatedNoEmail() { + return createdNoEmail; + } + + public void setCreatedNoEmail(Integer createdNoEmail) { + this.createdNoEmail = createdNoEmail; + } + + + public JobResponse createdValid(Integer createdValid) { + this.createdValid = createdValid; + return this; + } + + /** + * Number of new forms created because no matching form could be found (and `upsert` was true) - valid for e-filing and e-delivery. Value can be 0 or another value based on what the job has available + * @return createdValid + */ + @javax.annotation.Nullable + public Integer getCreatedValid() { + return createdValid; + } + + public void setCreatedValid(Integer createdValid) { + this.createdValid = createdValid; + } + + + public JobResponse dryRun(Boolean dryRun) { + this.dryRun = dryRun; + return this; + } + + /** + * Dry run. If `true`, this job only simulates the changes but doesn't actually persist them. + * @return dryRun + */ + @javax.annotation.Nullable + public Boolean getDryRun() { + return dryRun; + } + + public void setDryRun(Boolean dryRun) { + this.dryRun = dryRun; + } + + + public JobResponse upsert(Boolean upsert) { + this.upsert = upsert; + return this; + } + + /** + * Upsert. If `true`, this job will first attempt to update existing records if matches can be found. Matches are done in the following order: Form ID, Form Reference ID and tax year, Form TIN and tax year. + * @return upsert + */ + @javax.annotation.Nullable + public Boolean getUpsert() { + return upsert; + } + + public void setUpsert(Boolean upsert) { + this.upsert = upsert; + } + + + public JobResponse link(String link) { + this.link = link; + return this; + } + + /** + * Link to access the job details + * @return link + */ + @javax.annotation.Nullable + public String getLink() { + return link; + } + + public void setLink(String link) { + this.link = link; + } + + + public JobResponse processedForms(List processedForms) { + this.processedForms = processedForms; + return this; + } + + public JobResponse addProcessedFormsItem(Get1099Form200Response processedFormsItem) { + if (this.processedForms == null) { + this.processedForms = new ArrayList<>(); + } + this.processedForms.add(processedFormsItem); + return this; + } + + /** + * List of processed forms returned when bulk-upsert processes ≤1000 records. Same format as GET /1099/forms response. Only available in bulk-upsert endpoint responses. + * @return processedForms + */ + @javax.annotation.Nullable + public List getProcessedForms() { + return processedForms; + } + + public void setProcessedForms(List processedForms) { + this.processedForms = processedForms; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JobResponse jobResponse = (JobResponse) o; + return Objects.equals(this.id, jobResponse.id) && + Objects.equals(this.type, jobResponse.type) && + Objects.equals(this.status, jobResponse.status) && + Objects.equals(this.errorMessage, jobResponse.errorMessage) && + Objects.equals(this.totalProcessed, jobResponse.totalProcessed) && + Objects.equals(this.totalRows, jobResponse.totalRows) && + Objects.equals(this.updatedValid, jobResponse.updatedValid) && + Objects.equals(this.updatedNoEmail, jobResponse.updatedNoEmail) && + Objects.equals(this.updatedInvalid, jobResponse.updatedInvalid) && + Objects.equals(this.skippedDuplicate, jobResponse.skippedDuplicate) && + Objects.equals(this.skippedInvalid, jobResponse.skippedInvalid) && + Objects.equals(this.skippedMultipleMatches, jobResponse.skippedMultipleMatches) && + Objects.equals(this.notFound, jobResponse.notFound) && + Objects.equals(this.createdInvalid, jobResponse.createdInvalid) && + Objects.equals(this.createdNoEmail, jobResponse.createdNoEmail) && + Objects.equals(this.createdValid, jobResponse.createdValid) && + Objects.equals(this.dryRun, jobResponse.dryRun) && + Objects.equals(this.upsert, jobResponse.upsert) && + Objects.equals(this.link, jobResponse.link) && + Objects.equals(this.processedForms, jobResponse.processedForms); + } + + 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(id, type, status, errorMessage, totalProcessed, totalRows, updatedValid, updatedNoEmail, updatedInvalid, skippedDuplicate, skippedInvalid, skippedMultipleMatches, notFound, createdInvalid, createdNoEmail, createdValid, dryRun, upsert, link, processedForms); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JobResponse {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" errorMessage: ").append(toIndentedString(errorMessage)).append("\n"); + sb.append(" totalProcessed: ").append(toIndentedString(totalProcessed)).append("\n"); + sb.append(" totalRows: ").append(toIndentedString(totalRows)).append("\n"); + sb.append(" updatedValid: ").append(toIndentedString(updatedValid)).append("\n"); + sb.append(" updatedNoEmail: ").append(toIndentedString(updatedNoEmail)).append("\n"); + sb.append(" updatedInvalid: ").append(toIndentedString(updatedInvalid)).append("\n"); + sb.append(" skippedDuplicate: ").append(toIndentedString(skippedDuplicate)).append("\n"); + sb.append(" skippedInvalid: ").append(toIndentedString(skippedInvalid)).append("\n"); + sb.append(" skippedMultipleMatches: ").append(toIndentedString(skippedMultipleMatches)).append("\n"); + sb.append(" notFound: ").append(toIndentedString(notFound)).append("\n"); + sb.append(" createdInvalid: ").append(toIndentedString(createdInvalid)).append("\n"); + sb.append(" createdNoEmail: ").append(toIndentedString(createdNoEmail)).append("\n"); + sb.append(" createdValid: ").append(toIndentedString(createdValid)).append("\n"); + sb.append(" dryRun: ").append(toIndentedString(dryRun)).append("\n"); + sb.append(" upsert: ").append(toIndentedString(upsert)).append("\n"); + sb.append(" link: ").append(toIndentedString(link)).append("\n"); + sb.append(" processedForms: ").append(toIndentedString(processedForms)).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("type"); + openapiFields.add("status"); + openapiFields.add("errorMessage"); + openapiFields.add("totalProcessed"); + openapiFields.add("totalRows"); + openapiFields.add("updatedValid"); + openapiFields.add("updatedNoEmail"); + openapiFields.add("updatedInvalid"); + openapiFields.add("skippedDuplicate"); + openapiFields.add("skippedInvalid"); + openapiFields.add("skippedMultipleMatches"); + openapiFields.add("notFound"); + openapiFields.add("createdInvalid"); + openapiFields.add("createdNoEmail"); + openapiFields.add("createdValid"); + openapiFields.add("dryRun"); + openapiFields.add("upsert"); + openapiFields.add("link"); + openapiFields.add("processedForms"); + + // 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 JobResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!JobResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in JobResponse is not found in the empty JSON string", JobResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!JobResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `JobResponse` 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("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").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")); + } + if ((jsonObj.get("errorMessage") != null && !jsonObj.get("errorMessage").isJsonNull()) && !jsonObj.get("errorMessage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `errorMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("errorMessage").toString())); + } + if ((jsonObj.get("link") != null && !jsonObj.get("link").isJsonNull()) && !jsonObj.get("link").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `link` to be a primitive type in the JSON string but got `%s`", jsonObj.get("link").toString())); + } + if (jsonObj.get("processedForms") != null && !jsonObj.get("processedForms").isJsonNull()) { + JsonArray jsonArrayprocessedForms = jsonObj.getAsJsonArray("processedForms"); + if (jsonArrayprocessedForms != null) { + // ensure the json data is an array + if (!jsonObj.get("processedForms").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `processedForms` to be an array in the JSON string but got `%s`", jsonObj.get("processedForms").toString())); + } + + // validate the optional field `processedForms` (array) + for (int i = 0; i < jsonArrayprocessedForms.size(); i++) { + Get1099Form200Response.validateJsonElement(jsonArrayprocessedForms.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JobResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JobResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JobResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JobResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JobResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JobResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of JobResponse + * @throws IOException if the JSON string is invalid with respect to JobResponse + */ + public static JobResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JobResponse.class); + } + + /** + * Convert an instance of JobResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/OfferAndCoverage.java b/src/main/java/Avalara/SDK/model/A1099/V2/OfferAndCoverage.java new file mode 100644 index 0000000..63527d9 --- /dev/null +++ b/src/main/java/Avalara/SDK/model/A1099/V2/OfferAndCoverage.java @@ -0,0 +1,600 @@ +/* + * AvaTax Software Development Kit for Java (JRE) + * + * (c) 2004-2025 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * Avalara 1099 & W-9 API Definition + * + * ## 🔐 Authentication Generate a **license key** from: *[Avalara Portal](https://www.avalara.com/us/en/signin.html) → Settings → License and API Keys*. [More on authentication methods](https://developer.avalara.com/avatax-dm-combined-erp/common-setup/authentication/authentication-methods/) [Test your credentials](https://developer.avalara.com/avatax/test-credentials/) ## 📘 API & SDK Documentation [Avalara SDK (.NET) on GitHub](https://github.com/avadev/Avalara-SDK-DotNet#avalarasdk--the-unified-c-library-for-next-gen-avalara-services) [Code Examples – 1099 API](https://github.com/avadev/Avalara-SDK-DotNet/blob/main/docs/A1099/V2/Class1099IssuersApi.md#call1099issuersget) + * + * @author Sachin Baijal + * @author Jonathan Wenger + * @copyright 2004-2025 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @link https://github.com/avadev/Avalara-SDK-Java + */ + +package Avalara.SDK.model.A1099.V2; + +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 org.openapitools.jackson.nullable.JsonNullable; + +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; + +/** + * Offer and coverage information for health coverage forms + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") +public class OfferAndCoverage { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private Integer id; + + /** + * Month of coverage. Available values: - All: All months - January: January - February: February - March: March - April: April - May: May - June: June - July: July - August: August - September: September - October: October - November: November - December: December + */ + @JsonAdapter(MonthEnum.Adapter.class) + public enum MonthEnum { + ALL("All"), + + _01("01"), + + _02("02"), + + _03("03"), + + _04("04"), + + _05("05"), + + _06("06"), + + _07("07"), + + _08("08"), + + _09("09"), + + _10("10"), + + _11("11"), + + _12("12"); + + private String value; + + MonthEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static MonthEnum fromValue(String value) { + for (MonthEnum b : MonthEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final MonthEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public MonthEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return MonthEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + MonthEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_MONTH = "month"; + @SerializedName(SERIALIZED_NAME_MONTH) + private MonthEnum month; + + /** + * Offer of Coverage Code. Required if Share has a value, including zero. Available values: Pre-ICHRA Codes (available before 2020): - 1A: Qualifying offer: minimum essential coverage providing minimum value offered to full-time employee with employee required contribution ≤ 9.5% (as adjusted) of mainland single federal poverty line and at least minimum essential coverage offered to spouse and dependent(s) - 1B: Minimum essential coverage providing minimum value offered to employee only - 1C: Minimum essential coverage providing minimum value offered to employee and at least minimum essential coverage offered to dependent(s) (not spouse) - 1D: Minimum essential coverage providing minimum value offered to employee and at least minimum essential coverage offered to spouse (not dependent(s)) - 1E: Minimum essential coverage providing minimum value offered to employee and at least minimum essential coverage offered to dependent(s) and spouse - 1F: Minimum essential coverage NOT providing minimum value offered to employee; employee and spouse or dependent(s); or employee, spouse, and dependents - 1G: Offer of coverage to an individual who was not an employee or not a full-time employee and who enrolled in self-insured coverage - 1H: No offer of coverage (employee not offered any health coverage or employee offered coverage that is not minimum essential coverage) - 1J: Minimum essential coverage providing minimum value offered to employee and at least minimum essential coverage conditionally offered to spouse; minimum essential coverage not offered to dependent(s) - 1K: Minimum essential coverage providing minimum value offered to employee; at least minimum essential coverage offered to dependents; and at least minimum essential coverage conditionally offered to spouse ICHRA Codes (introduced 2020, require ZIP code): - 1L: Individual coverage HRA offered to employee only - 1M: Individual coverage HRA offered to employee and dependent(s) (not spouse) - 1N: Individual coverage HRA offered to employee, spouse, and dependent(s) - 1O: Individual coverage HRA offered to employee only using employment site ZIP code affordability safe harbor - 1P: Individual coverage HRA offered to employee and dependent(s) (not spouse) using employment site ZIP code affordability safe harbor - 1Q: Individual coverage HRA offered to employee, spouse, and dependent(s) using employment site ZIP code affordability safe harbor - 1R: Individual coverage HRA that is NOT affordable - 1S: Individual coverage HRA offered to an individual who was not a full-time employee - 1T: Individual coverage HRA offered to employee and spouse (not dependents) - 1U: Individual coverage HRA offered to employee and spouse (not dependents) using employment site ZIP code affordability safe harbor Note: Codes 1B, 1C, 1D, 1E, 1J, 1K, 1L, 1M, 1N, 1O, 1P, 1Q, 1T, 1U require employee share amount (0.00 is a valid value). + */ + @JsonAdapter(OfferCodeEnum.Adapter.class) + public enum OfferCodeEnum { + _1_A("1A"), + + _1_B("1B"), + + _1_C("1C"), + + _1_D("1D"), + + _1_E("1E"), + + _1_F("1F"), + + _1_G("1G"), + + _1_H("1H"), + + _1_J("1J"), + + _1_K("1K"), + + _1_L("1L"), + + _1_M("1M"), + + _1_N("1N"), + + _1_O("1O"), + + _1_P("1P"), + + _1_Q("1Q"), + + _1_R("1R"), + + _1_S("1S"), + + _1_T("1T"), + + _1_U("1U"); + + private String value; + + OfferCodeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static OfferCodeEnum fromValue(String value) { + for (OfferCodeEnum b : OfferCodeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final OfferCodeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public OfferCodeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return OfferCodeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + OfferCodeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_OFFER_CODE = "offerCode"; + @SerializedName(SERIALIZED_NAME_OFFER_CODE) + private OfferCodeEnum offerCode; + + public static final String SERIALIZED_NAME_SHARE = "share"; + @SerializedName(SERIALIZED_NAME_SHARE) + private Double share; + + /** + * Safe harbor code - Applicable Section 4980H Safe Harbor Code. Available values: - 2A: Form W-2 safe harbor - 2B: Federal poverty line safe harbor - 2C: Rate of pay safe harbor - 2D: Part-time employee safe harbor for employees who were not full-time for any month of the year - 2E: Multiemployer interim rule relief - 2F: Qualifying offer method - 2G: Qualifying offer transition relief - 2H: Other affordability safe harbor + */ + @JsonAdapter(SafeHarborCodeEnum.Adapter.class) + public enum SafeHarborCodeEnum { + _2_A("2A"), + + _2_B("2B"), + + _2_C("2C"), + + _2_D("2D"), + + _2_E("2E"), + + _2_F("2F"), + + _2_G("2G"), + + _2_H("2H"); + + private String value; + + SafeHarborCodeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static SafeHarborCodeEnum fromValue(String value) { + for (SafeHarborCodeEnum b : SafeHarborCodeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final SafeHarborCodeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public SafeHarborCodeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return SafeHarborCodeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + SafeHarborCodeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_SAFE_HARBOR_CODE = "safeHarborCode"; + @SerializedName(SERIALIZED_NAME_SAFE_HARBOR_CODE) + private SafeHarborCodeEnum safeHarborCode; + + public static final String SERIALIZED_NAME_ZIP_CODE = "zipCode"; + @SerializedName(SERIALIZED_NAME_ZIP_CODE) + private String zipCode; + + public OfferAndCoverage() { + } + + public OfferAndCoverage( + Integer id + ) { + this(); + this.id = id; + } + + /** + * Id + * @return id + */ + @javax.annotation.Nullable + public Integer getId() { + return id; + } + + + + public OfferAndCoverage month(MonthEnum month) { + this.month = month; + return this; + } + + /** + * Month of coverage. Available values: - All: All months - January: January - February: February - March: March - April: April - May: May - June: June - July: July - August: August - September: September - October: October - November: November - December: December + * @return month + */ + @javax.annotation.Nullable + public MonthEnum getMonth() { + return month; + } + + public void setMonth(MonthEnum month) { + this.month = month; + } + + + public OfferAndCoverage offerCode(OfferCodeEnum offerCode) { + this.offerCode = offerCode; + return this; + } + + /** + * Offer of Coverage Code. Required if Share has a value, including zero. Available values: Pre-ICHRA Codes (available before 2020): - 1A: Qualifying offer: minimum essential coverage providing minimum value offered to full-time employee with employee required contribution ≤ 9.5% (as adjusted) of mainland single federal poverty line and at least minimum essential coverage offered to spouse and dependent(s) - 1B: Minimum essential coverage providing minimum value offered to employee only - 1C: Minimum essential coverage providing minimum value offered to employee and at least minimum essential coverage offered to dependent(s) (not spouse) - 1D: Minimum essential coverage providing minimum value offered to employee and at least minimum essential coverage offered to spouse (not dependent(s)) - 1E: Minimum essential coverage providing minimum value offered to employee and at least minimum essential coverage offered to dependent(s) and spouse - 1F: Minimum essential coverage NOT providing minimum value offered to employee; employee and spouse or dependent(s); or employee, spouse, and dependents - 1G: Offer of coverage to an individual who was not an employee or not a full-time employee and who enrolled in self-insured coverage - 1H: No offer of coverage (employee not offered any health coverage or employee offered coverage that is not minimum essential coverage) - 1J: Minimum essential coverage providing minimum value offered to employee and at least minimum essential coverage conditionally offered to spouse; minimum essential coverage not offered to dependent(s) - 1K: Minimum essential coverage providing minimum value offered to employee; at least minimum essential coverage offered to dependents; and at least minimum essential coverage conditionally offered to spouse ICHRA Codes (introduced 2020, require ZIP code): - 1L: Individual coverage HRA offered to employee only - 1M: Individual coverage HRA offered to employee and dependent(s) (not spouse) - 1N: Individual coverage HRA offered to employee, spouse, and dependent(s) - 1O: Individual coverage HRA offered to employee only using employment site ZIP code affordability safe harbor - 1P: Individual coverage HRA offered to employee and dependent(s) (not spouse) using employment site ZIP code affordability safe harbor - 1Q: Individual coverage HRA offered to employee, spouse, and dependent(s) using employment site ZIP code affordability safe harbor - 1R: Individual coverage HRA that is NOT affordable - 1S: Individual coverage HRA offered to an individual who was not a full-time employee - 1T: Individual coverage HRA offered to employee and spouse (not dependents) - 1U: Individual coverage HRA offered to employee and spouse (not dependents) using employment site ZIP code affordability safe harbor Note: Codes 1B, 1C, 1D, 1E, 1J, 1K, 1L, 1M, 1N, 1O, 1P, 1Q, 1T, 1U require employee share amount (0.00 is a valid value). + * @return offerCode + */ + @javax.annotation.Nullable + public OfferCodeEnum getOfferCode() { + return offerCode; + } + + public void setOfferCode(OfferCodeEnum offerCode) { + this.offerCode = offerCode; + } + + + public OfferAndCoverage share(Double share) { + this.share = share; + return this; + } + + /** + * Employee required contribution share - Employee Share of Lowest Cost Monthly Premium, for Self-Only Minimum Value Coverage - May not exceed 3499.99 + * @return share + */ + @javax.annotation.Nullable + public Double getShare() { + return share; + } + + public void setShare(Double share) { + this.share = share; + } + + + public OfferAndCoverage safeHarborCode(SafeHarborCodeEnum safeHarborCode) { + this.safeHarborCode = safeHarborCode; + return this; + } + + /** + * Safe harbor code - Applicable Section 4980H Safe Harbor Code. Available values: - 2A: Form W-2 safe harbor - 2B: Federal poverty line safe harbor - 2C: Rate of pay safe harbor - 2D: Part-time employee safe harbor for employees who were not full-time for any month of the year - 2E: Multiemployer interim rule relief - 2F: Qualifying offer method - 2G: Qualifying offer transition relief - 2H: Other affordability safe harbor + * @return safeHarborCode + */ + @javax.annotation.Nullable + public SafeHarborCodeEnum getSafeHarborCode() { + return safeHarborCode; + } + + public void setSafeHarborCode(SafeHarborCodeEnum safeHarborCode) { + this.safeHarborCode = safeHarborCode; + } + + + public OfferAndCoverage zipCode(String zipCode) { + this.zipCode = zipCode; + return this; + } + + /** + * ZIP/postal code. For coverage area (optional, unless codes 1L to 1U are used). + * @return zipCode + */ + @javax.annotation.Nullable + public String getZipCode() { + return zipCode; + } + + public void setZipCode(String zipCode) { + this.zipCode = zipCode; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OfferAndCoverage offerAndCoverage = (OfferAndCoverage) o; + return Objects.equals(this.id, offerAndCoverage.id) && + Objects.equals(this.month, offerAndCoverage.month) && + Objects.equals(this.offerCode, offerAndCoverage.offerCode) && + Objects.equals(this.share, offerAndCoverage.share) && + Objects.equals(this.safeHarborCode, offerAndCoverage.safeHarborCode) && + Objects.equals(this.zipCode, offerAndCoverage.zipCode); + } + + 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(id, month, offerCode, share, safeHarborCode, zipCode); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OfferAndCoverage {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" month: ").append(toIndentedString(month)).append("\n"); + sb.append(" offerCode: ").append(toIndentedString(offerCode)).append("\n"); + sb.append(" share: ").append(toIndentedString(share)).append("\n"); + sb.append(" safeHarborCode: ").append(toIndentedString(safeHarborCode)).append("\n"); + sb.append(" zipCode: ").append(toIndentedString(zipCode)).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("month"); + openapiFields.add("offerCode"); + openapiFields.add("share"); + openapiFields.add("safeHarborCode"); + openapiFields.add("zipCode"); + + // 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 OfferAndCoverage + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OfferAndCoverage.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OfferAndCoverage is not found in the empty JSON string", OfferAndCoverage.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!OfferAndCoverage.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OfferAndCoverage` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("month") != null && !jsonObj.get("month").isJsonNull()) && !jsonObj.get("month").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `month` to be a primitive type in the JSON string but got `%s`", jsonObj.get("month").toString())); + } + // validate the optional field `month` + if (jsonObj.get("month") != null && !jsonObj.get("month").isJsonNull()) { + MonthEnum.validateJsonElement(jsonObj.get("month")); + } + if ((jsonObj.get("offerCode") != null && !jsonObj.get("offerCode").isJsonNull()) && !jsonObj.get("offerCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `offerCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("offerCode").toString())); + } + // validate the optional field `offerCode` + if (jsonObj.get("offerCode") != null && !jsonObj.get("offerCode").isJsonNull()) { + OfferCodeEnum.validateJsonElement(jsonObj.get("offerCode")); + } + if ((jsonObj.get("safeHarborCode") != null && !jsonObj.get("safeHarborCode").isJsonNull()) && !jsonObj.get("safeHarborCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `safeHarborCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("safeHarborCode").toString())); + } + // validate the optional field `safeHarborCode` + if (jsonObj.get("safeHarborCode") != null && !jsonObj.get("safeHarborCode").isJsonNull()) { + SafeHarborCodeEnum.validateJsonElement(jsonObj.get("safeHarborCode")); + } + if ((jsonObj.get("zipCode") != null && !jsonObj.get("zipCode").isJsonNull()) && !jsonObj.get("zipCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `zipCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("zipCode").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OfferAndCoverage.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OfferAndCoverage' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OfferAndCoverage.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OfferAndCoverage value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OfferAndCoverage read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OfferAndCoverage given an JSON string + * + * @param jsonString JSON string + * @return An instance of OfferAndCoverage + * @throws IOException if the JSON string is invalid with respect to OfferAndCoverage + */ + public static OfferAndCoverage fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OfferAndCoverage.class); + } + + /** + * Convert an instance of OfferAndCoverage 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/A1099/V2/PaginatedQueryResultModelForm1099Base.java similarity index 57% rename from src/main/java/Avalara/SDK/model/EInvoicing/V1/DirectorySearchResponse.java rename to src/main/java/Avalara/SDK/model/A1099/V2/PaginatedQueryResultModelForm1099Base.java index 8f3f55f..14a6f54 100644 --- a/src/main/java/Avalara/SDK/model/EInvoicing/V1/DirectorySearchResponse.java +++ b/src/main/java/Avalara/SDK/model/A1099/V2/PaginatedQueryResultModelForm1099Base.java @@ -1,26 +1,26 @@ -/* - * AvaTax Software Development Kit for Java (JRE) - * - * (c) 2004-2025 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-2025 Avalara, Inc. - * @license https://www.apache.org/licenses/LICENSE-2.0 - * @link https://github.com/avadev/Avalara-SDK-Java +/* + * AvaTax Software Development Kit for Java (JRE) + * + * (c) 2004-2025 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * Avalara 1099 & W-9 API Definition + * + * ## 🔐 Authentication Generate a **license key** from: *[Avalara Portal](https://www.avalara.com/us/en/signin.html) → Settings → License and API Keys*. [More on authentication methods](https://developer.avalara.com/avatax-dm-combined-erp/common-setup/authentication/authentication-methods/) [Test your credentials](https://developer.avalara.com/avatax/test-credentials/) ## 📘 API & SDK Documentation [Avalara SDK (.NET) on GitHub](https://github.com/avadev/Avalara-SDK-DotNet#avalarasdk--the-unified-c-library-for-next-gen-avalara-services) [Code Examples – 1099 API](https://github.com/avadev/Avalara-SDK-DotNet/blob/main/docs/A1099/V2/Class1099IssuersApi.md#call1099issuersget) + * + * @author Sachin Baijal + * @author Jonathan Wenger + * @copyright 2004-2025 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @link https://github.com/avadev/Avalara-SDK-Java */ -package Avalara.SDK.model.EInvoicing.V1; +package Avalara.SDK.model.A1099.V2; import java.util.Objects; -import Avalara.SDK.model.EInvoicing.V1.DirectorySearchResponseValueInner; +import Avalara.SDK.model.A1099.V2.Get1099Form200Response; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -30,6 +30,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -56,69 +57,50 @@ import Avalara.SDK.JSON; /** - * Response schema for directory search results + * Generic paginated model to wrap query response data */ @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 class PaginatedQueryResultModelForm1099Base { + public static final String SERIALIZED_NAME_AT_RECORDSET_COUNT = "@recordsetCount"; + @SerializedName(SERIALIZED_NAME_AT_RECORDSET_COUNT) + private Integer atRecordsetCount; 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; - } + private List value; - /** - * The count of records in the result set - * @return atRecordSetCount - */ - @javax.annotation.Nullable - public Integer getAtRecordSetCount() { - return atRecordSetCount; - } + public static final String SERIALIZED_NAME_AT_NEXT_LINK = "@nextLink"; + @SerializedName(SERIALIZED_NAME_AT_NEXT_LINK) + private String atNextLink; - public void setAtRecordSetCount(Integer atRecordSetCount) { - this.atRecordSetCount = atRecordSetCount; + public PaginatedQueryResultModelForm1099Base() { } - - public DirectorySearchResponse atNextLink(String atNextLink) { - this.atNextLink = atNextLink; + public PaginatedQueryResultModelForm1099Base atRecordsetCount(Integer atRecordsetCount) { + this.atRecordsetCount = atRecordsetCount; return this; } /** - * The next page link to get the next set of results. - * @return atNextLink + * Get atRecordsetCount + * @return atRecordsetCount */ @javax.annotation.Nullable - public String getAtNextLink() { - return atNextLink; + public Integer getAtRecordsetCount() { + return atRecordsetCount; } - public void setAtNextLink(String atNextLink) { - this.atNextLink = atNextLink; + public void setAtRecordsetCount(Integer atRecordsetCount) { + this.atRecordsetCount = atRecordsetCount; } - public DirectorySearchResponse value(List value) { + public PaginatedQueryResultModelForm1099Base value(List value) { this.value = value; return this; } - public DirectorySearchResponse addValueItem(DirectorySearchResponseValueInner valueItem) { + public PaginatedQueryResultModelForm1099Base addValueItem(Get1099Form200Response valueItem) { if (this.value == null) { this.value = new ArrayList<>(); } @@ -131,15 +113,34 @@ public DirectorySearchResponse addValueItem(DirectorySearchResponseValueInner va * @return value */ @javax.annotation.Nullable - public List getValue() { + public List getValue() { return value; } - public void setValue(List value) { + public void setValue(List value) { this.value = value; } + public PaginatedQueryResultModelForm1099Base atNextLink(String atNextLink) { + this.atNextLink = atNextLink; + return this; + } + + /** + * Get atNextLink + * @return atNextLink + */ + @javax.annotation.Nullable + public String getAtNextLink() { + return atNextLink; + } + + public void setAtNextLink(String atNextLink) { + this.atNextLink = atNextLink; + } + + @Override public boolean equals(Object o) { @@ -149,24 +150,35 @@ public boolean equals(Object o) { 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); + PaginatedQueryResultModelForm1099Base paginatedQueryResultModelForm1099Base = (PaginatedQueryResultModelForm1099Base) o; + return Objects.equals(this.atRecordsetCount, paginatedQueryResultModelForm1099Base.atRecordsetCount) && + Objects.equals(this.value, paginatedQueryResultModelForm1099Base.value) && + Objects.equals(this.atNextLink, paginatedQueryResultModelForm1099Base.atNextLink); + } + + 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(atRecordSetCount, atNextLink, value); + return Objects.hash(atRecordsetCount, value, atNextLink); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @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("class PaginatedQueryResultModelForm1099Base {\n"); + sb.append(" atRecordsetCount: ").append(toIndentedString(atRecordsetCount)).append("\n"); sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" atNextLink: ").append(toIndentedString(atNextLink)).append("\n"); sb.append("}"); return sb.toString(); } @@ -189,9 +201,9 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("@recordSetCount"); - openapiFields.add("@nextLink"); + openapiFields.add("@recordsetCount"); openapiFields.add("value"); + openapiFields.add("@nextLink"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -201,26 +213,23 @@ private String toIndentedString(Object o) { * 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 + * @throws IOException if the JSON Element is invalid with respect to PaginatedQueryResultModelForm1099Base */ 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())); + if (!PaginatedQueryResultModelForm1099Base.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PaginatedQueryResultModelForm1099Base is not found in the empty JSON string", PaginatedQueryResultModelForm1099Base.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())); + if (!PaginatedQueryResultModelForm1099Base.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PaginatedQueryResultModelForm1099Base` 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) { @@ -231,32 +240,35 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti // validate the optional field `value` (array) for (int i = 0; i < jsonArrayvalue.size(); i++) { - DirectorySearchResponseValueInner.validateJsonElement(jsonArrayvalue.get(i)); + Get1099Form200Response.validateJsonElement(jsonArrayvalue.get(i)); }; } } + 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())); + } } 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 + if (!PaginatedQueryResultModelForm1099Base.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PaginatedQueryResultModelForm1099Base' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DirectorySearchResponse.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PaginatedQueryResultModelForm1099Base.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, DirectorySearchResponse value) throws IOException { + public void write(JsonWriter out, PaginatedQueryResultModelForm1099Base value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public DirectorySearchResponse read(JsonReader in) throws IOException { + public PaginatedQueryResultModelForm1099Base read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -267,18 +279,18 @@ public DirectorySearchResponse read(JsonReader in) throws IOException { } /** - * Create an instance of DirectorySearchResponse given an JSON string + * Create an instance of PaginatedQueryResultModelForm1099Base 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 + * @return An instance of PaginatedQueryResultModelForm1099Base + * @throws IOException if the JSON string is invalid with respect to PaginatedQueryResultModelForm1099Base */ - public static DirectorySearchResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DirectorySearchResponse.class); + public static PaginatedQueryResultModelForm1099Base fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PaginatedQueryResultModelForm1099Base.class); } /** - * Convert an instance of DirectorySearchResponse to an JSON string + * Convert an instance of PaginatedQueryResultModelForm1099Base to an JSON string * * @return JSON string */ diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/PrimaryWithholdingAgent.java b/src/main/java/Avalara/SDK/model/A1099/V2/PrimaryWithholdingAgent.java index a05f4bf..1657005 100644 --- a/src/main/java/Avalara/SDK/model/A1099/V2/PrimaryWithholdingAgent.java +++ b/src/main/java/Avalara/SDK/model/A1099/V2/PrimaryWithholdingAgent.java @@ -27,7 +27,6 @@ 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; @@ -54,56 +53,56 @@ import Avalara.SDK.JSON; /** - * PrimaryWithholdingAgent + * Primary withholding agent information for tax forms */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class PrimaryWithholdingAgent { - public static final String SERIALIZED_NAME_PRIMARY_WITHHOLDING_AGENT_NAME = "primaryWithholdingAgentName"; - @SerializedName(SERIALIZED_NAME_PRIMARY_WITHHOLDING_AGENT_NAME) - private String primaryWithholdingAgentName; + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; - public static final String SERIALIZED_NAME_PRIMARY_WITHHOLDING_AGENT_EIN = "primaryWithholdingAgentEin"; - @SerializedName(SERIALIZED_NAME_PRIMARY_WITHHOLDING_AGENT_EIN) - private String primaryWithholdingAgentEin; + public static final String SERIALIZED_NAME_EIN = "ein"; + @SerializedName(SERIALIZED_NAME_EIN) + private String ein; public PrimaryWithholdingAgent() { } - public PrimaryWithholdingAgent primaryWithholdingAgentName(String primaryWithholdingAgentName) { - this.primaryWithholdingAgentName = primaryWithholdingAgentName; + public PrimaryWithholdingAgent name(String name) { + this.name = name; return this; } /** - * Get primaryWithholdingAgentName - * @return primaryWithholdingAgentName + * Name of the primary withholding agent + * @return name */ @javax.annotation.Nullable - public String getPrimaryWithholdingAgentName() { - return primaryWithholdingAgentName; + public String getName() { + return name; } - public void setPrimaryWithholdingAgentName(String primaryWithholdingAgentName) { - this.primaryWithholdingAgentName = primaryWithholdingAgentName; + public void setName(String name) { + this.name = name; } - public PrimaryWithholdingAgent primaryWithholdingAgentEin(String primaryWithholdingAgentEin) { - this.primaryWithholdingAgentEin = primaryWithholdingAgentEin; + public PrimaryWithholdingAgent ein(String ein) { + this.ein = ein; return this; } /** - * Get primaryWithholdingAgentEin - * @return primaryWithholdingAgentEin + * EIN (Employer Identification Number) of the primary withholding agent. + * @return ein */ @javax.annotation.Nullable - public String getPrimaryWithholdingAgentEin() { - return primaryWithholdingAgentEin; + public String getEin() { + return ein; } - public void setPrimaryWithholdingAgentEin(String primaryWithholdingAgentEin) { - this.primaryWithholdingAgentEin = primaryWithholdingAgentEin; + public void setEin(String ein) { + this.ein = ein; } @@ -117,32 +116,21 @@ public boolean equals(Object o) { return false; } PrimaryWithholdingAgent primaryWithholdingAgent = (PrimaryWithholdingAgent) o; - return Objects.equals(this.primaryWithholdingAgentName, primaryWithholdingAgent.primaryWithholdingAgentName) && - Objects.equals(this.primaryWithholdingAgentEin, primaryWithholdingAgent.primaryWithholdingAgentEin); - } - - 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())); + return Objects.equals(this.name, primaryWithholdingAgent.name) && + Objects.equals(this.ein, primaryWithholdingAgent.ein); } @Override public int hashCode() { - return Objects.hash(primaryWithholdingAgentName, primaryWithholdingAgentEin); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + return Objects.hash(name, ein); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PrimaryWithholdingAgent {\n"); - sb.append(" primaryWithholdingAgentName: ").append(toIndentedString(primaryWithholdingAgentName)).append("\n"); - sb.append(" primaryWithholdingAgentEin: ").append(toIndentedString(primaryWithholdingAgentEin)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" ein: ").append(toIndentedString(ein)).append("\n"); sb.append("}"); return sb.toString(); } @@ -165,11 +153,13 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("primaryWithholdingAgentName"); - openapiFields.add("primaryWithholdingAgentEin"); + openapiFields.add("name"); + openapiFields.add("ein"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("ein"); } /** @@ -192,12 +182,19 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PrimaryWithholdingAgent` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PrimaryWithholdingAgent.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("primaryWithholdingAgentName") != null && !jsonObj.get("primaryWithholdingAgentName").isJsonNull()) && !jsonObj.get("primaryWithholdingAgentName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `primaryWithholdingAgentName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("primaryWithholdingAgentName").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("primaryWithholdingAgentEin") != null && !jsonObj.get("primaryWithholdingAgentEin").isJsonNull()) && !jsonObj.get("primaryWithholdingAgentEin").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `primaryWithholdingAgentEin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("primaryWithholdingAgentEin").toString())); + if ((jsonObj.get("ein") != null && !jsonObj.get("ein").isJsonNull()) && !jsonObj.get("ein").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ein` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ein").toString())); } } diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/StateAndLocalWithholding.java b/src/main/java/Avalara/SDK/model/A1099/V2/StateAndLocalWithholding.java index cd468aa..539bcfc 100644 --- a/src/main/java/Avalara/SDK/model/A1099/V2/StateAndLocalWithholding.java +++ b/src/main/java/Avalara/SDK/model/A1099/V2/StateAndLocalWithholding.java @@ -99,7 +99,7 @@ public StateAndLocalWithholding stateTaxWithheld(Double stateTaxWithheld) { } /** - * Get stateTaxWithheld + * Amount of state tax that was withheld * @return stateTaxWithheld */ @javax.annotation.Nullable @@ -118,7 +118,7 @@ public StateAndLocalWithholding state(String state) { } /** - * Get state + * US state * @return state */ @javax.annotation.Nullable @@ -137,7 +137,7 @@ public StateAndLocalWithholding stateIdNumber(String stateIdNumber) { } /** - * Get stateIdNumber + * State ID number of the entity issuing the form * @return stateIdNumber */ @javax.annotation.Nullable @@ -156,7 +156,7 @@ public StateAndLocalWithholding stateIncome(Double stateIncome) { } /** - * Get stateIncome + * Amount of state income * @return stateIncome */ @javax.annotation.Nullable @@ -175,7 +175,7 @@ public StateAndLocalWithholding localTaxWithheld(Double localTaxWithheld) { } /** - * Get localTaxWithheld + * Amount of local tax that was withheld * @return localTaxWithheld */ @javax.annotation.Nullable @@ -194,7 +194,7 @@ public StateAndLocalWithholding locality(String locality) { } /** - * Get locality + * Locality name * @return locality */ @javax.annotation.Nullable @@ -213,7 +213,7 @@ public StateAndLocalWithholding localityIdNumber(String localityIdNumber) { } /** - * Get localityIdNumber + * Locality ID number of the entity issuing the form * @return localityIdNumber */ @javax.annotation.Nullable @@ -232,7 +232,7 @@ public StateAndLocalWithholding localIncome(Double localIncome) { } /** - * Get localIncome + * Amount of local income * @return localIncome */ @javax.annotation.Nullable diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/ValidationError.java b/src/main/java/Avalara/SDK/model/A1099/V2/ValidationError.java index 8686c0d..7ef87ea 100644 --- a/src/main/java/Avalara/SDK/model/A1099/V2/ValidationError.java +++ b/src/main/java/Avalara/SDK/model/A1099/V2/ValidationError.java @@ -77,7 +77,7 @@ public ValidationError field(String field) { } /** - * Get field + * The field containing the error * @return field */ @javax.annotation.Nullable @@ -104,7 +104,7 @@ public ValidationError addErrorsItem(String errorsItem) { } /** - * Get errors + * The list of error messages * @return errors */ @javax.annotation.Nullable diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/ValidationErrorApp.java b/src/main/java/Avalara/SDK/model/A1099/V2/ValidationErrorApp.java deleted file mode 100644 index fd31062..0000000 --- a/src/main/java/Avalara/SDK/model/A1099/V2/ValidationErrorApp.java +++ /dev/null @@ -1,264 +0,0 @@ -/* - * AvaTax Software Development Kit for Java (JRE) - * - * (c) 2004-2025 Avalara, Inc. - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - * - * Avalara 1099 & W-9 API Definition - * - * ## 🔐 Authentication Use **username/password** or generate a **license key** from: *Avalara Portal → Settings → License and API Keys*. [More on authentication methods](https://developer.avalara.com/avatax-dm-combined-erp/common-setup/authentication/authentication-methods/) [Test your credentials](https://developer.avalara.com/avatax/test-credentials/) ## 📘 API & SDK Documentation [Avalara SDK (.NET) on GitHub](https://github.com/avadev/Avalara-SDK-DotNet#avalarasdk--the-unified-c-library-for-next-gen-avalara-services) [Code Examples – 1099 API](https://github.com/avadev/Avalara-SDK-DotNet/blob/main/docs/A1099/V2/Class1099IssuersApi.md#call1099issuersget) - * - * @author Sachin Baijal - * @author Jonathan Wenger - * @copyright 2004-2025 Avalara, Inc. - * @license https://www.apache.org/licenses/LICENSE-2.0 - * @link https://github.com/avadev/Avalara-SDK-Java - */ - -package Avalara.SDK.model.A1099.V2; - -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.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; - -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; - -/** - * ValidationErrorApp - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") -public class ValidationErrorApp { - public static final String SERIALIZED_NAME_FIELD = "field"; - @SerializedName(SERIALIZED_NAME_FIELD) - private String field; - - public static final String SERIALIZED_NAME_ERRORS = "errors"; - @SerializedName(SERIALIZED_NAME_ERRORS) - private List errors; - - public ValidationErrorApp() { - } - - public ValidationErrorApp field(String field) { - this.field = field; - return this; - } - - /** - * Get field - * @return field - */ - @javax.annotation.Nullable - public String getField() { - return field; - } - - public void setField(String field) { - this.field = field; - } - - - public ValidationErrorApp errors(List errors) { - this.errors = errors; - return this; - } - - public ValidationErrorApp addErrorsItem(String errorsItem) { - if (this.errors == null) { - this.errors = new ArrayList<>(); - } - this.errors.add(errorsItem); - return this; - } - - /** - * Get errors - * @return errors - */ - @javax.annotation.Nullable - public List getErrors() { - return errors; - } - - public void setErrors(List errors) { - this.errors = errors; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ValidationErrorApp validationErrorApp = (ValidationErrorApp) o; - return Objects.equals(this.field, validationErrorApp.field) && - Objects.equals(this.errors, validationErrorApp.errors); - } - - 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(field, errors); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ValidationErrorApp {\n"); - sb.append(" field: ").append(toIndentedString(field)).append("\n"); - sb.append(" errors: ").append(toIndentedString(errors)).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("field"); - openapiFields.add("errors"); - - // 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 ValidationErrorApp - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!ValidationErrorApp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in ValidationErrorApp is not found in the empty JSON string", ValidationErrorApp.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!ValidationErrorApp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ValidationErrorApp` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("field") != null && !jsonObj.get("field").isJsonNull()) && !jsonObj.get("field").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `field` to be a primitive type in the JSON string but got `%s`", jsonObj.get("field").toString())); - } - // ensure the optional json data is an array if present - if (jsonObj.get("errors") != null && !jsonObj.get("errors").isJsonNull() && !jsonObj.get("errors").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `errors` to be an array in the JSON string but got `%s`", jsonObj.get("errors").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!ValidationErrorApp.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ValidationErrorApp' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ValidationErrorApp.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ValidationErrorApp value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ValidationErrorApp read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ValidationErrorApp given an JSON string - * - * @param jsonString JSON string - * @return An instance of ValidationErrorApp - * @throws IOException if the JSON string is invalid with respect to ValidationErrorApp - */ - public static ValidationErrorApp fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ValidationErrorApp.class); - } - - /** - * Convert an instance of ValidationErrorApp to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/W4FormMinimalRequest.java b/src/main/java/Avalara/SDK/model/A1099/V2/W4FormMinimalRequest.java new file mode 100644 index 0000000..fc586b1 --- /dev/null +++ b/src/main/java/Avalara/SDK/model/A1099/V2/W4FormMinimalRequest.java @@ -0,0 +1,467 @@ +/* + * AvaTax Software Development Kit for Java (JRE) + * + * (c) 2004-2025 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * Avalara 1099 & W-9 API Definition + * + * ## 🔐 Authentication Generate a **license key** from: *[Avalara Portal](https://www.avalara.com/us/en/signin.html) → Settings → License and API Keys*. [More on authentication methods](https://developer.avalara.com/avatax-dm-combined-erp/common-setup/authentication/authentication-methods/) [Test your credentials](https://developer.avalara.com/avatax/test-credentials/) ## 📘 API & SDK Documentation [Avalara SDK (.NET) on GitHub](https://github.com/avadev/Avalara-SDK-DotNet#avalarasdk--the-unified-c-library-for-next-gen-avalara-services) [Code Examples – 1099 API](https://github.com/avadev/Avalara-SDK-DotNet/blob/main/docs/A1099/V2/Class1099IssuersApi.md#call1099issuersget) + * + * @author Sachin Baijal + * @author Jonathan Wenger + * @copyright 2004-2025 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @link https://github.com/avadev/Avalara-SDK-Java + */ + +package Avalara.SDK.model.A1099.V2; + +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 org.openapitools.jackson.nullable.JsonNullable; + +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; + +/** + * W4FormMinimalRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") +public class W4FormMinimalRequest { + /** + * The form type (always \"w4\" for this model). + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + W4("W4"), + + W8_BEN("W8Ben"), + + W8_BEN_E("W8BenE"), + + W8_IMY("W8Imy"), + + W9("W9"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.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 TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_EMPLOYEE_FIRST_NAME = "employeeFirstName"; + @SerializedName(SERIALIZED_NAME_EMPLOYEE_FIRST_NAME) + private String employeeFirstName; + + public static final String SERIALIZED_NAME_EMPLOYEE_LAST_NAME = "employeeLastName"; + @SerializedName(SERIALIZED_NAME_EMPLOYEE_LAST_NAME) + private String employeeLastName; + + public static final String SERIALIZED_NAME_OFFICE_CODE = "officeCode"; + @SerializedName(SERIALIZED_NAME_OFFICE_CODE) + private String officeCode; + + public static final String SERIALIZED_NAME_COMPANY_ID = "companyId"; + @SerializedName(SERIALIZED_NAME_COMPANY_ID) + private String companyId; + + public static final String SERIALIZED_NAME_REFERENCE_ID = "referenceId"; + @SerializedName(SERIALIZED_NAME_REFERENCE_ID) + private String referenceId; + + public W4FormMinimalRequest() { + } + + public W4FormMinimalRequest( + TypeEnum type + ) { + this(); + this.type = type; + } + + /** + * The form type (always \"w4\" for this model). + * @return type + */ + @javax.annotation.Nullable + public TypeEnum getType() { + return type; + } + + + + public W4FormMinimalRequest email(String email) { + this.email = email; + return this; + } + + /** + * The email address of the individual associated with the form. + * @return email + */ + @javax.annotation.Nonnull + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + + public W4FormMinimalRequest employeeFirstName(String employeeFirstName) { + this.employeeFirstName = employeeFirstName; + return this; + } + + /** + * The first name of the employee. + * @return employeeFirstName + */ + @javax.annotation.Nonnull + public String getEmployeeFirstName() { + return employeeFirstName; + } + + public void setEmployeeFirstName(String employeeFirstName) { + this.employeeFirstName = employeeFirstName; + } + + + public W4FormMinimalRequest employeeLastName(String employeeLastName) { + this.employeeLastName = employeeLastName; + return this; + } + + /** + * The last name of the employee. + * @return employeeLastName + */ + @javax.annotation.Nonnull + public String getEmployeeLastName() { + return employeeLastName; + } + + public void setEmployeeLastName(String employeeLastName) { + this.employeeLastName = employeeLastName; + } + + + public W4FormMinimalRequest officeCode(String officeCode) { + this.officeCode = officeCode; + return this; + } + + /** + * The office code associated with the form. + * @return officeCode + */ + @javax.annotation.Nullable + public String getOfficeCode() { + return officeCode; + } + + public void setOfficeCode(String officeCode) { + this.officeCode = officeCode; + } + + + public W4FormMinimalRequest companyId(String companyId) { + this.companyId = companyId; + return this; + } + + /** + * The ID of the associated company. + * @return companyId + */ + @javax.annotation.Nonnull + public String getCompanyId() { + return companyId; + } + + public void setCompanyId(String companyId) { + this.companyId = companyId; + } + + + public W4FormMinimalRequest referenceId(String referenceId) { + this.referenceId = referenceId; + return this; + } + + /** + * A reference identifier for the form. + * @return referenceId + */ + @javax.annotation.Nullable + public String getReferenceId() { + return referenceId; + } + + public void setReferenceId(String referenceId) { + this.referenceId = referenceId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + W4FormMinimalRequest w4FormMinimalRequest = (W4FormMinimalRequest) o; + return Objects.equals(this.type, w4FormMinimalRequest.type) && + Objects.equals(this.email, w4FormMinimalRequest.email) && + Objects.equals(this.employeeFirstName, w4FormMinimalRequest.employeeFirstName) && + Objects.equals(this.employeeLastName, w4FormMinimalRequest.employeeLastName) && + Objects.equals(this.officeCode, w4FormMinimalRequest.officeCode) && + Objects.equals(this.companyId, w4FormMinimalRequest.companyId) && + Objects.equals(this.referenceId, w4FormMinimalRequest.referenceId); + } + + 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(type, email, employeeFirstName, employeeLastName, officeCode, companyId, referenceId); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class W4FormMinimalRequest {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" employeeFirstName: ").append(toIndentedString(employeeFirstName)).append("\n"); + sb.append(" employeeLastName: ").append(toIndentedString(employeeLastName)).append("\n"); + sb.append(" officeCode: ").append(toIndentedString(officeCode)).append("\n"); + sb.append(" companyId: ").append(toIndentedString(companyId)).append("\n"); + sb.append(" referenceId: ").append(toIndentedString(referenceId)).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("type"); + openapiFields.add("companyId"); + openapiFields.add("referenceId"); + openapiFields.add("email"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("email"); + openapiRequiredFields.add("employeeFirstName"); + openapiRequiredFields.add("employeeLastName"); + openapiRequiredFields.add("companyId"); + } + + /** + * 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 W4FormMinimalRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!W4FormMinimalRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in W4FormMinimalRequest is not found in the empty JSON string", W4FormMinimalRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!W4FormMinimalRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `W4FormMinimalRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : W4FormMinimalRequest.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("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the optional field `type` + if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) { + TypeEnum.validateJsonElement(jsonObj.get("type")); + } + if (!jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if (!jsonObj.get("employeeFirstName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `employeeFirstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("employeeFirstName").toString())); + } + if (!jsonObj.get("employeeLastName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `employeeLastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("employeeLastName").toString())); + } + if ((jsonObj.get("officeCode") != null && !jsonObj.get("officeCode").isJsonNull()) && !jsonObj.get("officeCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `officeCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("officeCode").toString())); + } + if (!jsonObj.get("companyId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `companyId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("companyId").toString())); + } + if ((jsonObj.get("referenceId") != null && !jsonObj.get("referenceId").isJsonNull()) && !jsonObj.get("referenceId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `referenceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("referenceId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!W4FormMinimalRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'W4FormMinimalRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(W4FormMinimalRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, W4FormMinimalRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public W4FormMinimalRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of W4FormMinimalRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of W4FormMinimalRequest + * @throws IOException if the JSON string is invalid with respect to W4FormMinimalRequest + */ + public static W4FormMinimalRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, W4FormMinimalRequest.class); + } + + /** + * Convert an instance of W4FormMinimalRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/W4FormRequest.java b/src/main/java/Avalara/SDK/model/A1099/V2/W4FormRequest.java index 837f504..579a8ac 100644 --- a/src/main/java/Avalara/SDK/model/A1099/V2/W4FormRequest.java +++ b/src/main/java/Avalara/SDK/model/A1099/V2/W4FormRequest.java @@ -197,6 +197,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @SerializedName(SERIALIZED_NAME_OFFICE_CODE) private String officeCode; + public static final String SERIALIZED_NAME_E_DELIVERY_CONSENTED_AT = "eDeliveryConsentedAt"; + @SerializedName(SERIALIZED_NAME_E_DELIVERY_CONSENTED_AT) + private OffsetDateTime eDeliveryConsentedAt; + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + public static final String SERIALIZED_NAME_COMPANY_ID = "companyId"; @SerializedName(SERIALIZED_NAME_COMPANY_ID) private String companyId; @@ -209,14 +217,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @SerializedName(SERIALIZED_NAME_EMAIL) private String email; - public static final String SERIALIZED_NAME_E_DELIVERY_CONSENTED_AT = "eDeliveryConsentedAt"; - @SerializedName(SERIALIZED_NAME_E_DELIVERY_CONSENTED_AT) - private OffsetDateTime eDeliveryConsentedAt; - - public static final String SERIALIZED_NAME_SIGNATURE = "signature"; - @SerializedName(SERIALIZED_NAME_SIGNATURE) - private String signature; - public W4FormRequest() { } @@ -599,6 +599,44 @@ public void setOfficeCode(String officeCode) { } + public W4FormRequest eDeliveryConsentedAt(OffsetDateTime eDeliveryConsentedAt) { + this.eDeliveryConsentedAt = eDeliveryConsentedAt; + return this; + } + + /** + * The date when e-delivery was consented. + * @return eDeliveryConsentedAt + */ + @javax.annotation.Nullable + public OffsetDateTime geteDeliveryConsentedAt() { + return eDeliveryConsentedAt; + } + + public void seteDeliveryConsentedAt(OffsetDateTime eDeliveryConsentedAt) { + this.eDeliveryConsentedAt = eDeliveryConsentedAt; + } + + + public W4FormRequest signature(String signature) { + this.signature = signature; + return this; + } + + /** + * The signature of the form. + * @return signature + */ + @javax.annotation.Nullable + public String getSignature() { + return signature; + } + + public void setSignature(String signature) { + this.signature = signature; + } + + public W4FormRequest companyId(String companyId) { this.companyId = companyId; return this; @@ -608,7 +646,7 @@ public W4FormRequest companyId(String companyId) { * The ID of the associated company. * @return companyId */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getCompanyId() { return companyId; } @@ -656,44 +694,6 @@ public void setEmail(String email) { } - public W4FormRequest eDeliveryConsentedAt(OffsetDateTime eDeliveryConsentedAt) { - this.eDeliveryConsentedAt = eDeliveryConsentedAt; - return this; - } - - /** - * The date when e-delivery was consented. - * @return eDeliveryConsentedAt - */ - @javax.annotation.Nullable - public OffsetDateTime geteDeliveryConsentedAt() { - return eDeliveryConsentedAt; - } - - public void seteDeliveryConsentedAt(OffsetDateTime eDeliveryConsentedAt) { - this.eDeliveryConsentedAt = eDeliveryConsentedAt; - } - - - public W4FormRequest signature(String signature) { - this.signature = signature; - return this; - } - - /** - * The signature of the form. - * @return signature - */ - @javax.annotation.Nullable - public String getSignature() { - return signature; - } - - public void setSignature(String signature) { - this.signature = signature; - } - - @Override public boolean equals(Object o) { @@ -724,11 +724,11 @@ public boolean equals(Object o) { Objects.equals(this.additionalWithheld, w4FormRequest.additionalWithheld) && Objects.equals(this.exemptFromWithholding, w4FormRequest.exemptFromWithholding) && Objects.equals(this.officeCode, w4FormRequest.officeCode) && + Objects.equals(this.eDeliveryConsentedAt, w4FormRequest.eDeliveryConsentedAt) && + Objects.equals(this.signature, w4FormRequest.signature) && Objects.equals(this.companyId, w4FormRequest.companyId) && Objects.equals(this.referenceId, w4FormRequest.referenceId) && - Objects.equals(this.email, w4FormRequest.email) && - Objects.equals(this.eDeliveryConsentedAt, w4FormRequest.eDeliveryConsentedAt) && - Objects.equals(this.signature, w4FormRequest.signature); + Objects.equals(this.email, w4FormRequest.email); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -737,7 +737,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(type, employeeFirstName, employeeMiddleName, employeeLastName, employeeNameSuffix, tinType, tin, address, city, state, zip, maritalStatus, lastNameDiffers, numAllowances, otherDependents, nonJobIncome, deductions, additionalWithheld, exemptFromWithholding, officeCode, companyId, referenceId, email, eDeliveryConsentedAt, signature); + return Objects.hash(type, employeeFirstName, employeeMiddleName, employeeLastName, employeeNameSuffix, tinType, tin, address, city, state, zip, maritalStatus, lastNameDiffers, numAllowances, otherDependents, nonJobIncome, deductions, additionalWithheld, exemptFromWithholding, officeCode, eDeliveryConsentedAt, signature, companyId, referenceId, email); } private static int hashCodeNullable(JsonNullable a) { @@ -771,11 +771,11 @@ public String toString() { sb.append(" additionalWithheld: ").append(toIndentedString(additionalWithheld)).append("\n"); sb.append(" exemptFromWithholding: ").append(toIndentedString(exemptFromWithholding)).append("\n"); sb.append(" officeCode: ").append(toIndentedString(officeCode)).append("\n"); + sb.append(" eDeliveryConsentedAt: ").append(toIndentedString(eDeliveryConsentedAt)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); sb.append(" companyId: ").append(toIndentedString(companyId)).append("\n"); sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" eDeliveryConsentedAt: ").append(toIndentedString(eDeliveryConsentedAt)).append("\n"); - sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); sb.append("}"); return sb.toString(); } @@ -798,15 +798,16 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); + openapiFields.add("eDeliveryConsentedAt"); + openapiFields.add("signature"); openapiFields.add("type"); openapiFields.add("companyId"); openapiFields.add("referenceId"); openapiFields.add("email"); - openapiFields.add("eDeliveryConsentedAt"); - openapiFields.add("signature"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("companyId"); } /** @@ -829,6 +830,13 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `W4FormRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : W4FormRequest.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("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); @@ -873,7 +881,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("officeCode") != null && !jsonObj.get("officeCode").isJsonNull()) && !jsonObj.get("officeCode").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `officeCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("officeCode").toString())); } - if ((jsonObj.get("companyId") != null && !jsonObj.get("companyId").isJsonNull()) && !jsonObj.get("companyId").isJsonPrimitive()) { + if ((jsonObj.get("signature") != null && !jsonObj.get("signature").isJsonNull()) && !jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + if (!jsonObj.get("companyId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `companyId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("companyId").toString())); } if ((jsonObj.get("referenceId") != null && !jsonObj.get("referenceId").isJsonNull()) && !jsonObj.get("referenceId").isJsonPrimitive()) { @@ -882,9 +893,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); } - if ((jsonObj.get("signature") != null && !jsonObj.get("signature").isJsonNull()) && !jsonObj.get("signature").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/W4FormResponse.java b/src/main/java/Avalara/SDK/model/A1099/V2/W4FormResponse.java index 17809db..767acf0 100644 --- a/src/main/java/Avalara/SDK/model/A1099/V2/W4FormResponse.java +++ b/src/main/java/Avalara/SDK/model/A1099/V2/W4FormResponse.java @@ -20,6 +20,7 @@ package Avalara.SDK.model.A1099.V2; import java.util.Objects; +import Avalara.SDK.model.A1099.V2.EntryStatusResponse; import Avalara.SDK.model.A1099.V2.W9FormBaseResponse; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; @@ -597,12 +598,12 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("id"); openapiFields.add("entryStatus"); - openapiFields.add("entryStatusDate"); openapiFields.add("referenceId"); openapiFields.add("companyId"); openapiFields.add("displayName"); openapiFields.add("email"); openapiFields.add("archived"); + openapiFields.add("ancestorId"); openapiFields.add("signature"); openapiFields.add("signedDate"); openapiFields.add("eDeliveryConsentedAt"); diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/W8BenEFormMinimalRequest.java b/src/main/java/Avalara/SDK/model/A1099/V2/W8BenEFormMinimalRequest.java new file mode 100644 index 0000000..05ed60a --- /dev/null +++ b/src/main/java/Avalara/SDK/model/A1099/V2/W8BenEFormMinimalRequest.java @@ -0,0 +1,438 @@ +/* + * AvaTax Software Development Kit for Java (JRE) + * + * (c) 2004-2025 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * Avalara 1099 & W-9 API Definition + * + * ## 🔐 Authentication Generate a **license key** from: *[Avalara Portal](https://www.avalara.com/us/en/signin.html) → Settings → License and API Keys*. [More on authentication methods](https://developer.avalara.com/avatax-dm-combined-erp/common-setup/authentication/authentication-methods/) [Test your credentials](https://developer.avalara.com/avatax/test-credentials/) ## 📘 API & SDK Documentation [Avalara SDK (.NET) on GitHub](https://github.com/avadev/Avalara-SDK-DotNet#avalarasdk--the-unified-c-library-for-next-gen-avalara-services) [Code Examples – 1099 API](https://github.com/avadev/Avalara-SDK-DotNet/blob/main/docs/A1099/V2/Class1099IssuersApi.md#call1099issuersget) + * + * @author Sachin Baijal + * @author Jonathan Wenger + * @copyright 2004-2025 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @link https://github.com/avadev/Avalara-SDK-Java + */ + +package Avalara.SDK.model.A1099.V2; + +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 org.openapitools.jackson.nullable.JsonNullable; + +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; + +/** + * W8BenEFormMinimalRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") +public class W8BenEFormMinimalRequest { + /** + * The form type (always \"w8bene\" for this model). + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + W4("W4"), + + W8_BEN("W8Ben"), + + W8_BEN_E("W8BenE"), + + W8_IMY("W8Imy"), + + W9("W9"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.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 TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_REFERENCE_NUMBER = "referenceNumber"; + @SerializedName(SERIALIZED_NAME_REFERENCE_NUMBER) + private String referenceNumber; + + public static final String SERIALIZED_NAME_COMPANY_ID = "companyId"; + @SerializedName(SERIALIZED_NAME_COMPANY_ID) + private String companyId; + + public static final String SERIALIZED_NAME_REFERENCE_ID = "referenceId"; + @SerializedName(SERIALIZED_NAME_REFERENCE_ID) + private String referenceId; + + public W8BenEFormMinimalRequest() { + } + + public W8BenEFormMinimalRequest( + TypeEnum type + ) { + this(); + this.type = type; + } + + /** + * The form type (always \"w8bene\" for this model). + * @return type + */ + @javax.annotation.Nullable + public TypeEnum getType() { + return type; + } + + + + public W8BenEFormMinimalRequest email(String email) { + this.email = email; + return this; + } + + /** + * The email address of the individual associated with the form. + * @return email + */ + @javax.annotation.Nonnull + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + + public W8BenEFormMinimalRequest name(String name) { + this.name = name; + return this; + } + + /** + * The name of the individual or entity associated with the form. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public W8BenEFormMinimalRequest referenceNumber(String referenceNumber) { + this.referenceNumber = referenceNumber; + return this; + } + + /** + * A reference number for the form. + * @return referenceNumber + */ + @javax.annotation.Nullable + public String getReferenceNumber() { + return referenceNumber; + } + + public void setReferenceNumber(String referenceNumber) { + this.referenceNumber = referenceNumber; + } + + + public W8BenEFormMinimalRequest companyId(String companyId) { + this.companyId = companyId; + return this; + } + + /** + * The ID of the associated company. + * @return companyId + */ + @javax.annotation.Nonnull + public String getCompanyId() { + return companyId; + } + + public void setCompanyId(String companyId) { + this.companyId = companyId; + } + + + public W8BenEFormMinimalRequest referenceId(String referenceId) { + this.referenceId = referenceId; + return this; + } + + /** + * A reference identifier for the form. + * @return referenceId + */ + @javax.annotation.Nullable + public String getReferenceId() { + return referenceId; + } + + public void setReferenceId(String referenceId) { + this.referenceId = referenceId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + W8BenEFormMinimalRequest w8BenEFormMinimalRequest = (W8BenEFormMinimalRequest) o; + return Objects.equals(this.type, w8BenEFormMinimalRequest.type) && + Objects.equals(this.email, w8BenEFormMinimalRequest.email) && + Objects.equals(this.name, w8BenEFormMinimalRequest.name) && + Objects.equals(this.referenceNumber, w8BenEFormMinimalRequest.referenceNumber) && + Objects.equals(this.companyId, w8BenEFormMinimalRequest.companyId) && + Objects.equals(this.referenceId, w8BenEFormMinimalRequest.referenceId); + } + + 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(type, email, name, referenceNumber, companyId, referenceId); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class W8BenEFormMinimalRequest {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" referenceNumber: ").append(toIndentedString(referenceNumber)).append("\n"); + sb.append(" companyId: ").append(toIndentedString(companyId)).append("\n"); + sb.append(" referenceId: ").append(toIndentedString(referenceId)).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("type"); + openapiFields.add("companyId"); + openapiFields.add("referenceId"); + openapiFields.add("email"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("email"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("companyId"); + } + + /** + * 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 W8BenEFormMinimalRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!W8BenEFormMinimalRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in W8BenEFormMinimalRequest is not found in the empty JSON string", W8BenEFormMinimalRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!W8BenEFormMinimalRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `W8BenEFormMinimalRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : W8BenEFormMinimalRequest.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("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the optional field `type` + if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) { + TypeEnum.validateJsonElement(jsonObj.get("type")); + } + if (!jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if (!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("referenceNumber") != null && !jsonObj.get("referenceNumber").isJsonNull()) && !jsonObj.get("referenceNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `referenceNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("referenceNumber").toString())); + } + if (!jsonObj.get("companyId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `companyId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("companyId").toString())); + } + if ((jsonObj.get("referenceId") != null && !jsonObj.get("referenceId").isJsonNull()) && !jsonObj.get("referenceId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `referenceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("referenceId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!W8BenEFormMinimalRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'W8BenEFormMinimalRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(W8BenEFormMinimalRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, W8BenEFormMinimalRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public W8BenEFormMinimalRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of W8BenEFormMinimalRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of W8BenEFormMinimalRequest + * @throws IOException if the JSON string is invalid with respect to W8BenEFormMinimalRequest + */ + public static W8BenEFormMinimalRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, W8BenEFormMinimalRequest.class); + } + + /** + * Convert an instance of W8BenEFormMinimalRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/W8BenEFormRequest.java b/src/main/java/Avalara/SDK/model/A1099/V2/W8BenEFormRequest.java index e715f42..fd7982f 100644 --- a/src/main/java/Avalara/SDK/model/A1099/V2/W8BenEFormRequest.java +++ b/src/main/java/Avalara/SDK/model/A1099/V2/W8BenEFormRequest.java @@ -505,6 +505,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @SerializedName(SERIALIZED_NAME_CAPACITY_TO_SIGN_CERTIFICATION) private Boolean capacityToSignCertification; + public static final String SERIALIZED_NAME_E_DELIVERY_CONSENTED_AT = "eDeliveryConsentedAt"; + @SerializedName(SERIALIZED_NAME_E_DELIVERY_CONSENTED_AT) + private OffsetDateTime eDeliveryConsentedAt; + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + public static final String SERIALIZED_NAME_COMPANY_ID = "companyId"; @SerializedName(SERIALIZED_NAME_COMPANY_ID) private String companyId; @@ -517,14 +525,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @SerializedName(SERIALIZED_NAME_EMAIL) private String email; - public static final String SERIALIZED_NAME_E_DELIVERY_CONSENTED_AT = "eDeliveryConsentedAt"; - @SerializedName(SERIALIZED_NAME_E_DELIVERY_CONSENTED_AT) - private OffsetDateTime eDeliveryConsentedAt; - - public static final String SERIALIZED_NAME_SIGNATURE = "signature"; - @SerializedName(SERIALIZED_NAME_SIGNATURE) - private String signature; - public W8BenEFormRequest() { } @@ -2359,6 +2359,44 @@ public void setCapacityToSignCertification(Boolean capacityToSignCertification) } + public W8BenEFormRequest eDeliveryConsentedAt(OffsetDateTime eDeliveryConsentedAt) { + this.eDeliveryConsentedAt = eDeliveryConsentedAt; + return this; + } + + /** + * The date when e-delivery was consented. + * @return eDeliveryConsentedAt + */ + @javax.annotation.Nullable + public OffsetDateTime geteDeliveryConsentedAt() { + return eDeliveryConsentedAt; + } + + public void seteDeliveryConsentedAt(OffsetDateTime eDeliveryConsentedAt) { + this.eDeliveryConsentedAt = eDeliveryConsentedAt; + } + + + public W8BenEFormRequest signature(String signature) { + this.signature = signature; + return this; + } + + /** + * The signature of the form. + * @return signature + */ + @javax.annotation.Nullable + public String getSignature() { + return signature; + } + + public void setSignature(String signature) { + this.signature = signature; + } + + public W8BenEFormRequest companyId(String companyId) { this.companyId = companyId; return this; @@ -2368,7 +2406,7 @@ public W8BenEFormRequest companyId(String companyId) { * The ID of the associated company. * @return companyId */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getCompanyId() { return companyId; } @@ -2416,44 +2454,6 @@ public void setEmail(String email) { } - public W8BenEFormRequest eDeliveryConsentedAt(OffsetDateTime eDeliveryConsentedAt) { - this.eDeliveryConsentedAt = eDeliveryConsentedAt; - return this; - } - - /** - * The date when e-delivery was consented. - * @return eDeliveryConsentedAt - */ - @javax.annotation.Nullable - public OffsetDateTime geteDeliveryConsentedAt() { - return eDeliveryConsentedAt; - } - - public void seteDeliveryConsentedAt(OffsetDateTime eDeliveryConsentedAt) { - this.eDeliveryConsentedAt = eDeliveryConsentedAt; - } - - - public W8BenEFormRequest signature(String signature) { - this.signature = signature; - return this; - } - - /** - * The signature of the form. - * @return signature - */ - @javax.annotation.Nullable - public String getSignature() { - return signature; - } - - public void setSignature(String signature) { - this.signature = signature; - } - - @Override public boolean equals(Object o) { @@ -2560,11 +2560,11 @@ public boolean equals(Object o) { Objects.equals(this.substantialUsOwners, w8BenEFormRequest.substantialUsOwners) && Objects.equals(this.signerName, w8BenEFormRequest.signerName) && Objects.equals(this.capacityToSignCertification, w8BenEFormRequest.capacityToSignCertification) && + Objects.equals(this.eDeliveryConsentedAt, w8BenEFormRequest.eDeliveryConsentedAt) && + Objects.equals(this.signature, w8BenEFormRequest.signature) && Objects.equals(this.companyId, w8BenEFormRequest.companyId) && Objects.equals(this.referenceId, w8BenEFormRequest.referenceId) && - Objects.equals(this.email, w8BenEFormRequest.email) && - Objects.equals(this.eDeliveryConsentedAt, w8BenEFormRequest.eDeliveryConsentedAt) && - Objects.equals(this.signature, w8BenEFormRequest.signature); + Objects.equals(this.email, w8BenEFormRequest.email); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -2573,7 +2573,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(type, name, citizenshipCountry, disregardedEntity, entityType, makingTreatyClaim, fatcaStatus, residenceAddress, residenceCity, residenceState, residenceZip, residenceCountry, residenceIsMailing, mailingAddress, mailingCity, mailingState, mailingZip, mailingCountry, tin, giin, foreignTinNotRequired, foreignTin, referenceNumber, disregardedEntityFatcaStatus, disregardedAddress, disregardedCity, disregardedState, disregardedZip, disregardedCountry, disregardedEntityGiin, treatyCountryCertification, treatyCountry, benefitLimitationCertification, benefitLimitation, qualifiedResidentStatusCertification, treatyArticle, withholdingRate, incomeType, treatyReasons, ffiSponsoringEntity, investmentEntityCertification, controlledForeignCorporationCertification, compliantNonregisteringLocalBankCertification, compliantFfiLowValueAccountsCertification, sponsoredCloselyHeldEntitySponsoringEntity, sponsoredCloselyHeldInvestmentVehicleCertification, compliantLimitedLifeDebtEntityCertification, investmentEntityNoFinancialAccountsCertification, ownerDocumentedFfiCertification, ownerDocumentedFfiReportingStatementCertification, ownerDocumentedFfiAuditorLetterCertification, ownerDocumentedFfiTrustBeneficiariesCertification, restrictedDistributorCertification, restrictedDistributorAgreementCertification, restrictedDistributorPreexistingSalesComplianceCertification, nonreportingIgaFfiCertification, igaCountry, igaModel, igaLegalStatusTreatment, igaFfiTrusteeOrSponsor, igaFfiTrusteeIsForeign, nonCommercialFinancialActivityCertification, internationOrganizationCertification, intergovernmentalOrganizationCertification, treatyQualifiedPensionFundCertification, qualifiedRetirementFundCertification, narrowParticipationRetirementFundCertification, section401AEquivalentPensionPlanCertification, investmentEntityForRetirementFundsCertification, exemptBeneficialOwnerSponsoredRetirementFundCertification, exemptBeneficialOwnerOwnedInvestmentEntityCertification, territoryFinancialInstitutionCertification, exceptedNonfinancialGroupEntityCertification, exceptedNonfinancialStartUpCertification, startupFormationOrResolutionDate, exceptedNonfinancialEntityInLiquidationOrBankruptcyCertification, nonfinancialEntityFilingDate, section501COrganizationCertification, determinationLetterDate, nonprofitOrganizationCertification, publiclyTradedNffeCertification, publiclyTradedNffeSecuritiesMarket, nffeAffiliateOfPubliclyTradedEntityCertification, publiclyTradedEntity, nffeAffiliateOfPubliclyTradedEntitySecuritiesMarket, exceptedTerritoryNffeCertification, activeNffeCertification, passiveNffeCertification, passiveNffeNoSubstantialUsOwnersCertification, passiveNffeSubstantialUsOwnersProvidedCertification, exceptedInterAffiliateFfiCertification, sponsoredDirectReportingNffeCertification, directReportingNffeSponsoringEntity, substantialUsOwners, signerName, capacityToSignCertification, companyId, referenceId, email, eDeliveryConsentedAt, signature); + return Objects.hash(type, name, citizenshipCountry, disregardedEntity, entityType, makingTreatyClaim, fatcaStatus, residenceAddress, residenceCity, residenceState, residenceZip, residenceCountry, residenceIsMailing, mailingAddress, mailingCity, mailingState, mailingZip, mailingCountry, tin, giin, foreignTinNotRequired, foreignTin, referenceNumber, disregardedEntityFatcaStatus, disregardedAddress, disregardedCity, disregardedState, disregardedZip, disregardedCountry, disregardedEntityGiin, treatyCountryCertification, treatyCountry, benefitLimitationCertification, benefitLimitation, qualifiedResidentStatusCertification, treatyArticle, withholdingRate, incomeType, treatyReasons, ffiSponsoringEntity, investmentEntityCertification, controlledForeignCorporationCertification, compliantNonregisteringLocalBankCertification, compliantFfiLowValueAccountsCertification, sponsoredCloselyHeldEntitySponsoringEntity, sponsoredCloselyHeldInvestmentVehicleCertification, compliantLimitedLifeDebtEntityCertification, investmentEntityNoFinancialAccountsCertification, ownerDocumentedFfiCertification, ownerDocumentedFfiReportingStatementCertification, ownerDocumentedFfiAuditorLetterCertification, ownerDocumentedFfiTrustBeneficiariesCertification, restrictedDistributorCertification, restrictedDistributorAgreementCertification, restrictedDistributorPreexistingSalesComplianceCertification, nonreportingIgaFfiCertification, igaCountry, igaModel, igaLegalStatusTreatment, igaFfiTrusteeOrSponsor, igaFfiTrusteeIsForeign, nonCommercialFinancialActivityCertification, internationOrganizationCertification, intergovernmentalOrganizationCertification, treatyQualifiedPensionFundCertification, qualifiedRetirementFundCertification, narrowParticipationRetirementFundCertification, section401AEquivalentPensionPlanCertification, investmentEntityForRetirementFundsCertification, exemptBeneficialOwnerSponsoredRetirementFundCertification, exemptBeneficialOwnerOwnedInvestmentEntityCertification, territoryFinancialInstitutionCertification, exceptedNonfinancialGroupEntityCertification, exceptedNonfinancialStartUpCertification, startupFormationOrResolutionDate, exceptedNonfinancialEntityInLiquidationOrBankruptcyCertification, nonfinancialEntityFilingDate, section501COrganizationCertification, determinationLetterDate, nonprofitOrganizationCertification, publiclyTradedNffeCertification, publiclyTradedNffeSecuritiesMarket, nffeAffiliateOfPubliclyTradedEntityCertification, publiclyTradedEntity, nffeAffiliateOfPubliclyTradedEntitySecuritiesMarket, exceptedTerritoryNffeCertification, activeNffeCertification, passiveNffeCertification, passiveNffeNoSubstantialUsOwnersCertification, passiveNffeSubstantialUsOwnersProvidedCertification, exceptedInterAffiliateFfiCertification, sponsoredDirectReportingNffeCertification, directReportingNffeSponsoringEntity, substantialUsOwners, signerName, capacityToSignCertification, eDeliveryConsentedAt, signature, companyId, referenceId, email); } private static int hashCodeNullable(JsonNullable a) { @@ -2683,11 +2683,11 @@ public String toString() { sb.append(" substantialUsOwners: ").append(toIndentedString(substantialUsOwners)).append("\n"); sb.append(" signerName: ").append(toIndentedString(signerName)).append("\n"); sb.append(" capacityToSignCertification: ").append(toIndentedString(capacityToSignCertification)).append("\n"); + sb.append(" eDeliveryConsentedAt: ").append(toIndentedString(eDeliveryConsentedAt)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); sb.append(" companyId: ").append(toIndentedString(companyId)).append("\n"); sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" eDeliveryConsentedAt: ").append(toIndentedString(eDeliveryConsentedAt)).append("\n"); - sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); sb.append("}"); return sb.toString(); } @@ -2710,15 +2710,16 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); + openapiFields.add("eDeliveryConsentedAt"); + openapiFields.add("signature"); openapiFields.add("type"); openapiFields.add("companyId"); openapiFields.add("referenceId"); openapiFields.add("email"); - openapiFields.add("eDeliveryConsentedAt"); - openapiFields.add("signature"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("companyId"); } /** @@ -2741,6 +2742,13 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `W8BenEFormRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : W8BenEFormRequest.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("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); @@ -2892,7 +2900,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("signerName") != null && !jsonObj.get("signerName").isJsonNull()) && !jsonObj.get("signerName").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `signerName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signerName").toString())); } - if ((jsonObj.get("companyId") != null && !jsonObj.get("companyId").isJsonNull()) && !jsonObj.get("companyId").isJsonPrimitive()) { + if ((jsonObj.get("signature") != null && !jsonObj.get("signature").isJsonNull()) && !jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + if (!jsonObj.get("companyId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `companyId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("companyId").toString())); } if ((jsonObj.get("referenceId") != null && !jsonObj.get("referenceId").isJsonNull()) && !jsonObj.get("referenceId").isJsonPrimitive()) { @@ -2901,9 +2912,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); } - if ((jsonObj.get("signature") != null && !jsonObj.get("signature").isJsonNull()) && !jsonObj.get("signature").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/W8BenEFormResponse.java b/src/main/java/Avalara/SDK/model/A1099/V2/W8BenEFormResponse.java index c83177b..da2d884 100644 --- a/src/main/java/Avalara/SDK/model/A1099/V2/W8BenEFormResponse.java +++ b/src/main/java/Avalara/SDK/model/A1099/V2/W8BenEFormResponse.java @@ -20,6 +20,7 @@ package Avalara.SDK.model.A1099.V2; import java.util.Objects; +import Avalara.SDK.model.A1099.V2.EntryStatusResponse; import Avalara.SDK.model.A1099.V2.SubstantialUsOwnerResponse; import Avalara.SDK.model.A1099.V2.W9FormBaseResponse; import com.google.gson.TypeAdapter; @@ -2534,12 +2535,12 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("id"); openapiFields.add("entryStatus"); - openapiFields.add("entryStatusDate"); openapiFields.add("referenceId"); openapiFields.add("companyId"); openapiFields.add("displayName"); openapiFields.add("email"); openapiFields.add("archived"); + openapiFields.add("ancestorId"); openapiFields.add("signature"); openapiFields.add("signedDate"); openapiFields.add("eDeliveryConsentedAt"); diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/W8BenFormMinimalRequest.java b/src/main/java/Avalara/SDK/model/A1099/V2/W8BenFormMinimalRequest.java new file mode 100644 index 0000000..fc4028a --- /dev/null +++ b/src/main/java/Avalara/SDK/model/A1099/V2/W8BenFormMinimalRequest.java @@ -0,0 +1,438 @@ +/* + * AvaTax Software Development Kit for Java (JRE) + * + * (c) 2004-2025 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * Avalara 1099 & W-9 API Definition + * + * ## 🔐 Authentication Generate a **license key** from: *[Avalara Portal](https://www.avalara.com/us/en/signin.html) → Settings → License and API Keys*. [More on authentication methods](https://developer.avalara.com/avatax-dm-combined-erp/common-setup/authentication/authentication-methods/) [Test your credentials](https://developer.avalara.com/avatax/test-credentials/) ## 📘 API & SDK Documentation [Avalara SDK (.NET) on GitHub](https://github.com/avadev/Avalara-SDK-DotNet#avalarasdk--the-unified-c-library-for-next-gen-avalara-services) [Code Examples – 1099 API](https://github.com/avadev/Avalara-SDK-DotNet/blob/main/docs/A1099/V2/Class1099IssuersApi.md#call1099issuersget) + * + * @author Sachin Baijal + * @author Jonathan Wenger + * @copyright 2004-2025 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @link https://github.com/avadev/Avalara-SDK-Java + */ + +package Avalara.SDK.model.A1099.V2; + +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 org.openapitools.jackson.nullable.JsonNullable; + +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; + +/** + * W8BenFormMinimalRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") +public class W8BenFormMinimalRequest { + /** + * The form type (always \"w8ben\" for this model). + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + W4("W4"), + + W8_BEN("W8Ben"), + + W8_BEN_E("W8BenE"), + + W8_IMY("W8Imy"), + + W9("W9"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.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 TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_REFERENCE_NUMBER = "referenceNumber"; + @SerializedName(SERIALIZED_NAME_REFERENCE_NUMBER) + private String referenceNumber; + + public static final String SERIALIZED_NAME_COMPANY_ID = "companyId"; + @SerializedName(SERIALIZED_NAME_COMPANY_ID) + private String companyId; + + public static final String SERIALIZED_NAME_REFERENCE_ID = "referenceId"; + @SerializedName(SERIALIZED_NAME_REFERENCE_ID) + private String referenceId; + + public W8BenFormMinimalRequest() { + } + + public W8BenFormMinimalRequest( + TypeEnum type + ) { + this(); + this.type = type; + } + + /** + * The form type (always \"w8ben\" for this model). + * @return type + */ + @javax.annotation.Nullable + public TypeEnum getType() { + return type; + } + + + + public W8BenFormMinimalRequest email(String email) { + this.email = email; + return this; + } + + /** + * The email address of the individual associated with the form. + * @return email + */ + @javax.annotation.Nonnull + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + + public W8BenFormMinimalRequest name(String name) { + this.name = name; + return this; + } + + /** + * The name of the individual or entity associated with the form. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public W8BenFormMinimalRequest referenceNumber(String referenceNumber) { + this.referenceNumber = referenceNumber; + return this; + } + + /** + * A reference number for the form. + * @return referenceNumber + */ + @javax.annotation.Nullable + public String getReferenceNumber() { + return referenceNumber; + } + + public void setReferenceNumber(String referenceNumber) { + this.referenceNumber = referenceNumber; + } + + + public W8BenFormMinimalRequest companyId(String companyId) { + this.companyId = companyId; + return this; + } + + /** + * The ID of the associated company. + * @return companyId + */ + @javax.annotation.Nonnull + public String getCompanyId() { + return companyId; + } + + public void setCompanyId(String companyId) { + this.companyId = companyId; + } + + + public W8BenFormMinimalRequest referenceId(String referenceId) { + this.referenceId = referenceId; + return this; + } + + /** + * A reference identifier for the form. + * @return referenceId + */ + @javax.annotation.Nullable + public String getReferenceId() { + return referenceId; + } + + public void setReferenceId(String referenceId) { + this.referenceId = referenceId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + W8BenFormMinimalRequest w8BenFormMinimalRequest = (W8BenFormMinimalRequest) o; + return Objects.equals(this.type, w8BenFormMinimalRequest.type) && + Objects.equals(this.email, w8BenFormMinimalRequest.email) && + Objects.equals(this.name, w8BenFormMinimalRequest.name) && + Objects.equals(this.referenceNumber, w8BenFormMinimalRequest.referenceNumber) && + Objects.equals(this.companyId, w8BenFormMinimalRequest.companyId) && + Objects.equals(this.referenceId, w8BenFormMinimalRequest.referenceId); + } + + 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(type, email, name, referenceNumber, companyId, referenceId); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class W8BenFormMinimalRequest {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" referenceNumber: ").append(toIndentedString(referenceNumber)).append("\n"); + sb.append(" companyId: ").append(toIndentedString(companyId)).append("\n"); + sb.append(" referenceId: ").append(toIndentedString(referenceId)).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("type"); + openapiFields.add("companyId"); + openapiFields.add("referenceId"); + openapiFields.add("email"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("email"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("companyId"); + } + + /** + * 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 W8BenFormMinimalRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!W8BenFormMinimalRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in W8BenFormMinimalRequest is not found in the empty JSON string", W8BenFormMinimalRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!W8BenFormMinimalRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `W8BenFormMinimalRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : W8BenFormMinimalRequest.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("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the optional field `type` + if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) { + TypeEnum.validateJsonElement(jsonObj.get("type")); + } + if (!jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if (!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("referenceNumber") != null && !jsonObj.get("referenceNumber").isJsonNull()) && !jsonObj.get("referenceNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `referenceNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("referenceNumber").toString())); + } + if (!jsonObj.get("companyId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `companyId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("companyId").toString())); + } + if ((jsonObj.get("referenceId") != null && !jsonObj.get("referenceId").isJsonNull()) && !jsonObj.get("referenceId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `referenceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("referenceId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!W8BenFormMinimalRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'W8BenFormMinimalRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(W8BenFormMinimalRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, W8BenFormMinimalRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public W8BenFormMinimalRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of W8BenFormMinimalRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of W8BenFormMinimalRequest + * @throws IOException if the JSON string is invalid with respect to W8BenFormMinimalRequest + */ + public static W8BenFormMinimalRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, W8BenFormMinimalRequest.class); + } + + /** + * Convert an instance of W8BenFormMinimalRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/W8BenFormRequest.java b/src/main/java/Avalara/SDK/model/A1099/V2/W8BenFormRequest.java index fed26d9..e9a1a22 100644 --- a/src/main/java/Avalara/SDK/model/A1099/V2/W8BenFormRequest.java +++ b/src/main/java/Avalara/SDK/model/A1099/V2/W8BenFormRequest.java @@ -218,6 +218,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @SerializedName(SERIALIZED_NAME_SIGNER_NAME) private String signerName; + public static final String SERIALIZED_NAME_E_DELIVERY_CONSENTED_AT = "eDeliveryConsentedAt"; + @SerializedName(SERIALIZED_NAME_E_DELIVERY_CONSENTED_AT) + private OffsetDateTime eDeliveryConsentedAt; + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + public static final String SERIALIZED_NAME_COMPANY_ID = "companyId"; @SerializedName(SERIALIZED_NAME_COMPANY_ID) private String companyId; @@ -230,14 +238,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @SerializedName(SERIALIZED_NAME_EMAIL) private String email; - public static final String SERIALIZED_NAME_E_DELIVERY_CONSENTED_AT = "eDeliveryConsentedAt"; - @SerializedName(SERIALIZED_NAME_E_DELIVERY_CONSENTED_AT) - private OffsetDateTime eDeliveryConsentedAt; - - public static final String SERIALIZED_NAME_SIGNATURE = "signature"; - @SerializedName(SERIALIZED_NAME_SIGNATURE) - private String signature; - public W8BenFormRequest() { } @@ -715,6 +715,44 @@ public void setSignerName(String signerName) { } + public W8BenFormRequest eDeliveryConsentedAt(OffsetDateTime eDeliveryConsentedAt) { + this.eDeliveryConsentedAt = eDeliveryConsentedAt; + return this; + } + + /** + * The date when e-delivery was consented. + * @return eDeliveryConsentedAt + */ + @javax.annotation.Nullable + public OffsetDateTime geteDeliveryConsentedAt() { + return eDeliveryConsentedAt; + } + + public void seteDeliveryConsentedAt(OffsetDateTime eDeliveryConsentedAt) { + this.eDeliveryConsentedAt = eDeliveryConsentedAt; + } + + + public W8BenFormRequest signature(String signature) { + this.signature = signature; + return this; + } + + /** + * The signature of the form. + * @return signature + */ + @javax.annotation.Nullable + public String getSignature() { + return signature; + } + + public void setSignature(String signature) { + this.signature = signature; + } + + public W8BenFormRequest companyId(String companyId) { this.companyId = companyId; return this; @@ -724,7 +762,7 @@ public W8BenFormRequest companyId(String companyId) { * The ID of the associated company. * @return companyId */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getCompanyId() { return companyId; } @@ -772,44 +810,6 @@ public void setEmail(String email) { } - public W8BenFormRequest eDeliveryConsentedAt(OffsetDateTime eDeliveryConsentedAt) { - this.eDeliveryConsentedAt = eDeliveryConsentedAt; - return this; - } - - /** - * The date when e-delivery was consented. - * @return eDeliveryConsentedAt - */ - @javax.annotation.Nullable - public OffsetDateTime geteDeliveryConsentedAt() { - return eDeliveryConsentedAt; - } - - public void seteDeliveryConsentedAt(OffsetDateTime eDeliveryConsentedAt) { - this.eDeliveryConsentedAt = eDeliveryConsentedAt; - } - - - public W8BenFormRequest signature(String signature) { - this.signature = signature; - return this; - } - - /** - * The signature of the form. - * @return signature - */ - @javax.annotation.Nullable - public String getSignature() { - return signature; - } - - public void setSignature(String signature) { - this.signature = signature; - } - - @Override public boolean equals(Object o) { @@ -845,11 +845,11 @@ public boolean equals(Object o) { Objects.equals(this.withholdingRate, w8BenFormRequest.withholdingRate) && Objects.equals(this.incomeType, w8BenFormRequest.incomeType) && Objects.equals(this.signerName, w8BenFormRequest.signerName) && + Objects.equals(this.eDeliveryConsentedAt, w8BenFormRequest.eDeliveryConsentedAt) && + Objects.equals(this.signature, w8BenFormRequest.signature) && Objects.equals(this.companyId, w8BenFormRequest.companyId) && Objects.equals(this.referenceId, w8BenFormRequest.referenceId) && - Objects.equals(this.email, w8BenFormRequest.email) && - Objects.equals(this.eDeliveryConsentedAt, w8BenFormRequest.eDeliveryConsentedAt) && - Objects.equals(this.signature, w8BenFormRequest.signature); + Objects.equals(this.email, w8BenFormRequest.email); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -858,7 +858,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(type, name, citizenshipCountry, residenceAddress, residenceCity, residenceState, residenceZip, residenceCountry, residenceIsMailing, mailingAddress, mailingCity, mailingState, mailingZip, mailingCountry, tin, foreignTinNotRequired, foreignTin, referenceNumber, birthday, treatyCountry, treatyArticle, treatyReasons, withholdingRate, incomeType, signerName, companyId, referenceId, email, eDeliveryConsentedAt, signature); + return Objects.hash(type, name, citizenshipCountry, residenceAddress, residenceCity, residenceState, residenceZip, residenceCountry, residenceIsMailing, mailingAddress, mailingCity, mailingState, mailingZip, mailingCountry, tin, foreignTinNotRequired, foreignTin, referenceNumber, birthday, treatyCountry, treatyArticle, treatyReasons, withholdingRate, incomeType, signerName, eDeliveryConsentedAt, signature, companyId, referenceId, email); } private static int hashCodeNullable(JsonNullable a) { @@ -897,11 +897,11 @@ public String toString() { sb.append(" withholdingRate: ").append(toIndentedString(withholdingRate)).append("\n"); sb.append(" incomeType: ").append(toIndentedString(incomeType)).append("\n"); sb.append(" signerName: ").append(toIndentedString(signerName)).append("\n"); + sb.append(" eDeliveryConsentedAt: ").append(toIndentedString(eDeliveryConsentedAt)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); sb.append(" companyId: ").append(toIndentedString(companyId)).append("\n"); sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" eDeliveryConsentedAt: ").append(toIndentedString(eDeliveryConsentedAt)).append("\n"); - sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); sb.append("}"); return sb.toString(); } @@ -924,15 +924,16 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); + openapiFields.add("eDeliveryConsentedAt"); + openapiFields.add("signature"); openapiFields.add("type"); openapiFields.add("companyId"); openapiFields.add("referenceId"); openapiFields.add("email"); - openapiFields.add("eDeliveryConsentedAt"); - openapiFields.add("signature"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("companyId"); } /** @@ -955,6 +956,13 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `W8BenFormRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : W8BenFormRequest.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("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); @@ -1026,7 +1034,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("signerName") != null && !jsonObj.get("signerName").isJsonNull()) && !jsonObj.get("signerName").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `signerName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signerName").toString())); } - if ((jsonObj.get("companyId") != null && !jsonObj.get("companyId").isJsonNull()) && !jsonObj.get("companyId").isJsonPrimitive()) { + if ((jsonObj.get("signature") != null && !jsonObj.get("signature").isJsonNull()) && !jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + if (!jsonObj.get("companyId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `companyId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("companyId").toString())); } if ((jsonObj.get("referenceId") != null && !jsonObj.get("referenceId").isJsonNull()) && !jsonObj.get("referenceId").isJsonPrimitive()) { @@ -1035,9 +1046,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); } - if ((jsonObj.get("signature") != null && !jsonObj.get("signature").isJsonNull()) && !jsonObj.get("signature").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/W8BenFormResponse.java b/src/main/java/Avalara/SDK/model/A1099/V2/W8BenFormResponse.java index c54688d..85fa345 100644 --- a/src/main/java/Avalara/SDK/model/A1099/V2/W8BenFormResponse.java +++ b/src/main/java/Avalara/SDK/model/A1099/V2/W8BenFormResponse.java @@ -20,6 +20,7 @@ package Avalara.SDK.model.A1099.V2; import java.util.Objects; +import Avalara.SDK.model.A1099.V2.EntryStatusResponse; import Avalara.SDK.model.A1099.V2.W9FormBaseResponse; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; @@ -773,12 +774,12 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("id"); openapiFields.add("entryStatus"); - openapiFields.add("entryStatusDate"); openapiFields.add("referenceId"); openapiFields.add("companyId"); openapiFields.add("displayName"); openapiFields.add("email"); openapiFields.add("archived"); + openapiFields.add("ancestorId"); openapiFields.add("signature"); openapiFields.add("signedDate"); openapiFields.add("eDeliveryConsentedAt"); diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/W8ImyFormMinimalRequest.java b/src/main/java/Avalara/SDK/model/A1099/V2/W8ImyFormMinimalRequest.java new file mode 100644 index 0000000..3d117a1 --- /dev/null +++ b/src/main/java/Avalara/SDK/model/A1099/V2/W8ImyFormMinimalRequest.java @@ -0,0 +1,438 @@ +/* + * AvaTax Software Development Kit for Java (JRE) + * + * (c) 2004-2025 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * Avalara 1099 & W-9 API Definition + * + * ## 🔐 Authentication Generate a **license key** from: *[Avalara Portal](https://www.avalara.com/us/en/signin.html) → Settings → License and API Keys*. [More on authentication methods](https://developer.avalara.com/avatax-dm-combined-erp/common-setup/authentication/authentication-methods/) [Test your credentials](https://developer.avalara.com/avatax/test-credentials/) ## 📘 API & SDK Documentation [Avalara SDK (.NET) on GitHub](https://github.com/avadev/Avalara-SDK-DotNet#avalarasdk--the-unified-c-library-for-next-gen-avalara-services) [Code Examples – 1099 API](https://github.com/avadev/Avalara-SDK-DotNet/blob/main/docs/A1099/V2/Class1099IssuersApi.md#call1099issuersget) + * + * @author Sachin Baijal + * @author Jonathan Wenger + * @copyright 2004-2025 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @link https://github.com/avadev/Avalara-SDK-Java + */ + +package Avalara.SDK.model.A1099.V2; + +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 org.openapitools.jackson.nullable.JsonNullable; + +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; + +/** + * W8ImyFormMinimalRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") +public class W8ImyFormMinimalRequest { + /** + * The form type (always \"w8imy\" for this model). + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + W4("W4"), + + W8_BEN("W8Ben"), + + W8_BEN_E("W8BenE"), + + W8_IMY("W8Imy"), + + W9("W9"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.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 TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_REFERENCE_NUMBER = "referenceNumber"; + @SerializedName(SERIALIZED_NAME_REFERENCE_NUMBER) + private String referenceNumber; + + public static final String SERIALIZED_NAME_COMPANY_ID = "companyId"; + @SerializedName(SERIALIZED_NAME_COMPANY_ID) + private String companyId; + + public static final String SERIALIZED_NAME_REFERENCE_ID = "referenceId"; + @SerializedName(SERIALIZED_NAME_REFERENCE_ID) + private String referenceId; + + public W8ImyFormMinimalRequest() { + } + + public W8ImyFormMinimalRequest( + TypeEnum type + ) { + this(); + this.type = type; + } + + /** + * The form type (always \"w8imy\" for this model). + * @return type + */ + @javax.annotation.Nullable + public TypeEnum getType() { + return type; + } + + + + public W8ImyFormMinimalRequest email(String email) { + this.email = email; + return this; + } + + /** + * The email address of the individual associated with the form. + * @return email + */ + @javax.annotation.Nonnull + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + + public W8ImyFormMinimalRequest name(String name) { + this.name = name; + return this; + } + + /** + * The name of the individual or entity associated with the form. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public W8ImyFormMinimalRequest referenceNumber(String referenceNumber) { + this.referenceNumber = referenceNumber; + return this; + } + + /** + * A reference number for the form. + * @return referenceNumber + */ + @javax.annotation.Nullable + public String getReferenceNumber() { + return referenceNumber; + } + + public void setReferenceNumber(String referenceNumber) { + this.referenceNumber = referenceNumber; + } + + + public W8ImyFormMinimalRequest companyId(String companyId) { + this.companyId = companyId; + return this; + } + + /** + * The ID of the associated company. + * @return companyId + */ + @javax.annotation.Nonnull + public String getCompanyId() { + return companyId; + } + + public void setCompanyId(String companyId) { + this.companyId = companyId; + } + + + public W8ImyFormMinimalRequest referenceId(String referenceId) { + this.referenceId = referenceId; + return this; + } + + /** + * A reference identifier for the form. + * @return referenceId + */ + @javax.annotation.Nullable + public String getReferenceId() { + return referenceId; + } + + public void setReferenceId(String referenceId) { + this.referenceId = referenceId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + W8ImyFormMinimalRequest w8ImyFormMinimalRequest = (W8ImyFormMinimalRequest) o; + return Objects.equals(this.type, w8ImyFormMinimalRequest.type) && + Objects.equals(this.email, w8ImyFormMinimalRequest.email) && + Objects.equals(this.name, w8ImyFormMinimalRequest.name) && + Objects.equals(this.referenceNumber, w8ImyFormMinimalRequest.referenceNumber) && + Objects.equals(this.companyId, w8ImyFormMinimalRequest.companyId) && + Objects.equals(this.referenceId, w8ImyFormMinimalRequest.referenceId); + } + + 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(type, email, name, referenceNumber, companyId, referenceId); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class W8ImyFormMinimalRequest {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" referenceNumber: ").append(toIndentedString(referenceNumber)).append("\n"); + sb.append(" companyId: ").append(toIndentedString(companyId)).append("\n"); + sb.append(" referenceId: ").append(toIndentedString(referenceId)).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("type"); + openapiFields.add("companyId"); + openapiFields.add("referenceId"); + openapiFields.add("email"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("email"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("companyId"); + } + + /** + * 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 W8ImyFormMinimalRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!W8ImyFormMinimalRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in W8ImyFormMinimalRequest is not found in the empty JSON string", W8ImyFormMinimalRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!W8ImyFormMinimalRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `W8ImyFormMinimalRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : W8ImyFormMinimalRequest.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("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the optional field `type` + if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) { + TypeEnum.validateJsonElement(jsonObj.get("type")); + } + if (!jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if (!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("referenceNumber") != null && !jsonObj.get("referenceNumber").isJsonNull()) && !jsonObj.get("referenceNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `referenceNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("referenceNumber").toString())); + } + if (!jsonObj.get("companyId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `companyId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("companyId").toString())); + } + if ((jsonObj.get("referenceId") != null && !jsonObj.get("referenceId").isJsonNull()) && !jsonObj.get("referenceId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `referenceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("referenceId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!W8ImyFormMinimalRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'W8ImyFormMinimalRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(W8ImyFormMinimalRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, W8ImyFormMinimalRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public W8ImyFormMinimalRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of W8ImyFormMinimalRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of W8ImyFormMinimalRequest + * @throws IOException if the JSON string is invalid with respect to W8ImyFormMinimalRequest + */ + public static W8ImyFormMinimalRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, W8ImyFormMinimalRequest.class); + } + + /** + * Convert an instance of W8ImyFormMinimalRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/W8ImyFormRequest.java b/src/main/java/Avalara/SDK/model/A1099/V2/W8ImyFormRequest.java index d8f3442..8ef761e 100644 --- a/src/main/java/Avalara/SDK/model/A1099/V2/W8ImyFormRequest.java +++ b/src/main/java/Avalara/SDK/model/A1099/V2/W8ImyFormRequest.java @@ -566,6 +566,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @SerializedName(SERIALIZED_NAME_SIGNER_NAME) private String signerName; + public static final String SERIALIZED_NAME_E_DELIVERY_CONSENTED_AT = "eDeliveryConsentedAt"; + @SerializedName(SERIALIZED_NAME_E_DELIVERY_CONSENTED_AT) + private OffsetDateTime eDeliveryConsentedAt; + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + public static final String SERIALIZED_NAME_COMPANY_ID = "companyId"; @SerializedName(SERIALIZED_NAME_COMPANY_ID) private String companyId; @@ -578,14 +586,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @SerializedName(SERIALIZED_NAME_EMAIL) private String email; - public static final String SERIALIZED_NAME_E_DELIVERY_CONSENTED_AT = "eDeliveryConsentedAt"; - @SerializedName(SERIALIZED_NAME_E_DELIVERY_CONSENTED_AT) - private OffsetDateTime eDeliveryConsentedAt; - - public static final String SERIALIZED_NAME_SIGNATURE = "signature"; - @SerializedName(SERIALIZED_NAME_SIGNATURE) - private String signature; - public W8ImyFormRequest() { } @@ -2716,6 +2716,44 @@ public void setSignerName(String signerName) { } + public W8ImyFormRequest eDeliveryConsentedAt(OffsetDateTime eDeliveryConsentedAt) { + this.eDeliveryConsentedAt = eDeliveryConsentedAt; + return this; + } + + /** + * The date when e-delivery was consented. + * @return eDeliveryConsentedAt + */ + @javax.annotation.Nullable + public OffsetDateTime geteDeliveryConsentedAt() { + return eDeliveryConsentedAt; + } + + public void seteDeliveryConsentedAt(OffsetDateTime eDeliveryConsentedAt) { + this.eDeliveryConsentedAt = eDeliveryConsentedAt; + } + + + public W8ImyFormRequest signature(String signature) { + this.signature = signature; + return this; + } + + /** + * The signature of the form. + * @return signature + */ + @javax.annotation.Nullable + public String getSignature() { + return signature; + } + + public void setSignature(String signature) { + this.signature = signature; + } + + public W8ImyFormRequest companyId(String companyId) { this.companyId = companyId; return this; @@ -2725,7 +2763,7 @@ public W8ImyFormRequest companyId(String companyId) { * The ID of the associated company. * @return companyId */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getCompanyId() { return companyId; } @@ -2773,44 +2811,6 @@ public void setEmail(String email) { } - public W8ImyFormRequest eDeliveryConsentedAt(OffsetDateTime eDeliveryConsentedAt) { - this.eDeliveryConsentedAt = eDeliveryConsentedAt; - return this; - } - - /** - * The date when e-delivery was consented. - * @return eDeliveryConsentedAt - */ - @javax.annotation.Nullable - public OffsetDateTime geteDeliveryConsentedAt() { - return eDeliveryConsentedAt; - } - - public void seteDeliveryConsentedAt(OffsetDateTime eDeliveryConsentedAt) { - this.eDeliveryConsentedAt = eDeliveryConsentedAt; - } - - - public W8ImyFormRequest signature(String signature) { - this.signature = signature; - return this; - } - - /** - * The signature of the form. - * @return signature - */ - @javax.annotation.Nullable - public String getSignature() { - return signature; - } - - public void setSignature(String signature) { - this.signature = signature; - } - - @Override public boolean equals(Object o) { @@ -2933,11 +2933,11 @@ public boolean equals(Object o) { Objects.equals(this.sponsoredDirectReportingNffeCertification, w8ImyFormRequest.sponsoredDirectReportingNffeCertification) && Objects.equals(this.directReportingNffeSponsoringEntity, w8ImyFormRequest.directReportingNffeSponsoringEntity) && Objects.equals(this.signerName, w8ImyFormRequest.signerName) && + Objects.equals(this.eDeliveryConsentedAt, w8ImyFormRequest.eDeliveryConsentedAt) && + Objects.equals(this.signature, w8ImyFormRequest.signature) && Objects.equals(this.companyId, w8ImyFormRequest.companyId) && Objects.equals(this.referenceId, w8ImyFormRequest.referenceId) && - Objects.equals(this.email, w8ImyFormRequest.email) && - Objects.equals(this.eDeliveryConsentedAt, w8ImyFormRequest.eDeliveryConsentedAt) && - Objects.equals(this.signature, w8ImyFormRequest.signature); + Objects.equals(this.email, w8ImyFormRequest.email); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -2946,7 +2946,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(type, name, citizenshipCountry, disregardedEntity, entityType, fatcaStatus, residenceAddress, residenceCity, residenceState, residenceZip, residenceCountry, residenceIsMailing, mailingAddress, mailingCity, mailingState, mailingZip, mailingCountry, tinType, tin, giin, foreignTin, referenceNumber, disregardedEntityFatcaStatus, disregardedAddress, disregardedCity, disregardedState, disregardedZip, disregardedCountry, disregardedEntityGiin, qualifiedIntermediaryCertification, qiPrimaryWithholdingResponsibilityCertification, qiWithholdingResponsibilityForPtpSalesCertification, qiNomineeWithholdingResponsibilityForPtpDistributionsCertification, qiSecuritiesLenderSubstituteDividendWithholdingCertification, qiWithholdingAnd1099ReportingResponsibilityCertification, qiForm1099OrFatcaReportingResponsibilityCertification, qiOptOutOfForm1099ReportingCertification, qiWithholdingRatePoolCertification, qiIntermediaryOrFlowThroughEntityDocumentationCertification, qualifiedDerivativesDealerCertification, qddCorporation, qddPartnership, qddDisregardedEntity, nonqualifiedIntermediaryCertification, nqiWithholdingStatementTransmissionCertification, nqiWithholdingRatePoolComplianceCertification, nqiQualifiedSecuritiesLenderCertification, nqiAlternativeWithholdingStatementVerificationCertification, territoryFinancialInstitutionCertification, tfiTreatedAsUsPersonCertification, tfiWithholdingStatementTransmissionCertification, tfiTreatedAsUsPersonForPtpSalesCertification, tfiNomineeUsPersonForPtpDistributionsCertification, tfiNotNomineeForPtpDistributionsCertification, usBranchNonEffectivelyConnectedIncomeCertification, usBranchAgreementToBeTreatedAsUsPersonCertification, usBranchWithholdingStatementAndComplianceCertification, usBranchActingAsUsPersonForPtpSalesCertification, usBranchNomineeForPtpDistributionsCertification, usBranchNotNomineeForPtpDistributionsCertification, withholdingForeignPartnershipOrTrustCertification, nonwithholdingForeignEntityWithholdingStatementCertification, foreignEntityPartnerInLowerTierPartnershipCertification, foreignPartnershipAmountRealizedSection1446FCertification, foreignPartnershipModifiedAmountRealizedCertification, foreignGrantorTrustAmountRealizedAllocationCertification, alternativeWithholdingStatementRelianceCertification, npFfiWithExemptBeneficialOwnersCertification, ffiSponsoringEntity, investmentEntityCertification, controlledForeignCorporationCertification, ownerDocumentedFfiCertification, ownerDocumentedFfiReportingStatementCertification, ownerDocumentedFfiAuditorLetterCertification, compliantNonregisteringLocalBankCertification, compliantFfiLowValueAccountsCertification, sponsoredCloselyHeldEntitySponsoringEntity, sponsoredCloselyHeldInvestmentVehicleCertification, compliantLimitedLifeDebtEntityCertification, investmentEntityNoFinancialAccountsCertification, restrictedDistributorCertification, restrictedDistributorAgreementCertification, restrictedDistributorPreexistingSalesComplianceCertification, foreignCentralBankOfIssueCertification, nonreportingIgaFfiCertification, igaCountry, igaModel, igaLegalStatusTreatment, igaFfiTrusteeOrSponsor, igaFfiTrusteeIsForeign, treatyQualifiedPensionFundCertification, qualifiedRetirementFundCertification, narrowParticipationRetirementFundCertification, section401AEquivalentPensionPlanCertification, investmentEntityForRetirementFundsCertification, exemptBeneficialOwnerSponsoredRetirementFundCertification, exceptedNonfinancialGroupEntityCertification, exceptedNonfinancialStartUpCertification, startupFormationOrResolutionDate, exceptedNonfinancialEntityInLiquidationOrBankruptcyCertification, nonfinancialEntityFilingDate, publiclyTradedNffeCertification, publiclyTradedNffeSecuritiesMarket, nffeAffiliateOfPubliclyTradedEntityCertification, publiclyTradedEntity, nffeAffiliateOfPubliclyTradedEntitySecuritiesMarket, exceptedTerritoryNffeCertification, activeNffeCertification, passiveNffeCertification, sponsoredDirectReportingNffeCertification, directReportingNffeSponsoringEntity, signerName, companyId, referenceId, email, eDeliveryConsentedAt, signature); + return Objects.hash(type, name, citizenshipCountry, disregardedEntity, entityType, fatcaStatus, residenceAddress, residenceCity, residenceState, residenceZip, residenceCountry, residenceIsMailing, mailingAddress, mailingCity, mailingState, mailingZip, mailingCountry, tinType, tin, giin, foreignTin, referenceNumber, disregardedEntityFatcaStatus, disregardedAddress, disregardedCity, disregardedState, disregardedZip, disregardedCountry, disregardedEntityGiin, qualifiedIntermediaryCertification, qiPrimaryWithholdingResponsibilityCertification, qiWithholdingResponsibilityForPtpSalesCertification, qiNomineeWithholdingResponsibilityForPtpDistributionsCertification, qiSecuritiesLenderSubstituteDividendWithholdingCertification, qiWithholdingAnd1099ReportingResponsibilityCertification, qiForm1099OrFatcaReportingResponsibilityCertification, qiOptOutOfForm1099ReportingCertification, qiWithholdingRatePoolCertification, qiIntermediaryOrFlowThroughEntityDocumentationCertification, qualifiedDerivativesDealerCertification, qddCorporation, qddPartnership, qddDisregardedEntity, nonqualifiedIntermediaryCertification, nqiWithholdingStatementTransmissionCertification, nqiWithholdingRatePoolComplianceCertification, nqiQualifiedSecuritiesLenderCertification, nqiAlternativeWithholdingStatementVerificationCertification, territoryFinancialInstitutionCertification, tfiTreatedAsUsPersonCertification, tfiWithholdingStatementTransmissionCertification, tfiTreatedAsUsPersonForPtpSalesCertification, tfiNomineeUsPersonForPtpDistributionsCertification, tfiNotNomineeForPtpDistributionsCertification, usBranchNonEffectivelyConnectedIncomeCertification, usBranchAgreementToBeTreatedAsUsPersonCertification, usBranchWithholdingStatementAndComplianceCertification, usBranchActingAsUsPersonForPtpSalesCertification, usBranchNomineeForPtpDistributionsCertification, usBranchNotNomineeForPtpDistributionsCertification, withholdingForeignPartnershipOrTrustCertification, nonwithholdingForeignEntityWithholdingStatementCertification, foreignEntityPartnerInLowerTierPartnershipCertification, foreignPartnershipAmountRealizedSection1446FCertification, foreignPartnershipModifiedAmountRealizedCertification, foreignGrantorTrustAmountRealizedAllocationCertification, alternativeWithholdingStatementRelianceCertification, npFfiWithExemptBeneficialOwnersCertification, ffiSponsoringEntity, investmentEntityCertification, controlledForeignCorporationCertification, ownerDocumentedFfiCertification, ownerDocumentedFfiReportingStatementCertification, ownerDocumentedFfiAuditorLetterCertification, compliantNonregisteringLocalBankCertification, compliantFfiLowValueAccountsCertification, sponsoredCloselyHeldEntitySponsoringEntity, sponsoredCloselyHeldInvestmentVehicleCertification, compliantLimitedLifeDebtEntityCertification, investmentEntityNoFinancialAccountsCertification, restrictedDistributorCertification, restrictedDistributorAgreementCertification, restrictedDistributorPreexistingSalesComplianceCertification, foreignCentralBankOfIssueCertification, nonreportingIgaFfiCertification, igaCountry, igaModel, igaLegalStatusTreatment, igaFfiTrusteeOrSponsor, igaFfiTrusteeIsForeign, treatyQualifiedPensionFundCertification, qualifiedRetirementFundCertification, narrowParticipationRetirementFundCertification, section401AEquivalentPensionPlanCertification, investmentEntityForRetirementFundsCertification, exemptBeneficialOwnerSponsoredRetirementFundCertification, exceptedNonfinancialGroupEntityCertification, exceptedNonfinancialStartUpCertification, startupFormationOrResolutionDate, exceptedNonfinancialEntityInLiquidationOrBankruptcyCertification, nonfinancialEntityFilingDate, publiclyTradedNffeCertification, publiclyTradedNffeSecuritiesMarket, nffeAffiliateOfPubliclyTradedEntityCertification, publiclyTradedEntity, nffeAffiliateOfPubliclyTradedEntitySecuritiesMarket, exceptedTerritoryNffeCertification, activeNffeCertification, passiveNffeCertification, sponsoredDirectReportingNffeCertification, directReportingNffeSponsoringEntity, signerName, eDeliveryConsentedAt, signature, companyId, referenceId, email); } private static int hashCodeNullable(JsonNullable a) { @@ -3072,11 +3072,11 @@ public String toString() { sb.append(" sponsoredDirectReportingNffeCertification: ").append(toIndentedString(sponsoredDirectReportingNffeCertification)).append("\n"); sb.append(" directReportingNffeSponsoringEntity: ").append(toIndentedString(directReportingNffeSponsoringEntity)).append("\n"); sb.append(" signerName: ").append(toIndentedString(signerName)).append("\n"); + sb.append(" eDeliveryConsentedAt: ").append(toIndentedString(eDeliveryConsentedAt)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); sb.append(" companyId: ").append(toIndentedString(companyId)).append("\n"); sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" eDeliveryConsentedAt: ").append(toIndentedString(eDeliveryConsentedAt)).append("\n"); - sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); sb.append("}"); return sb.toString(); } @@ -3099,15 +3099,16 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); + openapiFields.add("eDeliveryConsentedAt"); + openapiFields.add("signature"); openapiFields.add("type"); openapiFields.add("companyId"); openapiFields.add("referenceId"); openapiFields.add("email"); - openapiFields.add("eDeliveryConsentedAt"); - openapiFields.add("signature"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("companyId"); } /** @@ -3130,6 +3131,13 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `W8ImyFormRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : W8ImyFormRequest.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("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); @@ -3252,7 +3260,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("signerName") != null && !jsonObj.get("signerName").isJsonNull()) && !jsonObj.get("signerName").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `signerName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signerName").toString())); } - if ((jsonObj.get("companyId") != null && !jsonObj.get("companyId").isJsonNull()) && !jsonObj.get("companyId").isJsonPrimitive()) { + if ((jsonObj.get("signature") != null && !jsonObj.get("signature").isJsonNull()) && !jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + if (!jsonObj.get("companyId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `companyId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("companyId").toString())); } if ((jsonObj.get("referenceId") != null && !jsonObj.get("referenceId").isJsonNull()) && !jsonObj.get("referenceId").isJsonPrimitive()) { @@ -3261,9 +3272,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); } - if ((jsonObj.get("signature") != null && !jsonObj.get("signature").isJsonNull()) && !jsonObj.get("signature").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/W8ImyFormResponse.java b/src/main/java/Avalara/SDK/model/A1099/V2/W8ImyFormResponse.java index efa45c5..392d96f 100644 --- a/src/main/java/Avalara/SDK/model/A1099/V2/W8ImyFormResponse.java +++ b/src/main/java/Avalara/SDK/model/A1099/V2/W8ImyFormResponse.java @@ -20,6 +20,7 @@ package Avalara.SDK.model.A1099.V2; import java.util.Objects; +import Avalara.SDK.model.A1099.V2.EntryStatusResponse; import Avalara.SDK.model.A1099.V2.W9FormBaseResponse; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; @@ -2898,12 +2899,12 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("id"); openapiFields.add("entryStatus"); - openapiFields.add("entryStatusDate"); openapiFields.add("referenceId"); openapiFields.add("companyId"); openapiFields.add("displayName"); openapiFields.add("email"); openapiFields.add("archived"); + openapiFields.add("ancestorId"); openapiFields.add("signature"); openapiFields.add("signedDate"); openapiFields.add("eDeliveryConsentedAt"); diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/W9FormBaseMinimalRequest.java b/src/main/java/Avalara/SDK/model/A1099/V2/W9FormBaseMinimalRequest.java new file mode 100644 index 0000000..9a24b6e --- /dev/null +++ b/src/main/java/Avalara/SDK/model/A1099/V2/W9FormBaseMinimalRequest.java @@ -0,0 +1,380 @@ +/* + * AvaTax Software Development Kit for Java (JRE) + * + * (c) 2004-2025 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * Avalara 1099 & W-9 API Definition + * + * ## 🔐 Authentication Generate a **license key** from: *[Avalara Portal](https://www.avalara.com/us/en/signin.html) → Settings → License and API Keys*. [More on authentication methods](https://developer.avalara.com/avatax-dm-combined-erp/common-setup/authentication/authentication-methods/) [Test your credentials](https://developer.avalara.com/avatax/test-credentials/) ## 📘 API & SDK Documentation [Avalara SDK (.NET) on GitHub](https://github.com/avadev/Avalara-SDK-DotNet#avalarasdk--the-unified-c-library-for-next-gen-avalara-services) [Code Examples – 1099 API](https://github.com/avadev/Avalara-SDK-DotNet/blob/main/docs/A1099/V2/Class1099IssuersApi.md#call1099issuersget) + * + * @author Sachin Baijal + * @author Jonathan Wenger + * @copyright 2004-2025 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @link https://github.com/avadev/Avalara-SDK-Java + */ + +package Avalara.SDK.model.A1099.V2; + +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 org.openapitools.jackson.nullable.JsonNullable; + +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; + +/** + * W9FormBaseMinimalRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") +public class W9FormBaseMinimalRequest { + /** + * The form type. + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + W4("W4"), + + W8_BEN("W8Ben"), + + W8_BEN_E("W8BenE"), + + W8_IMY("W8Imy"), + + W9("W9"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.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 TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public static final String SERIALIZED_NAME_COMPANY_ID = "companyId"; + @SerializedName(SERIALIZED_NAME_COMPANY_ID) + private String companyId; + + public static final String SERIALIZED_NAME_REFERENCE_ID = "referenceId"; + @SerializedName(SERIALIZED_NAME_REFERENCE_ID) + private String referenceId; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public W9FormBaseMinimalRequest() { + } + + public W9FormBaseMinimalRequest( + TypeEnum type + ) { + this(); + this.type = type; + } + + /** + * The form type. + * @return type + */ + @javax.annotation.Nullable + public TypeEnum getType() { + return type; + } + + + + public W9FormBaseMinimalRequest companyId(String companyId) { + this.companyId = companyId; + return this; + } + + /** + * The ID of the associated company. + * @return companyId + */ + @javax.annotation.Nonnull + public String getCompanyId() { + return companyId; + } + + public void setCompanyId(String companyId) { + this.companyId = companyId; + } + + + public W9FormBaseMinimalRequest referenceId(String referenceId) { + this.referenceId = referenceId; + return this; + } + + /** + * A reference identifier for the form. + * @return referenceId + */ + @javax.annotation.Nullable + public String getReferenceId() { + return referenceId; + } + + public void setReferenceId(String referenceId) { + this.referenceId = referenceId; + } + + + public W9FormBaseMinimalRequest email(String email) { + this.email = email; + return this; + } + + /** + * The email address of the individual associated with the form. + * @return email + */ + @javax.annotation.Nullable + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + W9FormBaseMinimalRequest w9FormBaseMinimalRequest = (W9FormBaseMinimalRequest) o; + return Objects.equals(this.type, w9FormBaseMinimalRequest.type) && + Objects.equals(this.companyId, w9FormBaseMinimalRequest.companyId) && + Objects.equals(this.referenceId, w9FormBaseMinimalRequest.referenceId) && + Objects.equals(this.email, w9FormBaseMinimalRequest.email); + } + + 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(type, companyId, referenceId, email); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class W9FormBaseMinimalRequest {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" companyId: ").append(toIndentedString(companyId)).append("\n"); + sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).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("type"); + openapiFields.add("companyId"); + openapiFields.add("referenceId"); + openapiFields.add("email"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("companyId"); + } + + /** + * 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 W9FormBaseMinimalRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!W9FormBaseMinimalRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in W9FormBaseMinimalRequest is not found in the empty JSON string", W9FormBaseMinimalRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!W9FormBaseMinimalRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `W9FormBaseMinimalRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : W9FormBaseMinimalRequest.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("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the optional field `type` + if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) { + TypeEnum.validateJsonElement(jsonObj.get("type")); + } + if (!jsonObj.get("companyId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `companyId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("companyId").toString())); + } + if ((jsonObj.get("referenceId") != null && !jsonObj.get("referenceId").isJsonNull()) && !jsonObj.get("referenceId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `referenceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("referenceId").toString())); + } + if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!W9FormBaseMinimalRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'W9FormBaseMinimalRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(W9FormBaseMinimalRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, W9FormBaseMinimalRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public W9FormBaseMinimalRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of W9FormBaseMinimalRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of W9FormBaseMinimalRequest + * @throws IOException if the JSON string is invalid with respect to W9FormBaseMinimalRequest + */ + public static W9FormBaseMinimalRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, W9FormBaseMinimalRequest.class); + } + + /** + * Convert an instance of W9FormBaseMinimalRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/W9FormBaseRequest.java b/src/main/java/Avalara/SDK/model/A1099/V2/W9FormBaseRequest.java index ec8d476..b45ffd7 100644 --- a/src/main/java/Avalara/SDK/model/A1099/V2/W9FormBaseRequest.java +++ b/src/main/java/Avalara/SDK/model/A1099/V2/W9FormBaseRequest.java @@ -59,6 +59,14 @@ */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") public class W9FormBaseRequest { + public static final String SERIALIZED_NAME_E_DELIVERY_CONSENTED_AT = "eDeliveryConsentedAt"; + @SerializedName(SERIALIZED_NAME_E_DELIVERY_CONSENTED_AT) + private OffsetDateTime eDeliveryConsentedAt; + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + /** * The form type. */ @@ -133,14 +141,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @SerializedName(SERIALIZED_NAME_EMAIL) private String email; - public static final String SERIALIZED_NAME_E_DELIVERY_CONSENTED_AT = "eDeliveryConsentedAt"; - @SerializedName(SERIALIZED_NAME_E_DELIVERY_CONSENTED_AT) - private OffsetDateTime eDeliveryConsentedAt; - - public static final String SERIALIZED_NAME_SIGNATURE = "signature"; - @SerializedName(SERIALIZED_NAME_SIGNATURE) - private String signature; - public W9FormBaseRequest() { } @@ -151,6 +151,44 @@ public W9FormBaseRequest( this.type = type; } + public W9FormBaseRequest eDeliveryConsentedAt(OffsetDateTime eDeliveryConsentedAt) { + this.eDeliveryConsentedAt = eDeliveryConsentedAt; + return this; + } + + /** + * The date when e-delivery was consented. + * @return eDeliveryConsentedAt + */ + @javax.annotation.Nullable + public OffsetDateTime geteDeliveryConsentedAt() { + return eDeliveryConsentedAt; + } + + public void seteDeliveryConsentedAt(OffsetDateTime eDeliveryConsentedAt) { + this.eDeliveryConsentedAt = eDeliveryConsentedAt; + } + + + public W9FormBaseRequest signature(String signature) { + this.signature = signature; + return this; + } + + /** + * The signature of the form. + * @return signature + */ + @javax.annotation.Nullable + public String getSignature() { + return signature; + } + + public void setSignature(String signature) { + this.signature = signature; + } + + /** * The form type. * @return type @@ -171,7 +209,7 @@ public W9FormBaseRequest companyId(String companyId) { * The ID of the associated company. * @return companyId */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getCompanyId() { return companyId; } @@ -219,44 +257,6 @@ public void setEmail(String email) { } - public W9FormBaseRequest eDeliveryConsentedAt(OffsetDateTime eDeliveryConsentedAt) { - this.eDeliveryConsentedAt = eDeliveryConsentedAt; - return this; - } - - /** - * The date when e-delivery was consented. - * @return eDeliveryConsentedAt - */ - @javax.annotation.Nullable - public OffsetDateTime geteDeliveryConsentedAt() { - return eDeliveryConsentedAt; - } - - public void seteDeliveryConsentedAt(OffsetDateTime eDeliveryConsentedAt) { - this.eDeliveryConsentedAt = eDeliveryConsentedAt; - } - - - public W9FormBaseRequest signature(String signature) { - this.signature = signature; - return this; - } - - /** - * The signature of the form. - * @return signature - */ - @javax.annotation.Nullable - public String getSignature() { - return signature; - } - - public void setSignature(String signature) { - this.signature = signature; - } - - @Override public boolean equals(Object o) { @@ -267,12 +267,12 @@ public boolean equals(Object o) { return false; } W9FormBaseRequest w9FormBaseRequest = (W9FormBaseRequest) o; - return Objects.equals(this.type, w9FormBaseRequest.type) && + return Objects.equals(this.eDeliveryConsentedAt, w9FormBaseRequest.eDeliveryConsentedAt) && + Objects.equals(this.signature, w9FormBaseRequest.signature) && + Objects.equals(this.type, w9FormBaseRequest.type) && Objects.equals(this.companyId, w9FormBaseRequest.companyId) && Objects.equals(this.referenceId, w9FormBaseRequest.referenceId) && - Objects.equals(this.email, w9FormBaseRequest.email) && - Objects.equals(this.eDeliveryConsentedAt, w9FormBaseRequest.eDeliveryConsentedAt) && - Objects.equals(this.signature, w9FormBaseRequest.signature); + Objects.equals(this.email, w9FormBaseRequest.email); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -281,7 +281,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(type, companyId, referenceId, email, eDeliveryConsentedAt, signature); + return Objects.hash(eDeliveryConsentedAt, signature, type, companyId, referenceId, email); } private static int hashCodeNullable(JsonNullable a) { @@ -295,12 +295,12 @@ private static int hashCodeNullable(JsonNullable a) { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class W9FormBaseRequest {\n"); + sb.append(" eDeliveryConsentedAt: ").append(toIndentedString(eDeliveryConsentedAt)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" companyId: ").append(toIndentedString(companyId)).append("\n"); sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" eDeliveryConsentedAt: ").append(toIndentedString(eDeliveryConsentedAt)).append("\n"); - sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); sb.append("}"); return sb.toString(); } @@ -327,11 +327,10 @@ private String toIndentedString(Object o) { openapiFields.add("companyId"); openapiFields.add("referenceId"); openapiFields.add("email"); - openapiFields.add("eDeliveryConsentedAt"); - openapiFields.add("signature"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("companyId"); } /** @@ -354,7 +353,17 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `W9FormBaseRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : W9FormBaseRequest.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("signature") != null && !jsonObj.get("signature").isJsonNull()) && !jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } @@ -362,7 +371,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) { TypeEnum.validateJsonElement(jsonObj.get("type")); } - if ((jsonObj.get("companyId") != null && !jsonObj.get("companyId").isJsonNull()) && !jsonObj.get("companyId").isJsonPrimitive()) { + if (!jsonObj.get("companyId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `companyId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("companyId").toString())); } if ((jsonObj.get("referenceId") != null && !jsonObj.get("referenceId").isJsonNull()) && !jsonObj.get("referenceId").isJsonPrimitive()) { @@ -371,9 +380,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); } - if ((jsonObj.get("signature") != null && !jsonObj.get("signature").isJsonNull()) && !jsonObj.get("signature").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/W9FormBaseResponse.java b/src/main/java/Avalara/SDK/model/A1099/V2/W9FormBaseResponse.java index fecf3ed..e771063 100644 --- a/src/main/java/Avalara/SDK/model/A1099/V2/W9FormBaseResponse.java +++ b/src/main/java/Avalara/SDK/model/A1099/V2/W9FormBaseResponse.java @@ -20,6 +20,7 @@ package Avalara.SDK.model.A1099.V2; import java.util.Objects; +import Avalara.SDK.model.A1099.V2.EntryStatusResponse; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -65,11 +66,7 @@ public class W9FormBaseResponse { public static final String SERIALIZED_NAME_ENTRY_STATUS = "entryStatus"; @SerializedName(SERIALIZED_NAME_ENTRY_STATUS) - private String entryStatus; - - public static final String SERIALIZED_NAME_ENTRY_STATUS_DATE = "entryStatusDate"; - @SerializedName(SERIALIZED_NAME_ENTRY_STATUS_DATE) - private OffsetDateTime entryStatusDate; + private EntryStatusResponse entryStatus; public static final String SERIALIZED_NAME_REFERENCE_ID = "referenceId"; @SerializedName(SERIALIZED_NAME_REFERENCE_ID) @@ -91,6 +88,10 @@ public class W9FormBaseResponse { @SerializedName(SERIALIZED_NAME_ARCHIVED) private Boolean archived; + public static final String SERIALIZED_NAME_ANCESTOR_ID = "ancestorId"; + @SerializedName(SERIALIZED_NAME_ANCESTOR_ID) + private String ancestorId; + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; @SerializedName(SERIALIZED_NAME_SIGNATURE) private String signature; @@ -138,44 +139,25 @@ public void setId(String id) { } - public W9FormBaseResponse entryStatus(String entryStatus) { + public W9FormBaseResponse entryStatus(EntryStatusResponse entryStatus) { this.entryStatus = entryStatus; return this; } /** - * The form status. + * The entry status information for the form. * @return entryStatus */ @javax.annotation.Nullable - public String getEntryStatus() { + public EntryStatusResponse getEntryStatus() { return entryStatus; } - public void setEntryStatus(String entryStatus) { + public void setEntryStatus(EntryStatusResponse entryStatus) { this.entryStatus = entryStatus; } - public W9FormBaseResponse entryStatusDate(OffsetDateTime entryStatusDate) { - this.entryStatusDate = entryStatusDate; - return this; - } - - /** - * The timestamp for the latest status update. - * @return entryStatusDate - */ - @javax.annotation.Nullable - public OffsetDateTime getEntryStatusDate() { - return entryStatusDate; - } - - public void setEntryStatusDate(OffsetDateTime entryStatusDate) { - this.entryStatusDate = entryStatusDate; - } - - public W9FormBaseResponse referenceId(String referenceId) { this.referenceId = referenceId; return this; @@ -271,6 +253,25 @@ public void setArchived(Boolean archived) { } + public W9FormBaseResponse ancestorId(String ancestorId) { + this.ancestorId = ancestorId; + return this; + } + + /** + * Form ID of previous version. + * @return ancestorId + */ + @javax.annotation.Nullable + public String getAncestorId() { + return ancestorId; + } + + public void setAncestorId(String ancestorId) { + this.ancestorId = ancestorId; + } + + public W9FormBaseResponse signature(String signature) { this.signature = signature; return this; @@ -397,12 +398,12 @@ public boolean equals(Object o) { W9FormBaseResponse w9FormBaseResponse = (W9FormBaseResponse) o; return Objects.equals(this.id, w9FormBaseResponse.id) && Objects.equals(this.entryStatus, w9FormBaseResponse.entryStatus) && - Objects.equals(this.entryStatusDate, w9FormBaseResponse.entryStatusDate) && Objects.equals(this.referenceId, w9FormBaseResponse.referenceId) && Objects.equals(this.companyId, w9FormBaseResponse.companyId) && Objects.equals(this.displayName, w9FormBaseResponse.displayName) && Objects.equals(this.email, w9FormBaseResponse.email) && Objects.equals(this.archived, w9FormBaseResponse.archived) && + Objects.equals(this.ancestorId, w9FormBaseResponse.ancestorId) && Objects.equals(this.signature, w9FormBaseResponse.signature) && Objects.equals(this.signedDate, w9FormBaseResponse.signedDate) && Objects.equals(this.eDeliveryConsentedAt, w9FormBaseResponse.eDeliveryConsentedAt) && @@ -417,7 +418,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(id, entryStatus, entryStatusDate, referenceId, companyId, displayName, email, archived, signature, signedDate, eDeliveryConsentedAt, createdAt, updatedAt, type); + return Objects.hash(id, entryStatus, referenceId, companyId, displayName, email, archived, ancestorId, signature, signedDate, eDeliveryConsentedAt, createdAt, updatedAt, type); } private static int hashCodeNullable(JsonNullable a) { @@ -433,12 +434,12 @@ public String toString() { sb.append("class W9FormBaseResponse {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" entryStatus: ").append(toIndentedString(entryStatus)).append("\n"); - sb.append(" entryStatusDate: ").append(toIndentedString(entryStatusDate)).append("\n"); sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); sb.append(" companyId: ").append(toIndentedString(companyId)).append("\n"); sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); sb.append(" email: ").append(toIndentedString(email)).append("\n"); sb.append(" archived: ").append(toIndentedString(archived)).append("\n"); + sb.append(" ancestorId: ").append(toIndentedString(ancestorId)).append("\n"); sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); sb.append(" signedDate: ").append(toIndentedString(signedDate)).append("\n"); sb.append(" eDeliveryConsentedAt: ").append(toIndentedString(eDeliveryConsentedAt)).append("\n"); diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/W9FormMinimalRequest.java b/src/main/java/Avalara/SDK/model/A1099/V2/W9FormMinimalRequest.java new file mode 100644 index 0000000..2a5ae9c --- /dev/null +++ b/src/main/java/Avalara/SDK/model/A1099/V2/W9FormMinimalRequest.java @@ -0,0 +1,438 @@ +/* + * AvaTax Software Development Kit for Java (JRE) + * + * (c) 2004-2025 Avalara, Inc. + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * Avalara 1099 & W-9 API Definition + * + * ## 🔐 Authentication Generate a **license key** from: *[Avalara Portal](https://www.avalara.com/us/en/signin.html) → Settings → License and API Keys*. [More on authentication methods](https://developer.avalara.com/avatax-dm-combined-erp/common-setup/authentication/authentication-methods/) [Test your credentials](https://developer.avalara.com/avatax/test-credentials/) ## 📘 API & SDK Documentation [Avalara SDK (.NET) on GitHub](https://github.com/avadev/Avalara-SDK-DotNet#avalarasdk--the-unified-c-library-for-next-gen-avalara-services) [Code Examples – 1099 API](https://github.com/avadev/Avalara-SDK-DotNet/blob/main/docs/A1099/V2/Class1099IssuersApi.md#call1099issuersget) + * + * @author Sachin Baijal + * @author Jonathan Wenger + * @copyright 2004-2025 Avalara, Inc. + * @license https://www.apache.org/licenses/LICENSE-2.0 + * @link https://github.com/avadev/Avalara-SDK-Java + */ + +package Avalara.SDK.model.A1099.V2; + +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 org.openapitools.jackson.nullable.JsonNullable; + +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; + +/** + * W9FormMinimalRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") +public class W9FormMinimalRequest { + /** + * The form type (always \"w9\" for this model). + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + W4("W4"), + + W8_BEN("W8Ben"), + + W8_BEN_E("W8BenE"), + + W8_IMY("W8Imy"), + + W9("W9"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.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 TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) + private String accountNumber; + + public static final String SERIALIZED_NAME_COMPANY_ID = "companyId"; + @SerializedName(SERIALIZED_NAME_COMPANY_ID) + private String companyId; + + public static final String SERIALIZED_NAME_REFERENCE_ID = "referenceId"; + @SerializedName(SERIALIZED_NAME_REFERENCE_ID) + private String referenceId; + + public W9FormMinimalRequest() { + } + + public W9FormMinimalRequest( + TypeEnum type + ) { + this(); + this.type = type; + } + + /** + * The form type (always \"w9\" for this model). + * @return type + */ + @javax.annotation.Nullable + public TypeEnum getType() { + return type; + } + + + + public W9FormMinimalRequest email(String email) { + this.email = email; + return this; + } + + /** + * The email address of the individual associated with the form. + * @return email + */ + @javax.annotation.Nonnull + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + + public W9FormMinimalRequest name(String name) { + this.name = name; + return this; + } + + /** + * The name of the individual or entity associated with the form. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public W9FormMinimalRequest accountNumber(String accountNumber) { + this.accountNumber = accountNumber; + return this; + } + + /** + * The account number associated with the form. + * @return accountNumber + */ + @javax.annotation.Nullable + public String getAccountNumber() { + return accountNumber; + } + + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + } + + + public W9FormMinimalRequest companyId(String companyId) { + this.companyId = companyId; + return this; + } + + /** + * The ID of the associated company. + * @return companyId + */ + @javax.annotation.Nonnull + public String getCompanyId() { + return companyId; + } + + public void setCompanyId(String companyId) { + this.companyId = companyId; + } + + + public W9FormMinimalRequest referenceId(String referenceId) { + this.referenceId = referenceId; + return this; + } + + /** + * A reference identifier for the form. + * @return referenceId + */ + @javax.annotation.Nullable + public String getReferenceId() { + return referenceId; + } + + public void setReferenceId(String referenceId) { + this.referenceId = referenceId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + W9FormMinimalRequest w9FormMinimalRequest = (W9FormMinimalRequest) o; + return Objects.equals(this.type, w9FormMinimalRequest.type) && + Objects.equals(this.email, w9FormMinimalRequest.email) && + Objects.equals(this.name, w9FormMinimalRequest.name) && + Objects.equals(this.accountNumber, w9FormMinimalRequest.accountNumber) && + Objects.equals(this.companyId, w9FormMinimalRequest.companyId) && + Objects.equals(this.referenceId, w9FormMinimalRequest.referenceId); + } + + 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(type, email, name, accountNumber, companyId, referenceId); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class W9FormMinimalRequest {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" companyId: ").append(toIndentedString(companyId)).append("\n"); + sb.append(" referenceId: ").append(toIndentedString(referenceId)).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("type"); + openapiFields.add("companyId"); + openapiFields.add("referenceId"); + openapiFields.add("email"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("email"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("companyId"); + } + + /** + * 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 W9FormMinimalRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!W9FormMinimalRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in W9FormMinimalRequest is not found in the empty JSON string", W9FormMinimalRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!W9FormMinimalRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `W9FormMinimalRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : W9FormMinimalRequest.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("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the optional field `type` + if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) { + TypeEnum.validateJsonElement(jsonObj.get("type")); + } + if (!jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if (!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("accountNumber") != null && !jsonObj.get("accountNumber").isJsonNull()) && !jsonObj.get("accountNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); + } + if (!jsonObj.get("companyId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `companyId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("companyId").toString())); + } + if ((jsonObj.get("referenceId") != null && !jsonObj.get("referenceId").isJsonNull()) && !jsonObj.get("referenceId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `referenceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("referenceId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!W9FormMinimalRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'W9FormMinimalRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(W9FormMinimalRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, W9FormMinimalRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public W9FormMinimalRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of W9FormMinimalRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of W9FormMinimalRequest + * @throws IOException if the JSON string is invalid with respect to W9FormMinimalRequest + */ + public static W9FormMinimalRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, W9FormMinimalRequest.class); + } + + /** + * Convert an instance of W9FormMinimalRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/W9FormRequest.java b/src/main/java/Avalara/SDK/model/A1099/V2/W9FormRequest.java index a065787..5b6c274 100644 --- a/src/main/java/Avalara/SDK/model/A1099/V2/W9FormRequest.java +++ b/src/main/java/Avalara/SDK/model/A1099/V2/W9FormRequest.java @@ -193,6 +193,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @SerializedName(SERIALIZED_NAME_IS1099ABLE) private Boolean is1099able; + public static final String SERIALIZED_NAME_E_DELIVERY_CONSENTED_AT = "eDeliveryConsentedAt"; + @SerializedName(SERIALIZED_NAME_E_DELIVERY_CONSENTED_AT) + private OffsetDateTime eDeliveryConsentedAt; + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + private String signature; + public static final String SERIALIZED_NAME_COMPANY_ID = "companyId"; @SerializedName(SERIALIZED_NAME_COMPANY_ID) private String companyId; @@ -205,14 +213,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @SerializedName(SERIALIZED_NAME_EMAIL) private String email; - public static final String SERIALIZED_NAME_E_DELIVERY_CONSENTED_AT = "eDeliveryConsentedAt"; - @SerializedName(SERIALIZED_NAME_E_DELIVERY_CONSENTED_AT) - private OffsetDateTime eDeliveryConsentedAt; - - public static final String SERIALIZED_NAME_SIGNATURE = "signature"; - @SerializedName(SERIALIZED_NAME_SIGNATURE) - private String signature; - public W9FormRequest() { } @@ -576,6 +576,44 @@ public void setIs1099able(Boolean is1099able) { } + public W9FormRequest eDeliveryConsentedAt(OffsetDateTime eDeliveryConsentedAt) { + this.eDeliveryConsentedAt = eDeliveryConsentedAt; + return this; + } + + /** + * The date when e-delivery was consented. + * @return eDeliveryConsentedAt + */ + @javax.annotation.Nullable + public OffsetDateTime geteDeliveryConsentedAt() { + return eDeliveryConsentedAt; + } + + public void seteDeliveryConsentedAt(OffsetDateTime eDeliveryConsentedAt) { + this.eDeliveryConsentedAt = eDeliveryConsentedAt; + } + + + public W9FormRequest signature(String signature) { + this.signature = signature; + return this; + } + + /** + * The signature of the form. + * @return signature + */ + @javax.annotation.Nullable + public String getSignature() { + return signature; + } + + public void setSignature(String signature) { + this.signature = signature; + } + + public W9FormRequest companyId(String companyId) { this.companyId = companyId; return this; @@ -585,7 +623,7 @@ public W9FormRequest companyId(String companyId) { * The ID of the associated company. * @return companyId */ - @javax.annotation.Nullable + @javax.annotation.Nonnull public String getCompanyId() { return companyId; } @@ -633,44 +671,6 @@ public void setEmail(String email) { } - public W9FormRequest eDeliveryConsentedAt(OffsetDateTime eDeliveryConsentedAt) { - this.eDeliveryConsentedAt = eDeliveryConsentedAt; - return this; - } - - /** - * The date when e-delivery was consented. - * @return eDeliveryConsentedAt - */ - @javax.annotation.Nullable - public OffsetDateTime geteDeliveryConsentedAt() { - return eDeliveryConsentedAt; - } - - public void seteDeliveryConsentedAt(OffsetDateTime eDeliveryConsentedAt) { - this.eDeliveryConsentedAt = eDeliveryConsentedAt; - } - - - public W9FormRequest signature(String signature) { - this.signature = signature; - return this; - } - - /** - * The signature of the form. - * @return signature - */ - @javax.annotation.Nullable - public String getSignature() { - return signature; - } - - public void setSignature(String signature) { - this.signature = signature; - } - - @Override public boolean equals(Object o) { @@ -700,11 +700,11 @@ public boolean equals(Object o) { Objects.equals(this.tin, w9FormRequest.tin) && Objects.equals(this.backupWithholding, w9FormRequest.backupWithholding) && Objects.equals(this.is1099able, w9FormRequest.is1099able) && + Objects.equals(this.eDeliveryConsentedAt, w9FormRequest.eDeliveryConsentedAt) && + Objects.equals(this.signature, w9FormRequest.signature) && Objects.equals(this.companyId, w9FormRequest.companyId) && Objects.equals(this.referenceId, w9FormRequest.referenceId) && - Objects.equals(this.email, w9FormRequest.email) && - Objects.equals(this.eDeliveryConsentedAt, w9FormRequest.eDeliveryConsentedAt) && - Objects.equals(this.signature, w9FormRequest.signature); + Objects.equals(this.email, w9FormRequest.email); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -713,7 +713,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(type, name, businessName, businessClassification, businessOther, foreignPartnerOwnerOrBeneficiary, exemptPayeeCode, exemptFatcaCode, foreignCountryIndicator, address, foreignAddress, city, state, zip, accountNumber, tinType, tin, backupWithholding, is1099able, companyId, referenceId, email, eDeliveryConsentedAt, signature); + return Objects.hash(type, name, businessName, businessClassification, businessOther, foreignPartnerOwnerOrBeneficiary, exemptPayeeCode, exemptFatcaCode, foreignCountryIndicator, address, foreignAddress, city, state, zip, accountNumber, tinType, tin, backupWithholding, is1099able, eDeliveryConsentedAt, signature, companyId, referenceId, email); } private static int hashCodeNullable(JsonNullable a) { @@ -746,11 +746,11 @@ public String toString() { sb.append(" tin: ").append(toIndentedString(tin)).append("\n"); sb.append(" backupWithholding: ").append(toIndentedString(backupWithholding)).append("\n"); sb.append(" is1099able: ").append(toIndentedString(is1099able)).append("\n"); + sb.append(" eDeliveryConsentedAt: ").append(toIndentedString(eDeliveryConsentedAt)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); sb.append(" companyId: ").append(toIndentedString(companyId)).append("\n"); sb.append(" referenceId: ").append(toIndentedString(referenceId)).append("\n"); sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" eDeliveryConsentedAt: ").append(toIndentedString(eDeliveryConsentedAt)).append("\n"); - sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); sb.append("}"); return sb.toString(); } @@ -773,15 +773,16 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); + openapiFields.add("eDeliveryConsentedAt"); + openapiFields.add("signature"); openapiFields.add("type"); openapiFields.add("companyId"); openapiFields.add("referenceId"); openapiFields.add("email"); - openapiFields.add("eDeliveryConsentedAt"); - openapiFields.add("signature"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("companyId"); } /** @@ -804,6 +805,13 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `W9FormRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : W9FormRequest.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("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); @@ -854,7 +862,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("tin") != null && !jsonObj.get("tin").isJsonNull()) && !jsonObj.get("tin").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `tin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tin").toString())); } - if ((jsonObj.get("companyId") != null && !jsonObj.get("companyId").isJsonNull()) && !jsonObj.get("companyId").isJsonPrimitive()) { + if ((jsonObj.get("signature") != null && !jsonObj.get("signature").isJsonNull()) && !jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + if (!jsonObj.get("companyId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `companyId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("companyId").toString())); } if ((jsonObj.get("referenceId") != null && !jsonObj.get("referenceId").isJsonNull()) && !jsonObj.get("referenceId").isJsonPrimitive()) { @@ -863,9 +874,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); } - if ((jsonObj.get("signature") != null && !jsonObj.get("signature").isJsonNull()) && !jsonObj.get("signature").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/Avalara/SDK/model/A1099/V2/W9FormResponse.java b/src/main/java/Avalara/SDK/model/A1099/V2/W9FormResponse.java index 5f090fa..5798a81 100644 --- a/src/main/java/Avalara/SDK/model/A1099/V2/W9FormResponse.java +++ b/src/main/java/Avalara/SDK/model/A1099/V2/W9FormResponse.java @@ -20,6 +20,7 @@ package Avalara.SDK.model.A1099.V2; import java.util.Objects; +import Avalara.SDK.model.A1099.V2.EntryStatusResponse; import Avalara.SDK.model.A1099.V2.TinMatchStatusResponse; import Avalara.SDK.model.A1099.V2.W9FormBaseResponse; import com.google.gson.TypeAdapter; @@ -598,12 +599,12 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("id"); openapiFields.add("entryStatus"); - openapiFields.add("entryStatusDate"); openapiFields.add("referenceId"); openapiFields.add("companyId"); openapiFields.add("displayName"); openapiFields.add("email"); openapiFields.add("archived"); + openapiFields.add("ancestorId"); openapiFields.add("signature"); openapiFields.add("signedDate"); openapiFields.add("eDeliveryConsentedAt"); diff --git a/src/main/java/Avalara/SDK/model/EInvoicing/V1/DirectorySearchResponseValueInner.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/DirectorySearchResponseValueInner.java deleted file mode 100644 index c1852b0..0000000 --- a/src/main/java/Avalara/SDK/model/EInvoicing/V1/DirectorySearchResponseValueInner.java +++ /dev/null @@ -1,446 +0,0 @@ -/* - * AvaTax Software Development Kit for Java (JRE) - * - * (c) 2004-2025 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-2025 Avalara, Inc. - * @license https://www.apache.org/licenses/LICENSE-2.0 - * @link https://github.com/avadev/Avalara-SDK-Java - */ - -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 deleted file mode 100644 index 397433c..0000000 --- a/src/main/java/Avalara/SDK/model/EInvoicing/V1/DirectorySearchResponseValueInnerAddressesInner.java +++ /dev/null @@ -1,328 +0,0 @@ -/* - * AvaTax Software Development Kit for Java (JRE) - * - * (c) 2004-2025 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-2025 Avalara, Inc. - * @license https://www.apache.org/licenses/LICENSE-2.0 - * @link https://github.com/avadev/Avalara-SDK-Java - */ - -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 deleted file mode 100644 index a28141a..0000000 --- a/src/main/java/Avalara/SDK/model/EInvoicing/V1/DirectorySearchResponseValueInnerIdentifiersInner.java +++ /dev/null @@ -1,241 +0,0 @@ -/* - * AvaTax Software Development Kit for Java (JRE) - * - * (c) 2004-2025 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-2025 Avalara, Inc. - * @license https://www.apache.org/licenses/LICENSE-2.0 - * @link https://github.com/avadev/Avalara-SDK-Java - */ - -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 deleted file mode 100644 index d724aa7..0000000 --- a/src/main/java/Avalara/SDK/model/EInvoicing/V1/DirectorySearchResponseValueInnerSupportedDocumentTypesInner.java +++ /dev/null @@ -1,293 +0,0 @@ -/* - * AvaTax Software Development Kit for Java (JRE) - * - * (c) 2004-2025 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-2025 Avalara, Inc. - * @license https://www.apache.org/licenses/LICENSE-2.0 - * @link https://github.com/avadev/Avalara-SDK-Java - */ - -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/DocumentFetchRequest.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/DocumentFetchRequest.java deleted file mode 100644 index 74a875b..0000000 --- a/src/main/java/Avalara/SDK/model/EInvoicing/V1/DocumentFetchRequest.java +++ /dev/null @@ -1,265 +0,0 @@ -/* - * AvaTax Software Development Kit for Java (JRE) - * - * (c) 2004-2025 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-2025 Avalara, Inc. - * @license https://www.apache.org/licenses/LICENSE-2.0 - * @link https://github.com/avadev/Avalara-SDK-Java - */ - -package Avalara.SDK.model.EInvoicing.V1; - -import java.util.Objects; -import Avalara.SDK.model.EInvoicing.V1.DocumentFetchRequestDataInner; -import Avalara.SDK.model.EInvoicing.V1.DocumentFetchRequestMetadata; -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; - -/** - * DocumentFetchRequest - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") -public class DocumentFetchRequest { - 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 DocumentFetchRequestMetadata metadata; - - public DocumentFetchRequest() { - } - - public DocumentFetchRequest data(List data) { - this.data = data; - return this; - } - - public DocumentFetchRequest addDataItem(DocumentFetchRequestDataInner 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 DocumentFetchRequest metadata(DocumentFetchRequestMetadata metadata) { - this.metadata = metadata; - return this; - } - - /** - * Get metadata - * @return metadata - */ - @javax.annotation.Nullable - public DocumentFetchRequestMetadata getMetadata() { - return metadata; - } - - public void setMetadata(DocumentFetchRequestMetadata metadata) { - this.metadata = metadata; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DocumentFetchRequest documentFetchRequest = (DocumentFetchRequest) o; - return Objects.equals(this.data, documentFetchRequest.data) && - Objects.equals(this.metadata, documentFetchRequest.metadata); - } - - @Override - public int hashCode() { - return Objects.hash(data, metadata); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DocumentFetchRequest {\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 DocumentFetchRequest - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!DocumentFetchRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DocumentFetchRequest is not found in the empty JSON string", DocumentFetchRequest.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!DocumentFetchRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DocumentFetchRequest` 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++) { - DocumentFetchRequestDataInner.validateJsonElement(jsonArraydata.get(i)); - }; - } - } - // validate the optional field `metadata` - if (jsonObj.get("metadata") != null && !jsonObj.get("metadata").isJsonNull()) { - DocumentFetchRequestMetadata.validateJsonElement(jsonObj.get("metadata")); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!DocumentFetchRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DocumentFetchRequest' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DocumentFetchRequest.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DocumentFetchRequest value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DocumentFetchRequest read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of DocumentFetchRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of DocumentFetchRequest - * @throws IOException if the JSON string is invalid with respect to DocumentFetchRequest - */ - public static DocumentFetchRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DocumentFetchRequest.class); - } - - /** - * Convert an instance of DocumentFetchRequest 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/DocumentFetchRequestDataInner.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/DocumentFetchRequestDataInner.java deleted file mode 100644 index 2812b19..0000000 --- a/src/main/java/Avalara/SDK/model/EInvoicing/V1/DocumentFetchRequestDataInner.java +++ /dev/null @@ -1,250 +0,0 @@ -/* - * AvaTax Software Development Kit for Java (JRE) - * - * (c) 2004-2025 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-2025 Avalara, Inc. - * @license https://www.apache.org/licenses/LICENSE-2.0 - * @link https://github.com/avadev/Avalara-SDK-Java - */ - -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; - -/** - * DocumentFetchRequestDataInner - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") -public class DocumentFetchRequestDataInner { - 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 DocumentFetchRequestDataInner() { - } - - public DocumentFetchRequestDataInner 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 DocumentFetchRequestDataInner 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; - } - DocumentFetchRequestDataInner documentFetchRequestDataInner = (DocumentFetchRequestDataInner) o; - return Objects.equals(this.key, documentFetchRequestDataInner.key) && - Objects.equals(this.value, documentFetchRequestDataInner.value); - } - - @Override - public int hashCode() { - return Objects.hash(key, value); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DocumentFetchRequestDataInner {\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 DocumentFetchRequestDataInner - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!DocumentFetchRequestDataInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DocumentFetchRequestDataInner is not found in the empty JSON string", DocumentFetchRequestDataInner.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!DocumentFetchRequestDataInner.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DocumentFetchRequestDataInner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DocumentFetchRequestDataInner.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 (!DocumentFetchRequestDataInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DocumentFetchRequestDataInner' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DocumentFetchRequestDataInner.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DocumentFetchRequestDataInner value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DocumentFetchRequestDataInner read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of DocumentFetchRequestDataInner given an JSON string - * - * @param jsonString JSON string - * @return An instance of DocumentFetchRequestDataInner - * @throws IOException if the JSON string is invalid with respect to DocumentFetchRequestDataInner - */ - public static DocumentFetchRequestDataInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DocumentFetchRequestDataInner.class); - } - - /** - * Convert an instance of DocumentFetchRequestDataInner 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/DocumentFetchRequestMetadata.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/DocumentFetchRequestMetadata.java deleted file mode 100644 index 50d9a06..0000000 --- a/src/main/java/Avalara/SDK/model/EInvoicing/V1/DocumentFetchRequestMetadata.java +++ /dev/null @@ -1,338 +0,0 @@ -/* - * AvaTax Software Development Kit for Java (JRE) - * - * (c) 2004-2025 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-2025 Avalara, Inc. - * @license https://www.apache.org/licenses/LICENSE-2.0 - * @link https://github.com/avadev/Avalara-SDK-Java - */ - -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; - -/** - * DocumentFetchRequestMetadata - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") -public class DocumentFetchRequestMetadata { - 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 DocumentFetchRequestMetadata() { - } - - public DocumentFetchRequestMetadata 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 DocumentFetchRequestMetadata 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 DocumentFetchRequestMetadata 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 DocumentFetchRequestMetadata 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 DocumentFetchRequestMetadata 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; - } - DocumentFetchRequestMetadata documentFetchRequestMetadata = (DocumentFetchRequestMetadata) o; - return Objects.equals(this.workflowId, documentFetchRequestMetadata.workflowId) && - Objects.equals(this.dataFormat, documentFetchRequestMetadata.dataFormat) && - Objects.equals(this.dataFormatVersion, documentFetchRequestMetadata.dataFormatVersion) && - Objects.equals(this.countryCode, documentFetchRequestMetadata.countryCode) && - Objects.equals(this.countryMandate, documentFetchRequestMetadata.countryMandate); - } - - @Override - public int hashCode() { - return Objects.hash(workflowId, dataFormat, dataFormatVersion, countryCode, countryMandate); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DocumentFetchRequestMetadata {\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 DocumentFetchRequestMetadata - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!DocumentFetchRequestMetadata.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in DocumentFetchRequestMetadata is not found in the empty JSON string", DocumentFetchRequestMetadata.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!DocumentFetchRequestMetadata.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DocumentFetchRequestMetadata` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DocumentFetchRequestMetadata.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 (!DocumentFetchRequestMetadata.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'DocumentFetchRequestMetadata' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(DocumentFetchRequestMetadata.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, DocumentFetchRequestMetadata value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public DocumentFetchRequestMetadata read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of DocumentFetchRequestMetadata given an JSON string - * - * @param jsonString JSON string - * @return An instance of DocumentFetchRequestMetadata - * @throws IOException if the JSON string is invalid with respect to DocumentFetchRequestMetadata - */ - public static DocumentFetchRequestMetadata fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, DocumentFetchRequestMetadata.class); - } - - /** - * Convert an instance of DocumentFetchRequestMetadata 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/SubmitDocumentData.java b/src/main/java/Avalara/SDK/model/EInvoicing/V1/SubmitDocumentData.java deleted file mode 100644 index 24e6857..0000000 --- a/src/main/java/Avalara/SDK/model/EInvoicing/V1/SubmitDocumentData.java +++ /dev/null @@ -1,213 +0,0 @@ -/* - * 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 document to be submitted, as indicated by the metadata fields 'dataFormat' and 'dataFormatVersion' - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class SubmitDocumentData { - public static final String SERIALIZED_NAME_DATA = "data"; - @SerializedName(SERIALIZED_NAME_DATA) - private String data; - - public SubmitDocumentData() { - } - - public SubmitDocumentData data(String data) { - this.data = data; - return this; - } - - /** - * The document to be submitted, as indicated by the metadata fields 'dataFormat' and 'dataFormatVersion' - * @return data - **/ - @javax.annotation.Nullable - public String getData() { - return data; - } - - public void setData(String data) { - this.data = data; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SubmitDocumentData submitDocumentData = (SubmitDocumentData) o; - return Objects.equals(this.data, submitDocumentData.data); - } - - @Override - public int hashCode() { - return Objects.hash(data); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SubmitDocumentData {\n"); - sb.append(" data: ").append(toIndentedString(data)).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"); - - // 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 SubmitDocumentData - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!SubmitDocumentData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException(String.format("The required field(s) %s in SubmitDocumentData is not found in the empty JSON string", SubmitDocumentData.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonElement.getAsJsonObject().entrySet(); - // check to see if the JSON string contains additional fields - for (Map.Entry entry : entries) { - if (!SubmitDocumentData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SubmitDocumentData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) && !jsonObj.get("data").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `data` to be a primitive type in the JSON string but got `%s`", jsonObj.get("data").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!SubmitDocumentData.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'SubmitDocumentData' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(SubmitDocumentData.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, SubmitDocumentData value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public SubmitDocumentData read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of SubmitDocumentData given an JSON string - * - * @param jsonString JSON string - * @return An instance of SubmitDocumentData - * @throws IOException if the JSON string is invalid with respect to SubmitDocumentData - */ - public static SubmitDocumentData fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, SubmitDocumentData.class); - } - - /** - * Convert an instance of SubmitDocumentData to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} -