diff --git a/README.md b/README.md index 3dd961a..fa94ddf 100644 --- a/README.md +++ b/README.md @@ -61,39 +61,45 @@ Class | Method | HTTP request | Description *SubscriptionsApi* | [**delete_webhook_subscription**](docs/EInvoicing/V1/SubscriptionsApi.md#delete_webhook_subscription) | **DELETE** /webhooks/subscriptions/{subscription-id} | Unsubscribe from events *SubscriptionsApi* | [**get_webhook_subscription**](docs/EInvoicing/V1/SubscriptionsApi.md#get_webhook_subscription) | **GET** /webhooks/subscriptions/{subscription-id} | Get details of a subscription *SubscriptionsApi* | [**list_webhook_subscriptions**](docs/EInvoicing/V1/SubscriptionsApi.md#list_webhook_subscriptions) | **GET** /webhooks/subscriptions | List all subscriptions -*TradingPartnersApi* | [**batch_search_participants**](docs/EInvoicing/V1/TradingPartnersApi.md#batch_search_participants) | **POST** /trading-partners/batch-searches | Creates a batch search and performs a batch search in the directory for participants in the background. -*TradingPartnersApi* | [**download_batch_search_report**](docs/EInvoicing/V1/TradingPartnersApi.md#download_batch_search_report) | **GET** /trading-partners/batch-searches/{id}/$download-results | Download batch search results in a csv file. -*TradingPartnersApi* | [**get_batch_search_detail**](docs/EInvoicing/V1/TradingPartnersApi.md#get_batch_search_detail) | **GET** /trading-partners/batch-searches/{id} | Get the batch search details for a given id. -*TradingPartnersApi* | [**list_batch_searches**](docs/EInvoicing/V1/TradingPartnersApi.md#list_batch_searches) | **GET** /trading-partners/batch-searches | List all batch searches that were previously submitted. +*TaxIdentifiersApi* | [**tax_identifier_schema_by_country**](docs/EInvoicing/V1/TaxIdentifiersApi.md#tax_identifier_schema_by_country) | **GET** /tax-identifiers/schema | Returns the tax identifier request & response schema for a specific country. +*TaxIdentifiersApi* | [**validate_tax_identifier**](docs/EInvoicing/V1/TaxIdentifiersApi.md#validate_tax_identifier) | **POST** /tax-identifiers/validate | Validates a tax identifier. +*TradingPartnersApi* | [**batch_search_participants**](docs/EInvoicing/V1/TradingPartnersApi.md#batch_search_participants) | **POST** /trading-partners/batch-searches | Handles batch search requests by uploading a file containing search parameters. +*TradingPartnersApi* | [**create_trading_partner**](docs/EInvoicing/V1/TradingPartnersApi.md#create_trading_partner) | **POST** /trading-partners | Creates a new trading partner. +*TradingPartnersApi* | [**create_trading_partners_batch**](docs/EInvoicing/V1/TradingPartnersApi.md#create_trading_partners_batch) | **POST** /trading-partners/batch | Creates a batch of multiple trading partners. +*TradingPartnersApi* | [**delete_trading_partner**](docs/EInvoicing/V1/TradingPartnersApi.md#delete_trading_partner) | **DELETE** /trading-partners/{id} | Deletes a trading partner using ID. +*TradingPartnersApi* | [**download_batch_search_report**](docs/EInvoicing/V1/TradingPartnersApi.md#download_batch_search_report) | **GET** /trading-partners/batch-searches/{id}/$download-results | Downloads batch search results in a csv file. +*TradingPartnersApi* | [**get_batch_search_detail**](docs/EInvoicing/V1/TradingPartnersApi.md#get_batch_search_detail) | **GET** /trading-partners/batch-searches/{id} | Returns the batch search details using ID. +*TradingPartnersApi* | [**list_batch_searches**](docs/EInvoicing/V1/TradingPartnersApi.md#list_batch_searches) | **GET** /trading-partners/batch-searches | Lists all batch searches that were previously submitted. *TradingPartnersApi* | [**search_participants**](docs/EInvoicing/V1/TradingPartnersApi.md#search_participants) | **GET** /trading-partners | Returns a list of participants matching the input query. +*TradingPartnersApi* | [**update_trading_partner**](docs/EInvoicing/V1/TradingPartnersApi.md#update_trading_partner) | **PUT** /trading-partners/{id} | Updates a trading partner using ID. ### A1099 V2 API Documentation Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*CompaniesW9Api* | [**create_company**](docs/A1099/V2/CompaniesW9Api.md#create_company) | **POST** /w9/companies | Creates a new company -*CompaniesW9Api* | [**delete_company**](docs/A1099/V2/CompaniesW9Api.md#delete_company) | **DELETE** /w9/companies/{id} | Deletes a company +*CompaniesW9Api* | [**create_company**](docs/A1099/V2/CompaniesW9Api.md#create_company) | **POST** /w9/companies | Create a company +*CompaniesW9Api* | [**delete_company**](docs/A1099/V2/CompaniesW9Api.md#delete_company) | **DELETE** /w9/companies/{id} | Delete a company *CompaniesW9Api* | [**get_companies**](docs/A1099/V2/CompaniesW9Api.md#get_companies) | **GET** /w9/companies | List companies *CompaniesW9Api* | [**get_company**](docs/A1099/V2/CompaniesW9Api.md#get_company) | **GET** /w9/companies/{id} | Retrieve a company *CompaniesW9Api* | [**update_company**](docs/A1099/V2/CompaniesW9Api.md#update_company) | **PUT** /w9/companies/{id} | Update a company -*Forms1099Api* | [**bulk_upsert1099_forms**](docs/A1099/V2/Forms1099Api.md#bulk_upsert1099_forms) | **POST** /1099/forms/$bulk-upsert | Creates or updates multiple 1099 forms. -*Forms1099Api* | [**create1099_form**](docs/A1099/V2/Forms1099Api.md#create1099_form) | **POST** /1099/forms | Creates a 1099 form. -*Forms1099Api* | [**delete1099_form**](docs/A1099/V2/Forms1099Api.md#delete1099_form) | **DELETE** /1099/forms/{id} | Deletes a 1099 form. -*Forms1099Api* | [**get1099_form**](docs/A1099/V2/Forms1099Api.md#get1099_form) | **GET** /1099/forms/{id} | Retrieves a 1099 form. -*Forms1099Api* | [**get1099_form_pdf**](docs/A1099/V2/Forms1099Api.md#get1099_form_pdf) | **GET** /1099/forms/{id}/pdf | Retrieves the PDF file for a single 1099 by form id. -*Forms1099Api* | [**list1099_forms**](docs/A1099/V2/Forms1099Api.md#list1099_forms) | **GET** /1099/forms | Retrieves a list of 1099 forms based on query parameters. -*Forms1099Api* | [**update1099_form**](docs/A1099/V2/Forms1099Api.md#update1099_form) | **PUT** /1099/forms/{id} | Updates a 1099 form. +*Forms1099Api* | [**bulk_upsert1099_forms**](docs/A1099/V2/Forms1099Api.md#bulk_upsert1099_forms) | **POST** /1099/forms/$bulk-upsert | Create or update multiple 1099/1095/W2/1042S forms +*Forms1099Api* | [**create1099_form**](docs/A1099/V2/Forms1099Api.md#create1099_form) | **POST** /1099/forms | Create a 1099/1095/W2/1042S form +*Forms1099Api* | [**delete1099_form**](docs/A1099/V2/Forms1099Api.md#delete1099_form) | **DELETE** /1099/forms/{id} | Delete a 1099/1095/W2/1042S form +*Forms1099Api* | [**get1099_form**](docs/A1099/V2/Forms1099Api.md#get1099_form) | **GET** /1099/forms/{id} | Retrieve a 1099/1095/W2/1042S form +*Forms1099Api* | [**get1099_form_pdf**](docs/A1099/V2/Forms1099Api.md#get1099_form_pdf) | **GET** /1099/forms/{id}/pdf | Retrieve the PDF file for a 1099/1095/W2/1042S form +*Forms1099Api* | [**list1099_forms**](docs/A1099/V2/Forms1099Api.md#list1099_forms) | **GET** /1099/forms | List 1099/1095/W2/1042S forms +*Forms1099Api* | [**update1099_form**](docs/A1099/V2/Forms1099Api.md#update1099_form) | **PUT** /1099/forms/{id} | Update a 1099/1095/W2/1042S form *FormsW9Api* | [**create_w9_form**](docs/A1099/V2/FormsW9Api.md#create_w9_form) | **POST** /w9/forms | Create a W9/W4/W8 form -*FormsW9Api* | [**delete_w9_form**](docs/A1099/V2/FormsW9Api.md#delete_w9_form) | **DELETE** /w9/forms/{id} | Delete a form +*FormsW9Api* | [**delete_w9_form**](docs/A1099/V2/FormsW9Api.md#delete_w9_form) | **DELETE** /w9/forms/{id} | Delete a W9/W4/W8 form *FormsW9Api* | [**get_w9_form**](docs/A1099/V2/FormsW9Api.md#get_w9_form) | **GET** /w9/forms/{id} | Retrieve a W9/W4/W8 form -*FormsW9Api* | [**list_w9_forms**](docs/A1099/V2/FormsW9Api.md#list_w9_forms) | **GET** /w9/forms | List W9/W4/W8 forms. -*FormsW9Api* | [**send_w9_form_email**](docs/A1099/V2/FormsW9Api.md#send_w9_form_email) | **POST** /w9/forms/{id}/$send-email | Sends a W9 email request to a vendor/payee +*FormsW9Api* | [**list_w9_forms**](docs/A1099/V2/FormsW9Api.md#list_w9_forms) | **GET** /w9/forms | List W9/W4/W8 forms +*FormsW9Api* | [**send_w9_form_email**](docs/A1099/V2/FormsW9Api.md#send_w9_form_email) | **POST** /w9/forms/{id}/$send-email | Send an email to the vendor/payee requesting they fill out a W9/W4/W8 form *FormsW9Api* | [**update_w9_form**](docs/A1099/V2/FormsW9Api.md#update_w9_form) | **PUT** /w9/forms/{id} | Update a W9/W4/W8 form -*FormsW9Api* | [**upload_w9_files**](docs/A1099/V2/FormsW9Api.md#upload_w9_files) | **PUT** /w9/forms/{id}/attachment | Upload files for a W9/W4/W8 form +*FormsW9Api* | [**upload_w9_files**](docs/A1099/V2/FormsW9Api.md#upload_w9_files) | **POST** /w9/forms/{id}/attachment | Replace the PDF file for a W9/W4/W8 form *Issuers1099Api* | [**create_issuer**](docs/A1099/V2/Issuers1099Api.md#create_issuer) | **POST** /1099/issuers | Create an issuer *Issuers1099Api* | [**delete_issuer**](docs/A1099/V2/Issuers1099Api.md#delete_issuer) | **DELETE** /1099/issuers/{id} | Delete an issuer -*Issuers1099Api* | [**get_issuer**](docs/A1099/V2/Issuers1099Api.md#get_issuer) | **GET** /1099/issuers/{id} | Get an issuer +*Issuers1099Api* | [**get_issuer**](docs/A1099/V2/Issuers1099Api.md#get_issuer) | **GET** /1099/issuers/{id} | Retrieve an issuer *Issuers1099Api* | [**get_issuers**](docs/A1099/V2/Issuers1099Api.md#get_issuers) | **GET** /1099/issuers | List issuers *Issuers1099Api* | [**update_issuer**](docs/A1099/V2/Issuers1099Api.md#update_issuer) | **PUT** /1099/issuers/{id} | Update an issuer *Jobs1099Api* | [**get_job**](docs/A1099/V2/Jobs1099Api.md#get_job) | **GET** /1099/jobs/{id} | Retrieves information about the job @@ -104,22 +110,24 @@ Class | Method | HTTP request | Description ### EInvoicing V1 Model Documentation + - [models.Address](docs/EInvoicing/V1/Address.md) - [models.BadDownloadRequest](docs/EInvoicing/V1/BadDownloadRequest.md) - [models.BadRequest](docs/EInvoicing/V1/BadRequest.md) + - [models.BatchErrorDetail](docs/EInvoicing/V1/BatchErrorDetail.md) - [models.BatchSearch](docs/EInvoicing/V1/BatchSearch.md) - [models.BatchSearchListResponse](docs/EInvoicing/V1/BatchSearchListResponse.md) - [models.BatchSearchParticipants202Response](docs/EInvoicing/V1/BatchSearchParticipants202Response.md) - [models.ConditionalForField](docs/EInvoicing/V1/ConditionalForField.md) + - [models.Consents](docs/EInvoicing/V1/Consents.md) + - [models.CreateTradingPartner201Response](docs/EInvoicing/V1/CreateTradingPartner201Response.md) + - [models.CreateTradingPartnersBatch200Response](docs/EInvoicing/V1/CreateTradingPartnersBatch200Response.md) + - [models.CreateTradingPartnersBatch200ResponseValueInner](docs/EInvoicing/V1/CreateTradingPartnersBatch200ResponseValueInner.md) + - [models.CreateTradingPartnersBatchRequest](docs/EInvoicing/V1/CreateTradingPartnersBatchRequest.md) - [models.DataInputField](docs/EInvoicing/V1/DataInputField.md) - [models.DataInputFieldNotUsedFor](docs/EInvoicing/V1/DataInputFieldNotUsedFor.md) - [models.DataInputFieldOptionalFor](docs/EInvoicing/V1/DataInputFieldOptionalFor.md) - [models.DataInputFieldRequiredFor](docs/EInvoicing/V1/DataInputFieldRequiredFor.md) - [models.DataInputFieldsResponse](docs/EInvoicing/V1/DataInputFieldsResponse.md) - - [models.DirectorySearchResponse](docs/EInvoicing/V1/DirectorySearchResponse.md) - - [models.DirectorySearchResponseValueInner](docs/EInvoicing/V1/DirectorySearchResponseValueInner.md) - - [models.DirectorySearchResponseValueInnerAddressesInner](docs/EInvoicing/V1/DirectorySearchResponseValueInnerAddressesInner.md) - - [models.DirectorySearchResponseValueInnerIdentifiersInner](docs/EInvoicing/V1/DirectorySearchResponseValueInnerIdentifiersInner.md) - - [models.DirectorySearchResponseValueInnerSupportedDocumentTypesInner](docs/EInvoicing/V1/DirectorySearchResponseValueInnerSupportedDocumentTypesInner.md) - [models.DocumentFetch](docs/EInvoicing/V1/DocumentFetch.md) - [models.DocumentListResponse](docs/EInvoicing/V1/DocumentListResponse.md) - [models.DocumentStatusResponse](docs/EInvoicing/V1/DocumentStatusResponse.md) @@ -131,6 +139,7 @@ Class | Method | HTTP request | Description - [models.EventMessage](docs/EInvoicing/V1/EventMessage.md) - [models.EventPayload](docs/EInvoicing/V1/EventPayload.md) - [models.EventSubscription](docs/EInvoicing/V1/EventSubscription.md) + - [models.Extension](docs/EInvoicing/V1/Extension.md) - [models.FetchDocumentsRequest](docs/EInvoicing/V1/FetchDocumentsRequest.md) - [models.FetchDocumentsRequestDataInner](docs/EInvoicing/V1/FetchDocumentsRequestDataInner.md) - [models.FetchDocumentsRequestMetadata](docs/EInvoicing/V1/FetchDocumentsRequestMetadata.md) @@ -138,6 +147,7 @@ Class | Method | HTTP request | Description - [models.HmacSignature](docs/EInvoicing/V1/HmacSignature.md) - [models.HmacSignatureValue](docs/EInvoicing/V1/HmacSignatureValue.md) - [models.Id](docs/EInvoicing/V1/Id.md) + - [models.Identifier](docs/EInvoicing/V1/Identifier.md) - [models.InputDataFormats](docs/EInvoicing/V1/InputDataFormats.md) - [models.InternalServerError](docs/EInvoicing/V1/InternalServerError.md) - [models.Mandate](docs/EInvoicing/V1/Mandate.md) @@ -149,6 +159,7 @@ Class | Method | HTTP request | Description - [models.OutputDataFormats](docs/EInvoicing/V1/OutputDataFormats.md) - [models.Pagination](docs/EInvoicing/V1/Pagination.md) - [models.RequiredWhenField](docs/EInvoicing/V1/RequiredWhenField.md) + - [models.SearchParticipants200Response](docs/EInvoicing/V1/SearchParticipants200Response.md) - [models.Signature](docs/EInvoicing/V1/Signature.md) - [models.SignatureSignature](docs/EInvoicing/V1/SignatureSignature.md) - [models.SignatureValue](docs/EInvoicing/V1/SignatureValue.md) @@ -161,6 +172,14 @@ Class | Method | HTTP request | Description - [models.SubscriptionListResponse](docs/EInvoicing/V1/SubscriptionListResponse.md) - [models.SubscriptionRegistration](docs/EInvoicing/V1/SubscriptionRegistration.md) - [models.SuccessResponse](docs/EInvoicing/V1/SuccessResponse.md) + - [models.SupportedDocumentTypes](docs/EInvoicing/V1/SupportedDocumentTypes.md) + - [models.TaxIdentifierRequest](docs/EInvoicing/V1/TaxIdentifierRequest.md) + - [models.TaxIdentifierResponse](docs/EInvoicing/V1/TaxIdentifierResponse.md) + - [models.TaxIdentifierResponseValue](docs/EInvoicing/V1/TaxIdentifierResponseValue.md) + - [models.TaxIdentifierSchemaByCountry200Response](docs/EInvoicing/V1/TaxIdentifierSchemaByCountry200Response.md) + - [models.TradingPartner](docs/EInvoicing/V1/TradingPartner.md) + - [models.UpdateTradingPartner200Response](docs/EInvoicing/V1/UpdateTradingPartner200Response.md) + - [models.ValidationError](docs/EInvoicing/V1/ValidationError.md) - [models.WebhookInvocation](docs/EInvoicing/V1/WebhookInvocation.md) - [models.WebhooksErrorInfo](docs/EInvoicing/V1/WebhooksErrorInfo.md) - [models.WebhooksErrorResponse](docs/EInvoicing/V1/WebhooksErrorResponse.md) @@ -180,44 +199,53 @@ Class | Method | HTTP request | Description - [models.CompanyModel](docs/A1099/V2/CompanyModel.md) - [models.CompanyResponse](docs/A1099/V2/CompanyResponse.md) - [models.CompanyResponseModel](docs/A1099/V2/CompanyResponseModel.md) - - [models.CoveredIndividualReference](docs/A1099/V2/CoveredIndividualReference.md) + - [models.CoveredIndividualReferenceResponse](docs/A1099/V2/CoveredIndividualReferenceResponse.md) - [models.CoveredIndividualRequest](docs/A1099/V2/CoveredIndividualRequest.md) + - [models.Create1099Form201Response](docs/A1099/V2/Create1099Form201Response.md) + - [models.CreateW9Form201Response](docs/A1099/V2/CreateW9Form201Response.md) + - [models.CreateW9FormRequest](docs/A1099/V2/CreateW9FormRequest.md) - [models.Data](docs/A1099/V2/Data.md) - [models.ErrorModel](docs/A1099/V2/ErrorModel.md) - [models.ErrorResponse](docs/A1099/V2/ErrorResponse.md) - [models.ErrorResponseErrorsInner](docs/A1099/V2/ErrorResponseErrorsInner.md) - - [models.Form1095B](docs/A1099/V2/Form1095B.md) + - [models.Form1042SList](docs/A1099/V2/Form1042SList.md) + - [models.Form1042SListItem](docs/A1099/V2/Form1042SListItem.md) + - [models.Form1042SListItemResponse](docs/A1099/V2/Form1042SListItemResponse.md) + - [models.Form1042SRequest](docs/A1099/V2/Form1042SRequest.md) + - [models.Form1042SResponse](docs/A1099/V2/Form1042SResponse.md) - [models.Form1095BList](docs/A1099/V2/Form1095BList.md) - [models.Form1095BListItem](docs/A1099/V2/Form1095BListItem.md) + - [models.Form1095BListItemResponse](docs/A1099/V2/Form1095BListItemResponse.md) - [models.Form1095BRequest](docs/A1099/V2/Form1095BRequest.md) - - [models.Form1099Base](docs/A1099/V2/Form1099Base.md) + - [models.Form1099BaseResponse](docs/A1099/V2/Form1099BaseResponse.md) - [models.Form1099DivList](docs/A1099/V2/Form1099DivList.md) - [models.Form1099DivListItem](docs/A1099/V2/Form1099DivListItem.md) - [models.Form1099DivRequest](docs/A1099/V2/Form1099DivRequest.md) - [models.Form1099DivResponse](docs/A1099/V2/Form1099DivResponse.md) - - [models.Form1099K](docs/A1099/V2/Form1099K.md) - [models.Form1099KList](docs/A1099/V2/Form1099KList.md) - [models.Form1099KListItem](docs/A1099/V2/Form1099KListItem.md) + - [models.Form1099KListItemResponse](docs/A1099/V2/Form1099KListItemResponse.md) - [models.Form1099KRequest](docs/A1099/V2/Form1099KRequest.md) - - [models.Form1099List](docs/A1099/V2/Form1099List.md) - - [models.Form1099Misc](docs/A1099/V2/Form1099Misc.md) + - [models.Form1099ListResponse](docs/A1099/V2/Form1099ListResponse.md) + - [models.Form1099ListResponseValueInner](docs/A1099/V2/Form1099ListResponseValueInner.md) - [models.Form1099MiscList](docs/A1099/V2/Form1099MiscList.md) - [models.Form1099MiscListItem](docs/A1099/V2/Form1099MiscListItem.md) + - [models.Form1099MiscListItemResponse](docs/A1099/V2/Form1099MiscListItemResponse.md) - [models.Form1099MiscRequest](docs/A1099/V2/Form1099MiscRequest.md) - [models.Form1099MiscResponse](docs/A1099/V2/Form1099MiscResponse.md) - - [models.Form1099Nec](docs/A1099/V2/Form1099Nec.md) - [models.Form1099NecList](docs/A1099/V2/Form1099NecList.md) - [models.Form1099NecListItem](docs/A1099/V2/Form1099NecListItem.md) + - [models.Form1099NecListItemResponse](docs/A1099/V2/Form1099NecListItemResponse.md) - [models.Form1099NecRequest](docs/A1099/V2/Form1099NecRequest.md) - [models.Form1099NecResponse](docs/A1099/V2/Form1099NecResponse.md) - [models.Form1099ProccessResult](docs/A1099/V2/Form1099ProccessResult.md) - - [models.Form1099R](docs/A1099/V2/Form1099R.md) - [models.Form1099RList](docs/A1099/V2/Form1099RList.md) - [models.Form1099RListItem](docs/A1099/V2/Form1099RListItem.md) + - [models.Form1099RListItemResponse](docs/A1099/V2/Form1099RListItemResponse.md) - [models.Form1099RRequest](docs/A1099/V2/Form1099RRequest.md) - - [models.Form1099StatusDetail](docs/A1099/V2/Form1099StatusDetail.md) + - [models.Form1099StatusDetailResponse](docs/A1099/V2/Form1099StatusDetailResponse.md) - [models.FormRequestBase](docs/A1099/V2/FormRequestBase.md) - - [models.FormRequestCsvBase](docs/A1099/V2/FormRequestCsvBase.md) + - [models.FormRequestListItemBase](docs/A1099/V2/FormRequestListItemBase.md) - [models.FormResponseBase](docs/A1099/V2/FormResponseBase.md) - [models.FormSingleRequestBase](docs/A1099/V2/FormSingleRequestBase.md) - [models.Get1099Form200Response](docs/A1099/V2/Get1099Form200Response.md) @@ -225,7 +253,9 @@ Class | Method | HTTP request | Description - [models.ICreateForm1099Request](docs/A1099/V2/ICreateForm1099Request.md) - [models.IUpdateForm1099Request](docs/A1099/V2/IUpdateForm1099Request.md) - [models.IW9FormDataModelsOneOf](docs/A1099/V2/IW9FormDataModelsOneOf.md) - - [models.IncludedBase](docs/A1099/V2/IncludedBase.md) + - [models.IntermediaryOrFlowThrough](docs/A1099/V2/IntermediaryOrFlowThrough.md) + - [models.IntermediaryOrFlowThroughRequest](docs/A1099/V2/IntermediaryOrFlowThroughRequest.md) + - [models.IntermediaryOrFlowThroughResponse](docs/A1099/V2/IntermediaryOrFlowThroughResponse.md) - [models.IssuerCommand](docs/A1099/V2/IssuerCommand.md) - [models.IssuerResponse](docs/A1099/V2/IssuerResponse.md) - [models.JobResult](docs/A1099/V2/JobResult.md) @@ -234,26 +264,33 @@ Class | Method | HTTP request | Description - [models.PaginatedQueryResultModelCompanyResponse](docs/A1099/V2/PaginatedQueryResultModelCompanyResponse.md) - [models.PaginatedQueryResultModelIssuerResponse](docs/A1099/V2/PaginatedQueryResultModelIssuerResponse.md) - [models.PaginatedW9FormsModel](docs/A1099/V2/PaginatedW9FormsModel.md) + - [models.PrimaryWithholdingAgent](docs/A1099/V2/PrimaryWithholdingAgent.md) + - [models.PrimaryWithholdingAgentRequest](docs/A1099/V2/PrimaryWithholdingAgentRequest.md) + - [models.PrimaryWithholdingAgentResponse](docs/A1099/V2/PrimaryWithholdingAgentResponse.md) - [models.ProblemDetails](docs/A1099/V2/ProblemDetails.md) - - [models.StateAndLocalWithholding](docs/A1099/V2/StateAndLocalWithholding.md) - [models.StateAndLocalWithholdingRequest](docs/A1099/V2/StateAndLocalWithholdingRequest.md) - [models.StateAndLocalWithholdingResponse](docs/A1099/V2/StateAndLocalWithholdingResponse.md) - - [models.StateEfileStatusDetail](docs/A1099/V2/StateEfileStatusDetail.md) - - [models.StateEfileStatusDetailApp](docs/A1099/V2/StateEfileStatusDetailApp.md) + - [models.StateEfileStatusDetailResponse](docs/A1099/V2/StateEfileStatusDetailResponse.md) - [models.StatusDetail](docs/A1099/V2/StatusDetail.md) + - [models.SubstantialUsOwnerRequest](docs/A1099/V2/SubstantialUsOwnerRequest.md) - [models.SubstantialUsOwnerResponse](docs/A1099/V2/SubstantialUsOwnerResponse.md) - [models.Update1099Form200Response](docs/A1099/V2/Update1099Form200Response.md) - - [models.ValidationError](docs/A1099/V2/ValidationError.md) - - [models.ValidationErrorApp](docs/A1099/V2/ValidationErrorApp.md) + - [models.ValidationErrorResponse](docs/A1099/V2/ValidationErrorResponse.md) - [models.W4FormDataModel](docs/A1099/V2/W4FormDataModel.md) + - [models.W4FormRequest](docs/A1099/V2/W4FormRequest.md) - [models.W4FormResponse](docs/A1099/V2/W4FormResponse.md) + - [models.W8BenEFormRequest](docs/A1099/V2/W8BenEFormRequest.md) - [models.W8BenEFormResponse](docs/A1099/V2/W8BenEFormResponse.md) - [models.W8BenESubstantialUsOwnerDataModel](docs/A1099/V2/W8BenESubstantialUsOwnerDataModel.md) - [models.W8BenFormDataModel](docs/A1099/V2/W8BenFormDataModel.md) + - [models.W8BenFormRequest](docs/A1099/V2/W8BenFormRequest.md) - [models.W8BenFormResponse](docs/A1099/V2/W8BenFormResponse.md) - [models.W8BeneFormDataModel](docs/A1099/V2/W8BeneFormDataModel.md) - [models.W8ImyFormDataModel](docs/A1099/V2/W8ImyFormDataModel.md) + - [models.W8ImyFormRequest](docs/A1099/V2/W8ImyFormRequest.md) - [models.W8ImyFormResponse](docs/A1099/V2/W8ImyFormResponse.md) + - [models.W9FormBaseRequest](docs/A1099/V2/W9FormBaseRequest.md) - [models.W9FormBaseResponse](docs/A1099/V2/W9FormBaseResponse.md) - [models.W9FormDataModel](docs/A1099/V2/W9FormDataModel.md) + - [models.W9FormRequest](docs/A1099/V2/W9FormRequest.md) - [models.W9FormResponse](docs/A1099/V2/W9FormResponse.md) diff --git a/docs/A1099/V2/BulkUpsert1099FormsRequest.md b/docs/A1099/V2/BulkUpsert1099FormsRequest.md index d3a3fed..642e252 100644 --- a/docs/A1099/V2/BulkUpsert1099FormsRequest.md +++ b/docs/A1099/V2/BulkUpsert1099FormsRequest.md @@ -14,6 +14,7 @@ require 'avalara_sdk' AvalaraSdk::A1099::V2::BulkUpsert1099FormsRequest.openapi_one_of # => # [ +# :'Form1042SList', # :'Form1095BList', # :'Form1099DivList', # :'Form1099KList', @@ -33,7 +34,7 @@ Find the appropriate object from the `openapi_one_of` list and casts the data in require 'avalara_sdk' AvalaraSdk::A1099::V2::BulkUpsert1099FormsRequest.build(data) -# => # +# => # AvalaraSdk::A1099::V2::BulkUpsert1099FormsRequest.build(data_that_doesnt_match) # => nil @@ -47,6 +48,7 @@ AvalaraSdk::A1099::V2::BulkUpsert1099FormsRequest.build(data_that_doesnt_match) #### Return type +- `Form1042SList` - `Form1095BList` - `Form1099DivList` - `Form1099KList` diff --git a/docs/A1099/V2/CompaniesW9Api.md b/docs/A1099/V2/CompaniesW9Api.md index 5c6dd73..114dfe9 100644 --- a/docs/A1099/V2/CompaniesW9Api.md +++ b/docs/A1099/V2/CompaniesW9Api.md @@ -4,8 +4,8 @@ All URIs are relative to *https://api-ava1099.eta.sbx.us-east-1.aws.avalara.io/a | Method | HTTP request | Description | | ------ | ------------ | ----------- | -| [**create_company**](CompaniesW9Api.md#create_company) | **POST** /w9/companies | Creates a new company | -| [**delete_company**](CompaniesW9Api.md#delete_company) | **DELETE** /w9/companies/{id} | Deletes a company | +| [**create_company**](CompaniesW9Api.md#create_company) | **POST** /w9/companies | Create a company | +| [**delete_company**](CompaniesW9Api.md#delete_company) | **DELETE** /w9/companies/{id} | Delete a company | | [**get_companies**](CompaniesW9Api.md#get_companies) | **GET** /w9/companies | List companies | | [**get_company**](CompaniesW9Api.md#get_company) | **GET** /w9/companies/{id} | Retrieve a company | | [**update_company**](CompaniesW9Api.md#update_company) | **PUT** /w9/companies/{id} | Update a company | @@ -15,9 +15,9 @@ All URIs are relative to *https://api-ava1099.eta.sbx.us-east-1.aws.avalara.io/a > create_company(avalara_version, opts) -Creates a new company +Create a company -Creates a new company +Create a company. ### Examples @@ -37,15 +37,15 @@ end api_client = AvalaraSdk::ApiClient.new config api_instance = AvalaraSdk::A1099::V2::CompaniesW9Api.new api_client -avalara_version = '2.0' # String | API version +avalara_version = '2.0.0' # String | API version opts = { - x_correlation_id: 'd0e29cf5-55bc-44e6-9894-3e1cd2923e5a', # String | Unique correlation Id in a GUID format + x_correlation_id: '144f810d-5777-472b-b372-c1028d9a13ae', # String | Unique correlation Id in a GUID format x_avalara_client: '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/) . company_create_update_request_model: AvalaraSdk::A1099::V2::CompanyCreateUpdateRequestModel.new # CompanyCreateUpdateRequestModel | The company to create } begin - # Creates a new company + # Create a company result = api_instance.create_company(avalara_version, opts) p result rescue AvalaraSdk::ApiError => e @@ -61,7 +61,7 @@ This returns an Array which contains the response data, status code and headers. ```ruby begin - # Creates a new company + # Create a company data, status_code, headers = api_instance.create_company_with_http_info(avalara_version, opts) p status_code # => 2xx p headers # => { ... } @@ -98,9 +98,9 @@ end > delete_company(id, avalara_version, opts) -Deletes a company +Delete a company -Deletes a company +Delete a company. ### Examples @@ -121,14 +121,14 @@ api_client = AvalaraSdk::ApiClient.new config api_instance = AvalaraSdk::A1099::V2::CompaniesW9Api.new api_client id = 'id_example' # String | The company to delete -avalara_version = '2.0' # String | API version +avalara_version = '2.0.0' # String | API version opts = { - x_correlation_id: '713ec82b-b94e-4e2f-8b82-0cecc0abb124', # String | Unique correlation Id in a GUID format + x_correlation_id: 'db071c51-528f-4929-a031-523aa34002d1', # String | Unique correlation Id in a GUID format x_avalara_client: '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/) . } begin - # Deletes a company + # Delete a company api_instance.delete_company(id, avalara_version, opts) rescue AvalaraSdk::ApiError => e puts "Error when calling CompaniesW9Api->delete_company: #{e}" @@ -143,7 +143,7 @@ This returns an Array which contains the response data (`nil` in this case), sta ```ruby begin - # Deletes a company + # Delete a company data, status_code, headers = api_instance.delete_company_with_http_info(id, avalara_version, opts) p status_code # => 2xx p headers # => { ... } @@ -202,7 +202,7 @@ end api_client = AvalaraSdk::ApiClient.new config api_instance = AvalaraSdk::A1099::V2::CompaniesW9Api.new api_client -avalara_version = '2.0' # String | API version +avalara_version = '2.0.0' # String | API version opts = { filter: 'filter_example', # String | A filter statement to identify specific records to retrieve. For more information on filtering, see Filtering in REST. 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. @@ -210,7 +210,7 @@ opts = { order_by: 'order_by_example', # String | A comma separated list of sort statements in the format (fieldname) [ASC|DESC], for example id ASC. count: true, # Boolean | If true, return the global count of elements in the collection. count_only: true, # Boolean | If true, return ONLY the global count of elements in the collection. It only applies when count=true. - x_correlation_id: '38d61b75-2ccf-4a20-8fc0-6fc047805ec3', # String | Unique correlation Id in a GUID format + x_correlation_id: '7ad30f3a-b27d-440e-98da-516663741d89', # String | Unique correlation Id in a GUID format x_avalara_client: '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/) . } @@ -275,7 +275,7 @@ end Retrieve a company -Retrieve an existing company +Retrieve a company. ### Examples @@ -296,9 +296,9 @@ api_client = AvalaraSdk::ApiClient.new config api_instance = AvalaraSdk::A1099::V2::CompaniesW9Api.new api_client id = 'id_example' # String | Id of the company -avalara_version = '2.0' # String | API version +avalara_version = '2.0.0' # String | API version opts = { - x_correlation_id: 'dccf03ba-f1c1-4540-a0ab-3a642cb46223', # String | Unique correlation Id in a GUID format + x_correlation_id: '77521b27-805c-40b1-a6c8-3d6339acba99', # String | Unique correlation Id in a GUID format x_avalara_client: '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/) . } @@ -358,7 +358,7 @@ end Update a company -Update a company +Update a company. ### Examples @@ -379,9 +379,9 @@ api_client = AvalaraSdk::ApiClient.new config api_instance = AvalaraSdk::A1099::V2::CompaniesW9Api.new api_client id = 'id_example' # String | The ID of the company to update -avalara_version = '2.0' # String | API version +avalara_version = '2.0.0' # String | API version opts = { - x_correlation_id: 'e5197be7-4ab7-4f90-a190-c0a491ebb8e1', # String | Unique correlation Id in a GUID format + x_correlation_id: '9b982dee-5208-416e-8acf-84070e235acc', # String | Unique correlation Id in a GUID format x_avalara_client: '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/) . company_create_update_request_model: AvalaraSdk::A1099::V2::CompanyCreateUpdateRequestModel.new # CompanyCreateUpdateRequestModel | The updated company data } diff --git a/docs/A1099/V2/CoveredIndividualReferenceResponse.md b/docs/A1099/V2/CoveredIndividualReferenceResponse.md new file mode 100644 index 0000000..6a175c5 --- /dev/null +++ b/docs/A1099/V2/CoveredIndividualReferenceResponse.md @@ -0,0 +1,56 @@ +# AvalaraSdk::A1099::V2::CoveredIndividualReferenceResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Covered individual ID | [optional] | +| **first_name** | **String** | Covered individual's first name | [optional] | +| **middle_name** | **String** | Covered individual's middle name | [optional] | +| **last_name** | **String** | Covered individual's last name | [optional] | +| **name_suffix** | **String** | Covered individual's name suffix | [optional] | +| **tin** | **String** | Covered individual's TIN (SSN or ITIN) | [optional] | +| **birth_date** | **Time** | Covered individual's date of birth | [optional] | +| **covered_month0** | **Boolean** | Coverage indicator for all 12 months | [optional] | +| **covered_month1** | **Boolean** | Coverage indicator for January | [optional] | +| **covered_month2** | **Boolean** | Coverage indicator for February | [optional] | +| **covered_month3** | **Boolean** | Coverage indicator for March | [optional] | +| **covered_month4** | **Boolean** | Coverage indicator for April | [optional] | +| **covered_month5** | **Boolean** | Coverage indicator for May | [optional] | +| **covered_month6** | **Boolean** | Coverage indicator for June | [optional] | +| **covered_month7** | **Boolean** | Coverage indicator for July | [optional] | +| **covered_month8** | **Boolean** | Coverage indicator for August | [optional] | +| **covered_month9** | **Boolean** | Coverage indicator for September | [optional] | +| **covered_month10** | **Boolean** | Coverage indicator for October | [optional] | +| **covered_month11** | **Boolean** | Coverage indicator for November | [optional] | +| **covered_month12** | **Boolean** | Coverage indicator for December | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::CoveredIndividualReferenceResponse.new( + id: null, + first_name: null, + middle_name: null, + last_name: null, + name_suffix: null, + tin: null, + birth_date: null, + covered_month0: null, + covered_month1: null, + covered_month2: null, + covered_month3: null, + covered_month4: null, + covered_month5: null, + covered_month6: null, + covered_month7: null, + covered_month8: null, + covered_month9: null, + covered_month10: null, + covered_month11: null, + covered_month12: null +) +``` + diff --git a/docs/A1099/V2/CoveredIndividualRequest.md b/docs/A1099/V2/CoveredIndividualRequest.md index 55a2e72..ec40116 100644 --- a/docs/A1099/V2/CoveredIndividualRequest.md +++ b/docs/A1099/V2/CoveredIndividualRequest.md @@ -4,25 +4,25 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **first_name** | **String** | | [optional] | -| **middle_name** | **String** | | [optional] | -| **last_name** | **String** | | [optional] | -| **name_suffix** | **String** | | [optional] | -| **tin** | **String** | | [optional] | -| **birth_date** | **Time** | | [optional] | -| **covered_month_indicator0** | **Boolean** | | [optional] | -| **covered_month_indicator1** | **Boolean** | | [optional] | -| **covered_month_indicator2** | **Boolean** | | [optional] | -| **covered_month_indicator3** | **Boolean** | | [optional] | -| **covered_month_indicator4** | **Boolean** | | [optional] | -| **covered_month_indicator5** | **Boolean** | | [optional] | -| **covered_month_indicator6** | **Boolean** | | [optional] | -| **covered_month_indicator7** | **Boolean** | | [optional] | -| **covered_month_indicator8** | **Boolean** | | [optional] | -| **covered_month_indicator9** | **Boolean** | | [optional] | -| **covered_month_indicator10** | **Boolean** | | [optional] | -| **covered_month_indicator11** | **Boolean** | | [optional] | -| **covered_month_indicator12** | **Boolean** | | [optional] | +| **first_name** | **String** | Covered individual's first name | [optional] | +| **middle_name** | **String** | Covered individual's middle name | [optional] | +| **last_name** | **String** | Covered individual's last name | [optional] | +| **name_suffix** | **String** | Covered individual's name suffix | [optional] | +| **tin** | **String** | Covered individual's TIN (SSN or ITIN) | [optional] | +| **birth_date** | **Time** | Covered individual's date of birth | [optional] | +| **covered_month_indicator0** | **Boolean** | Coverage indicator for all 12 months | [optional] | +| **covered_month_indicator1** | **Boolean** | Coverage indicator for January | [optional] | +| **covered_month_indicator2** | **Boolean** | Coverage indicator for February | [optional] | +| **covered_month_indicator3** | **Boolean** | Coverage indicator for March | [optional] | +| **covered_month_indicator4** | **Boolean** | Coverage indicator for April | [optional] | +| **covered_month_indicator5** | **Boolean** | Coverage indicator for May | [optional] | +| **covered_month_indicator6** | **Boolean** | Coverage indicator for June | [optional] | +| **covered_month_indicator7** | **Boolean** | Coverage indicator for July | [optional] | +| **covered_month_indicator8** | **Boolean** | Coverage indicator for August | [optional] | +| **covered_month_indicator9** | **Boolean** | Coverage indicator for September | [optional] | +| **covered_month_indicator10** | **Boolean** | Coverage indicator for October | [optional] | +| **covered_month_indicator11** | **Boolean** | Coverage indicator for November | [optional] | +| **covered_month_indicator12** | **Boolean** | Coverage indicator for December | [optional] | ## Example diff --git a/docs/A1099/V2/Create1099Form201Response.md b/docs/A1099/V2/Create1099Form201Response.md new file mode 100644 index 0000000..7fbea15 --- /dev/null +++ b/docs/A1099/V2/Create1099Form201Response.md @@ -0,0 +1,59 @@ +# AvalaraSdk::A1099::V2::Create1099Form201Response + +## Class instance methods + +### `openapi_one_of` + +Returns the list of classes defined in oneOf. + +#### Example + +```ruby +require 'avalara_sdk' + +AvalaraSdk::A1099::V2::Create1099Form201Response.openapi_one_of +# => +# [ +# :'Form1042SListItemResponse', +# :'Form1095BListItemResponse', +# :'Form1099BaseResponse', +# :'Form1099KListItemResponse', +# :'Form1099MiscListItemResponse', +# :'Form1099NecListItemResponse', +# :'Form1099RListItemResponse' +# ] +``` + +### build + +Find the appropriate object from the `openapi_one_of` list and casts the data into it. + +#### Example + +```ruby +require 'avalara_sdk' + +AvalaraSdk::A1099::V2::Create1099Form201Response.build(data) +# => # + +AvalaraSdk::A1099::V2::Create1099Form201Response.build(data_that_doesnt_match) +# => nil +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | ----------- | +| **data** | **Mixed** | data to be matched against the list of oneOf items | + +#### Return type + +- `Form1042SListItemResponse` +- `Form1095BListItemResponse` +- `Form1099BaseResponse` +- `Form1099KListItemResponse` +- `Form1099MiscListItemResponse` +- `Form1099NecListItemResponse` +- `Form1099RListItemResponse` +- `nil` (if no type matches) + diff --git a/docs/A1099/V2/CreateW9Form201Response.md b/docs/A1099/V2/CreateW9Form201Response.md new file mode 100644 index 0000000..64ad2ab --- /dev/null +++ b/docs/A1099/V2/CreateW9Form201Response.md @@ -0,0 +1,55 @@ +# AvalaraSdk::A1099::V2::CreateW9Form201Response + +## Class instance methods + +### `openapi_one_of` + +Returns the list of classes defined in oneOf. + +#### Example + +```ruby +require 'avalara_sdk' + +AvalaraSdk::A1099::V2::CreateW9Form201Response.openapi_one_of +# => +# [ +# :'W4FormResponse', +# :'W8BenEFormResponse', +# :'W8BenFormResponse', +# :'W8ImyFormResponse', +# :'W9FormResponse' +# ] +``` + +### build + +Find the appropriate object from the `openapi_one_of` list and casts the data into it. + +#### Example + +```ruby +require 'avalara_sdk' + +AvalaraSdk::A1099::V2::CreateW9Form201Response.build(data) +# => # + +AvalaraSdk::A1099::V2::CreateW9Form201Response.build(data_that_doesnt_match) +# => nil +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | ----------- | +| **data** | **Mixed** | data to be matched against the list of oneOf items | + +#### Return type + +- `W4FormResponse` +- `W8BenEFormResponse` +- `W8BenFormResponse` +- `W8ImyFormResponse` +- `W9FormResponse` +- `nil` (if no type matches) + diff --git a/docs/A1099/V2/CreateW9FormRequest.md b/docs/A1099/V2/CreateW9FormRequest.md new file mode 100644 index 0000000..1e80180 --- /dev/null +++ b/docs/A1099/V2/CreateW9FormRequest.md @@ -0,0 +1,55 @@ +# AvalaraSdk::A1099::V2::CreateW9FormRequest + +## Class instance methods + +### `openapi_one_of` + +Returns the list of classes defined in oneOf. + +#### Example + +```ruby +require 'avalara_sdk' + +AvalaraSdk::A1099::V2::CreateW9FormRequest.openapi_one_of +# => +# [ +# :'W4FormRequest', +# :'W8BenEFormRequest', +# :'W8BenFormRequest', +# :'W8ImyFormRequest', +# :'W9FormRequest' +# ] +``` + +### build + +Find the appropriate object from the `openapi_one_of` list and casts the data into it. + +#### Example + +```ruby +require 'avalara_sdk' + +AvalaraSdk::A1099::V2::CreateW9FormRequest.build(data) +# => # + +AvalaraSdk::A1099::V2::CreateW9FormRequest.build(data_that_doesnt_match) +# => nil +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | ----------- | +| **data** | **Mixed** | data to be matched against the list of oneOf items | + +#### Return type + +- `W4FormRequest` +- `W8BenEFormRequest` +- `W8BenFormRequest` +- `W8ImyFormRequest` +- `W9FormRequest` +- `nil` (if no type matches) + diff --git a/docs/A1099/V2/Form1042SList.md b/docs/A1099/V2/Form1042SList.md new file mode 100644 index 0000000..53e58b9 --- /dev/null +++ b/docs/A1099/V2/Form1042SList.md @@ -0,0 +1,20 @@ +# AvalaraSdk::A1099::V2::Form1042SList + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **forms** | [**Array<Form1042SListItem>**](Form1042SListItem.md) | | [optional] | +| **form_type** | **String** | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::Form1042SList.new( + forms: null, + form_type: null +) +``` + diff --git a/docs/A1099/V2/Form1042SListItem.md b/docs/A1099/V2/Form1042SListItem.md new file mode 100644 index 0000000..8a5f493 --- /dev/null +++ b/docs/A1099/V2/Form1042SListItem.md @@ -0,0 +1,108 @@ +# AvalaraSdk::A1099::V2::Form1042SListItem + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **unique_form_id** | **String** | Unique form identifier | [optional] | +| **no_tin** | **Boolean** | No TIN indicator | [optional] | +| **recipient_date_of_birth** | **Time** | Recipient's date of birth | [optional] | +| **recipient_giin** | **String** | Recipient's GIIN (Global Intermediary Identification Number) | [optional] | +| **recipient_foreign_tin** | **String** | Recipient's foreign TIN | [optional] | +| **lob_code** | **String** | Limitation on benefits code | [optional] | +| **income_code** | **String** | Income code | [optional] | +| **gross_income** | **Float** | Gross income | [optional] | +| **withholding_indicator** | **String** | Withholding indicator | [optional] | +| **tax_country_code** | **String** | Country code | [optional] | +| **exemption_code_chap3** | **String** | Exemption code (Chapter 3) | [optional] | +| **exemption_code_chap4** | **String** | Exemption code (Chapter 4) | [optional] | +| **tax_rate_chap3** | **String** | Tax rate (Chapter 3) | [optional] | +| **withholding_allowance** | **Float** | Withholding allowance | [optional] | +| **federal_tax_withheld** | **Float** | Federal tax withheld | [optional] | +| **tax_not_deposited_indicator** | **Boolean** | Tax not deposited indicator | [optional] | +| **academic_indicator** | **Boolean** | Academic indicator | [optional] | +| **tax_withheld_other_agents** | **Float** | Tax withheld by other agents | [optional] | +| **amount_repaid** | **Float** | Amount repaid to recipient | [optional] | +| **tax_paid_agent** | **Float** | Tax paid by withholding agent | [optional] | +| **chap3_status_code** | **String** | Chapter 3 status code | [optional] | +| **chap4_status_code** | **String** | Chapter 4 status code | [optional] | +| **primary_withholding_agent** | [**PrimaryWithholdingAgent**](PrimaryWithholdingAgent.md) | Primary withholding agent information | [optional] | +| **intermediary_or_flow_through** | [**IntermediaryOrFlowThrough**](IntermediaryOrFlowThrough.md) | Intermediary or flow-through entity information | [optional] | +| **issuer_id** | **String** | Issuer ID | [optional] | +| **reference_id** | **String** | Reference ID | [optional] | +| **recipient_tin** | **String** | Recipient Tax ID Number | [optional] | +| **recipient_name** | **String** | Recipient name | | +| **tin_type** | **String** | Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN | [optional] | +| **recipient_second_name** | **String** | Recipient second name | [optional] | +| **address** | **String** | Address | | +| **address2** | **String** | Address line 2 | [optional] | +| **city** | **String** | City | | +| **state** | **String** | US state. Required if CountryCode is \"US\". | [optional] | +| **zip** | **String** | Zip/postal code | [optional] | +| **recipient_email** | **String** | Recipient email address | [optional] | +| **account_number** | **String** | Account number | [optional] | +| **office_code** | **String** | Office code | [optional] | +| **recipient_non_us_province** | **String** | Foreign province | [optional] | +| **country_code** | **String** | Country code, as defined at https://www.irs.gov/e-file-providers/country-codes | | +| **federal_e_file** | **Boolean** | Boolean indicating that federal e-filing should be scheduled for this form | [optional] | +| **postal_mail** | **Boolean** | Boolean indicating that postal mailing to the recipient should be scheduled for this form | [optional] | +| **state_e_file** | **Boolean** | Boolean indicating that state e-filing should be scheduled for this form | [optional] | +| **tin_match** | **Boolean** | Boolean indicating that TIN Matching should be scheduled for this form | [optional] | +| **address_verification** | **Boolean** | Boolean indicating that address verification should be scheduled for this form | [optional] | +| **state_and_local_withholding** | [**StateAndLocalWithholdingRequest**](StateAndLocalWithholdingRequest.md) | State and local withholding information | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::Form1042SListItem.new( + unique_form_id: null, + no_tin: null, + recipient_date_of_birth: null, + recipient_giin: null, + recipient_foreign_tin: null, + lob_code: null, + income_code: null, + gross_income: null, + withholding_indicator: null, + tax_country_code: null, + exemption_code_chap3: null, + exemption_code_chap4: null, + tax_rate_chap3: null, + withholding_allowance: null, + federal_tax_withheld: null, + tax_not_deposited_indicator: null, + academic_indicator: null, + tax_withheld_other_agents: null, + amount_repaid: null, + tax_paid_agent: null, + chap3_status_code: null, + chap4_status_code: null, + primary_withholding_agent: null, + intermediary_or_flow_through: null, + issuer_id: null, + reference_id: null, + recipient_tin: null, + recipient_name: null, + tin_type: EIN, + recipient_second_name: null, + address: null, + address2: null, + city: null, + state: null, + zip: null, + recipient_email: null, + account_number: null, + office_code: null, + recipient_non_us_province: null, + country_code: null, + federal_e_file: null, + postal_mail: null, + state_e_file: null, + tin_match: null, + address_verification: null, + state_and_local_withholding: null +) +``` + diff --git a/docs/A1099/V2/Form1042SListItemResponse.md b/docs/A1099/V2/Form1042SListItemResponse.md new file mode 100644 index 0000000..e6606bd --- /dev/null +++ b/docs/A1099/V2/Form1042SListItemResponse.md @@ -0,0 +1,130 @@ +# AvalaraSdk::A1099::V2::Form1042SListItemResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **unique_form_id** | **String** | Unique form identifier | [optional] | +| **no_tin** | **Boolean** | No TIN indicator | [optional] | +| **recipient_date_of_birth** | **Time** | Recipient's date of birth | [optional] | +| **recipient_giin** | **String** | Recipient's GIIN (Global Intermediary Identification Number) | [optional] | +| **recipient_foreign_tin** | **String** | Recipient's foreign TIN | [optional] | +| **lob_code** | **String** | Limitation on benefits code | [optional] | +| **income_code** | **String** | Income code | [optional] | +| **gross_income** | **Float** | Gross income | [optional] | +| **withholding_indicator** | **String** | Withholding indicator | [optional] | +| **tax_country_code** | **String** | Country code | [optional] | +| **exemption_code_chap3** | **String** | Exemption code (Chapter 3) | [optional] | +| **exemption_code_chap4** | **String** | Exemption code (Chapter 4) | [optional] | +| **tax_rate_chap3** | **String** | Tax rate (Chapter 3) | [optional] | +| **withholding_allowance** | **Float** | Withholding allowance | [optional] | +| **federal_tax_withheld** | **Float** | Federal tax withheld | [optional] | +| **tax_not_deposited_indicator** | **Boolean** | Tax not deposited indicator | [optional] | +| **academic_indicator** | **Boolean** | Academic indicator | [optional] | +| **tax_withheld_other_agents** | **Float** | Tax withheld by other agents | [optional] | +| **amount_repaid** | **Float** | Amount repaid to recipient | [optional] | +| **tax_paid_agent** | **Float** | Tax paid by withholding agent | [optional] | +| **chap3_status_code** | **String** | Chapter 3 status code | [optional] | +| **chap4_status_code** | **String** | Chapter 4 status code | [optional] | +| **primary_withholding_agent** | [**PrimaryWithholdingAgentResponse**](PrimaryWithholdingAgentResponse.md) | Primary withholding agent information | [optional] | +| **intermediary_or_flow_through** | [**IntermediaryOrFlowThroughResponse**](IntermediaryOrFlowThroughResponse.md) | Intermediary or flow-through entity information | [optional] | +| **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 | | +| **issuer_id** | **Integer** | Issuer ID | | +| **issuer_reference_id** | **String** | Issuer Reference ID | [optional] | +| **issuer_tin** | **String** | Issuer TIN | [optional] | +| **tax_year** | **Integer** | Tax year | [optional] | +| **federal_efile** | **Boolean** | Boolean indicating that federal e-filing has been scheduled for this form | | +| **federal_efile_status** | [**Form1099StatusDetailResponse**](Form1099StatusDetailResponse.md) | Federal e-file status | [optional][readonly] | +| **state_efile** | **Boolean** | Boolean indicating that state e-filing has been scheduled for this form | | +| **state_efile_status** | [**Array<StateEfileStatusDetailResponse>**](StateEfileStatusDetailResponse.md) | State e-file status | [optional][readonly] | +| **postal_mail** | **Boolean** | Boolean indicating that postal mailing to the recipient has been scheduled for this form | | +| **postal_mail_status** | [**Form1099StatusDetailResponse**](Form1099StatusDetailResponse.md) | Postal mail to recipient status | [optional][readonly] | +| **tin_match** | **Boolean** | Boolean indicating that TIN Matching has been scheduled for this form | | +| **tin_match_status** | [**Form1099StatusDetailResponse**](Form1099StatusDetailResponse.md) | TIN Match status | [optional][readonly] | +| **address_verification** | **Boolean** | Boolean indicating that address verification has been scheduled for this form | | +| **address_verification_status** | [**Form1099StatusDetailResponse**](Form1099StatusDetailResponse.md) | Address verification status | [optional][readonly] | +| **reference_id** | **String** | Reference ID | [optional] | +| **email** | **String** | Recipient email address | [optional] | +| **tin_type** | **String** | Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN | [optional] | +| **tin** | **String** | Recipient Tax ID Number | [optional] | +| **recipient_name** | **String** | Recipient name | [optional] | +| **recipient_second_name** | **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] | +| **foreign_province** | **String** | Foreign province | [optional] | +| **country_code** | **String** | Country code, as defined at https://www.irs.gov/e-file-providers/country-codes | [optional] | +| **validation_errors** | [**Array<ValidationErrorResponse>**](ValidationErrorResponse.md) | Validation errors | [optional][readonly] | +| **created_at** | **Time** | Creation time | [optional][readonly] | +| **updated_at** | **Time** | Update time | [optional][readonly] | +| **state_and_local_withholding** | [**StateAndLocalWithholdingResponse**](StateAndLocalWithholdingResponse.md) | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::Form1042SListItemResponse.new( + unique_form_id: 1234567890, + no_tin: null, + recipient_date_of_birth: null, + recipient_giin: null, + recipient_foreign_tin: GH48-827573, + lob_code: null, + income_code: null, + gross_income: 0, + withholding_indicator: null, + tax_country_code: null, + exemption_code_chap3: null, + exemption_code_chap4: null, + tax_rate_chap3: null, + withholding_allowance: null, + federal_tax_withheld: null, + tax_not_deposited_indicator: null, + academic_indicator: null, + tax_withheld_other_agents: null, + amount_repaid: null, + tax_paid_agent: null, + chap3_status_code: null, + chap4_status_code: null, + primary_withholding_agent: null, + intermediary_or_flow_through: null, + id: 123456789, + type: 1099-NEC, + issuer_id: 987654321, + issuer_reference_id: R-3898734, + issuer_tin: 59-387274, + tax_year: 2024, + federal_efile: false, + federal_efile_status: null, + state_efile: false, + state_efile_status: null, + postal_mail: false, + postal_mail_status: null, + tin_match: false, + tin_match_status: null, + address_verification: false, + address_verification_status: null, + reference_id: 1891810-9819891, + email: roadrunner@acmecorp.com, + tin_type: null, + tin: null, + recipient_name: null, + recipient_second_name: null, + address: 1234 Meep Meep Blvd, + address2: null, + city: Tucson, + state: AZ, + zip: 35004, + foreign_province: , + country_code: US, + validation_errors: null, + created_at: 2025-07-29T15:47:39.396860Z, + updated_at: 2025-07-29T15:47:39.396860500Z, + state_and_local_withholding: null +) +``` + diff --git a/docs/A1099/V2/Form1042SRequest.md b/docs/A1099/V2/Form1042SRequest.md new file mode 100644 index 0000000..3cbf5f4 --- /dev/null +++ b/docs/A1099/V2/Form1042SRequest.md @@ -0,0 +1,110 @@ +# AvalaraSdk::A1099::V2::Form1042SRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **unique_form_id** | **String** | Unique form identifier | [optional] | +| **no_tin** | **Boolean** | No TIN indicator | [optional] | +| **recipient_date_of_birth** | **Time** | Recipient's date of birth | [optional] | +| **recipient_giin** | **String** | Recipient's GIIN (Global Intermediary Identification Number) | [optional] | +| **recipient_foreign_tin** | **String** | Recipient's foreign TIN | [optional] | +| **lob_code** | **String** | Limitation on benefits code | [optional] | +| **income_code** | **String** | Income code | [optional] | +| **gross_income** | **Float** | Gross income | [optional] | +| **withholding_indicator** | **String** | Withholding indicator | [optional] | +| **tax_country_code** | **String** | Country code | [optional] | +| **exemption_code_chap3** | **String** | Exemption code (Chapter 3) | [optional] | +| **exemption_code_chap4** | **String** | Exemption code (Chapter 4) | [optional] | +| **tax_rate_chap3** | **String** | Tax rate (Chapter 3) | [optional] | +| **withholding_allowance** | **Float** | Withholding allowance | [optional] | +| **federal_tax_withheld** | **Float** | Federal tax withheld | [optional] | +| **tax_not_deposited_indicator** | **Boolean** | Tax not deposited indicator | [optional] | +| **academic_indicator** | **Boolean** | Academic indicator | [optional] | +| **tax_withheld_other_agents** | **Float** | Tax withheld by other agents | [optional] | +| **amount_repaid** | **Float** | Amount repaid to recipient | [optional] | +| **tax_paid_agent** | **Float** | Tax paid by withholding agent | [optional] | +| **chap3_status_code** | **String** | Chapter 3 status code | [optional] | +| **chap4_status_code** | **String** | Chapter 4 status code | [optional] | +| **primary_withholding_agent** | [**PrimaryWithholdingAgentRequest**](PrimaryWithholdingAgentRequest.md) | Primary withholding agent information | [optional] | +| **intermediary_or_flow_through** | [**IntermediaryOrFlowThroughRequest**](IntermediaryOrFlowThroughRequest.md) | Intermediary or flow-through entity information | [optional] | +| **state_and_local_withholding** | [**StateAndLocalWithholdingRequest**](StateAndLocalWithholdingRequest.md) | State and local withholding information | [optional] | +| **type** | **String** | | [optional] | +| **issuer_id** | **String** | Issuer ID | [optional] | +| **reference_id** | **String** | Reference ID | [optional] | +| **recipient_tin** | **String** | Recipient Tax ID Number | [optional] | +| **recipient_name** | **String** | Recipient name | | +| **tin_type** | **String** | Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN | [optional] | +| **recipient_second_name** | **String** | Recipient second name | [optional] | +| **address** | **String** | Address | | +| **address2** | **String** | Address line 2 | [optional] | +| **city** | **String** | City | | +| **state** | **String** | US state. Required if CountryCode is \"US\". | [optional] | +| **zip** | **String** | Zip/postal code | [optional] | +| **recipient_email** | **String** | Recipient email address | [optional] | +| **account_number** | **String** | Account number | [optional] | +| **office_code** | **String** | Office code | [optional] | +| **recipient_non_us_province** | **String** | Foreign province | [optional] | +| **country_code** | **String** | Country code, as defined at https://www.irs.gov/e-file-providers/country-codes | | +| **federal_e_file** | **Boolean** | Boolean indicating that federal e-filing should be scheduled for this form | [optional] | +| **postal_mail** | **Boolean** | Boolean indicating that postal mailing to the recipient should be scheduled for this form | [optional] | +| **state_e_file** | **Boolean** | Boolean indicating that state e-filing should be scheduled for this form | [optional] | +| **tin_match** | **Boolean** | Boolean indicating that TIN Matching should be scheduled for this form | [optional] | +| **address_verification** | **Boolean** | Boolean indicating that address verification should be scheduled for this form | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::Form1042SRequest.new( + unique_form_id: null, + no_tin: null, + recipient_date_of_birth: null, + recipient_giin: null, + recipient_foreign_tin: null, + lob_code: null, + income_code: null, + gross_income: null, + withholding_indicator: null, + tax_country_code: null, + exemption_code_chap3: null, + exemption_code_chap4: null, + tax_rate_chap3: null, + withholding_allowance: null, + federal_tax_withheld: null, + tax_not_deposited_indicator: null, + academic_indicator: null, + tax_withheld_other_agents: null, + amount_repaid: null, + tax_paid_agent: null, + chap3_status_code: null, + chap4_status_code: null, + primary_withholding_agent: null, + intermediary_or_flow_through: null, + state_and_local_withholding: null, + type: 1099-NEC, + issuer_id: null, + reference_id: null, + recipient_tin: null, + recipient_name: null, + tin_type: EIN, + recipient_second_name: null, + address: null, + address2: null, + city: null, + state: null, + zip: null, + recipient_email: null, + account_number: null, + office_code: null, + recipient_non_us_province: null, + country_code: null, + federal_e_file: null, + postal_mail: null, + state_e_file: null, + tin_match: null, + address_verification: null +) +``` + diff --git a/docs/A1099/V2/Form1042SResponse.md b/docs/A1099/V2/Form1042SResponse.md new file mode 100644 index 0000000..b66ff36 --- /dev/null +++ b/docs/A1099/V2/Form1042SResponse.md @@ -0,0 +1,88 @@ +# AvalaraSdk::A1099::V2::Form1042SResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **type** | **String** | | [optional][readonly] | +| **created_at** | **Time** | | [optional] | +| **updated_at** | **Time** | | [optional] | +| **user_id** | **String** | | [optional] | +| **state_and_local_withholding** | [**StateAndLocalWithholdingResponse**](StateAndLocalWithholdingResponse.md) | | [optional] | +| **tin_type** | **String** | | [optional] | +| **id** | **String** | | [optional] | +| **issuer_id** | **String** | | [optional] | +| **issuer_reference_id** | **String** | | [optional] | +| **issuer_tin** | **String** | | [optional] | +| **tax_year** | **Integer** | | [optional] | +| **reference_id** | **String** | | [optional] | +| **recipient_name** | **String** | | [optional] | +| **recipient_tin** | **String** | | [optional] | +| **recipient_second_name** | **String** | | [optional] | +| **address** | **String** | | [optional] | +| **address2** | **String** | | [optional] | +| **city** | **String** | | [optional] | +| **state** | **String** | | [optional] | +| **zip** | **String** | | [optional] | +| **recipient_email** | **String** | | [optional] | +| **account_number** | **String** | | [optional] | +| **office_code** | **String** | | [optional] | +| **recipient_non_us_province** | **String** | | [optional] | +| **country_code** | **String** | | [optional] | +| **federal_e_file** | **Boolean** | | [optional] | +| **postal_mail** | **Boolean** | | [optional] | +| **state_e_file** | **Boolean** | | [optional] | +| **tin_match** | **Boolean** | | [optional] | +| **address_verification** | **Boolean** | | [optional] | +| **federal_efile_status** | [**StatusDetail**](StatusDetail.md) | | [optional] | +| **state_efile_status** | [**Array<StateEfileStatusDetailResponse>**](StateEfileStatusDetailResponse.md) | | [optional] | +| **postal_mail_status** | [**StatusDetail**](StatusDetail.md) | | [optional] | +| **tin_match_status** | [**StatusDetail**](StatusDetail.md) | | [optional] | +| **address_verification_status** | [**StatusDetail**](StatusDetail.md) | | [optional] | +| **validation_errors** | [**Array<ValidationErrorResponse>**](ValidationErrorResponse.md) | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::Form1042SResponse.new( + type: 1099-NEC, + created_at: null, + updated_at: null, + user_id: null, + state_and_local_withholding: null, + tin_type: EIN, + id: null, + issuer_id: null, + issuer_reference_id: null, + issuer_tin: null, + tax_year: null, + reference_id: null, + recipient_name: null, + recipient_tin: null, + recipient_second_name: null, + address: null, + address2: null, + city: null, + state: null, + zip: null, + recipient_email: null, + account_number: null, + office_code: null, + recipient_non_us_province: null, + country_code: null, + federal_e_file: null, + postal_mail: null, + state_e_file: null, + tin_match: null, + address_verification: null, + federal_efile_status: null, + state_efile_status: null, + postal_mail_status: null, + tin_match_status: null, + address_verification_status: null, + validation_errors: null +) +``` + diff --git a/docs/A1099/V2/Form1095BListItem.md b/docs/A1099/V2/Form1095BListItem.md index 77ab089..ff0f28b 100644 --- a/docs/A1099/V2/Form1095BListItem.md +++ b/docs/A1099/V2/Form1095BListItem.md @@ -4,35 +4,35 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **employee_first_name** | **String** | | [optional] | -| **employee_middle_name** | **String** | | [optional] | -| **employee_last_name** | **String** | | [optional] | -| **employee_name_suffix** | **String** | | [optional] | -| **employee_date_of_birth** | **Time** | | [optional] | -| **origin_of_health_coverage_code** | **String** | | [optional] | -| **covered_individuals** | [**Array<CoveredIndividualRequest>**](CoveredIndividualRequest.md) | | [optional] | -| **issuer_id** | **String** | | [optional] | -| **reference_id** | **String** | | [optional] | -| **recipient_name** | **String** | | [optional] | -| **recipient_tin** | **String** | | [optional] | -| **tin_type** | **String** | | [optional] | -| **recipient_second_name** | **String** | | [optional] | -| **address** | **String** | | [optional] | -| **address2** | **String** | | [optional] | -| **city** | **String** | | [optional] | -| **state** | **String** | | [optional] | -| **zip** | **String** | | [optional] | -| **recipient_email** | **String** | | [optional] | -| **account_number** | **String** | | [optional] | -| **office_code** | **String** | | [optional] | -| **recipient_non_us_province** | **String** | | [optional] | -| **country_code** | **String** | | [optional] | -| **federal_e_file** | **Boolean** | | [optional] | -| **postal_mail** | **Boolean** | | [optional] | -| **state_e_file** | **Boolean** | | [optional] | -| **tin_match** | **Boolean** | | [optional] | -| **address_verification** | **Boolean** | | [optional] | -| **state_and_local_withholding** | [**StateAndLocalWithholdingRequest**](StateAndLocalWithholdingRequest.md) | | [optional] | +| **employee_first_name** | **String** | Employee's first name | [optional] | +| **employee_middle_name** | **String** | Employee's middle name | [optional] | +| **employee_last_name** | **String** | Employee's last name | [optional] | +| **employee_name_suffix** | **String** | Employee's name suffix | [optional] | +| **employee_date_of_birth** | **Time** | Employee's date of birth | [optional] | +| **origin_of_health_coverage_code** | **String** | Origin of health coverage code | [optional] | +| **covered_individuals** | [**Array<CoveredIndividualRequest>**](CoveredIndividualRequest.md) | Covered individuals information | [optional] | +| **issuer_id** | **String** | Issuer ID | [optional] | +| **reference_id** | **String** | Reference ID | [optional] | +| **recipient_tin** | **String** | Recipient Tax ID Number | [optional] | +| **recipient_name** | **String** | Recipient name | | +| **tin_type** | **String** | Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN | [optional] | +| **recipient_second_name** | **String** | Recipient second name | [optional] | +| **address** | **String** | Address | | +| **address2** | **String** | Address line 2 | [optional] | +| **city** | **String** | City | | +| **state** | **String** | US state. Required if CountryCode is \"US\". | [optional] | +| **zip** | **String** | Zip/postal code | [optional] | +| **recipient_email** | **String** | Recipient email address | [optional] | +| **account_number** | **String** | Account number | [optional] | +| **office_code** | **String** | Office code | [optional] | +| **recipient_non_us_province** | **String** | Foreign province | [optional] | +| **country_code** | **String** | Country code, as defined at https://www.irs.gov/e-file-providers/country-codes | | +| **federal_e_file** | **Boolean** | Boolean indicating that federal e-filing should be scheduled for this form | [optional] | +| **postal_mail** | **Boolean** | Boolean indicating that postal mailing to the recipient should be scheduled for this form | [optional] | +| **state_e_file** | **Boolean** | Boolean indicating that state e-filing should be scheduled for this form | [optional] | +| **tin_match** | **Boolean** | Boolean indicating that TIN Matching should be scheduled for this form | [optional] | +| **address_verification** | **Boolean** | Boolean indicating that address verification should be scheduled for this form | [optional] | +| **state_and_local_withholding** | [**StateAndLocalWithholdingRequest**](StateAndLocalWithholdingRequest.md) | State and local withholding information | [optional] | ## Example @@ -45,12 +45,12 @@ instance = AvalaraSdk::A1099::V2::Form1095BListItem.new( employee_last_name: null, employee_name_suffix: null, employee_date_of_birth: null, - origin_of_health_coverage_code: SmallBusinessHealthOptionsProgram, + origin_of_health_coverage_code: A, covered_individuals: null, issuer_id: null, reference_id: null, - recipient_name: null, recipient_tin: null, + recipient_name: null, tin_type: EIN, recipient_second_name: null, address: null, diff --git a/docs/A1099/V2/Form1095BListItemResponse.md b/docs/A1099/V2/Form1095BListItemResponse.md new file mode 100644 index 0000000..772e852 --- /dev/null +++ b/docs/A1099/V2/Form1095BListItemResponse.md @@ -0,0 +1,86 @@ +# AvalaraSdk::A1099::V2::Form1095BListItemResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **origin_of_health_coverage_code** | **String** | Origin of health coverage code | [optional] | +| **covered_individuals** | [**Array<CoveredIndividualReferenceResponse>**](CoveredIndividualReferenceResponse.md) | Covered individuals information | [optional] | +| **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 | | +| **issuer_id** | **Integer** | Issuer ID | | +| **issuer_reference_id** | **String** | Issuer Reference ID | [optional] | +| **issuer_tin** | **String** | Issuer TIN | [optional] | +| **tax_year** | **Integer** | Tax year | [optional] | +| **federal_efile** | **Boolean** | Boolean indicating that federal e-filing has been scheduled for this form | | +| **federal_efile_status** | [**Form1099StatusDetailResponse**](Form1099StatusDetailResponse.md) | Federal e-file status | [optional][readonly] | +| **state_efile** | **Boolean** | Boolean indicating that state e-filing has been scheduled for this form | | +| **state_efile_status** | [**Array<StateEfileStatusDetailResponse>**](StateEfileStatusDetailResponse.md) | State e-file status | [optional][readonly] | +| **postal_mail** | **Boolean** | Boolean indicating that postal mailing to the recipient has been scheduled for this form | | +| **postal_mail_status** | [**Form1099StatusDetailResponse**](Form1099StatusDetailResponse.md) | Postal mail to recipient status | [optional][readonly] | +| **tin_match** | **Boolean** | Boolean indicating that TIN Matching has been scheduled for this form | | +| **tin_match_status** | [**Form1099StatusDetailResponse**](Form1099StatusDetailResponse.md) | TIN Match status | [optional][readonly] | +| **address_verification** | **Boolean** | Boolean indicating that address verification has been scheduled for this form | | +| **address_verification_status** | [**Form1099StatusDetailResponse**](Form1099StatusDetailResponse.md) | Address verification status | [optional][readonly] | +| **reference_id** | **String** | Reference ID | [optional] | +| **email** | **String** | Recipient email address | [optional] | +| **tin_type** | **String** | Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN | [optional] | +| **tin** | **String** | Recipient Tax ID Number | [optional] | +| **recipient_name** | **String** | Recipient name | [optional] | +| **recipient_second_name** | **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] | +| **foreign_province** | **String** | Foreign province | [optional] | +| **country_code** | **String** | Country code, as defined at https://www.irs.gov/e-file-providers/country-codes | [optional] | +| **validation_errors** | [**Array<ValidationErrorResponse>**](ValidationErrorResponse.md) | Validation errors | [optional][readonly] | +| **created_at** | **Time** | Creation time | [optional][readonly] | +| **updated_at** | **Time** | Update time | [optional][readonly] | +| **state_and_local_withholding** | [**StateAndLocalWithholdingResponse**](StateAndLocalWithholdingResponse.md) | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::Form1095BListItemResponse.new( + origin_of_health_coverage_code: B, + covered_individuals: null, + id: 123456789, + type: 1099-NEC, + issuer_id: 987654321, + issuer_reference_id: R-3898734, + issuer_tin: 59-387274, + tax_year: 2024, + federal_efile: false, + federal_efile_status: null, + state_efile: false, + state_efile_status: null, + postal_mail: false, + postal_mail_status: null, + tin_match: false, + tin_match_status: null, + address_verification: false, + address_verification_status: null, + reference_id: 1891810-9819891, + email: roadrunner@acmecorp.com, + tin_type: null, + tin: null, + recipient_name: null, + recipient_second_name: null, + address: 1234 Meep Meep Blvd, + address2: null, + city: Tucson, + state: AZ, + zip: 35004, + foreign_province: , + country_code: US, + validation_errors: null, + created_at: 2025-07-29T15:47:39.396860Z, + updated_at: 2025-07-29T15:47:39.396860500Z, + state_and_local_withholding: null +) +``` + diff --git a/docs/A1099/V2/Form1095BRequest.md b/docs/A1099/V2/Form1095BRequest.md index 76a5aa7..3ddcc01 100644 --- a/docs/A1099/V2/Form1095BRequest.md +++ b/docs/A1099/V2/Form1095BRequest.md @@ -4,36 +4,36 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **employee_first_name** | **String** | | [optional] | -| **employee_middle_name** | **String** | | [optional] | -| **employee_last_name** | **String** | | [optional] | -| **employee_name_suffix** | **String** | | [optional] | -| **employee_date_of_birth** | **Time** | | [optional] | -| **origin_of_health_coverage_code** | **String** | | [optional] | -| **covered_individuals** | [**Array<CoveredIndividualRequest>**](CoveredIndividualRequest.md) | | [optional] | -| **type** | **String** | | [optional][readonly] | -| **issuer_id** | **String** | | [optional] | -| **reference_id** | **String** | | [optional] | -| **recipient_name** | **String** | | [optional] | -| **recipient_tin** | **String** | | [optional] | -| **tin_type** | **String** | | [optional] | -| **recipient_second_name** | **String** | | [optional] | -| **address** | **String** | | [optional] | -| **address2** | **String** | | [optional] | -| **city** | **String** | | [optional] | -| **state** | **String** | | [optional] | -| **zip** | **String** | | [optional] | -| **recipient_email** | **String** | | [optional] | -| **account_number** | **String** | | [optional] | -| **office_code** | **String** | | [optional] | -| **recipient_non_us_province** | **String** | | [optional] | -| **country_code** | **String** | | [optional] | -| **federal_e_file** | **Boolean** | | [optional] | -| **postal_mail** | **Boolean** | | [optional] | -| **state_e_file** | **Boolean** | | [optional] | -| **tin_match** | **Boolean** | | [optional] | -| **address_verification** | **Boolean** | | [optional] | -| **state_and_local_withholding** | [**StateAndLocalWithholdingRequest**](StateAndLocalWithholdingRequest.md) | | [optional] | +| **employee_first_name** | **String** | Employee's first name | [optional] | +| **employee_middle_name** | **String** | Employee's middle name | [optional] | +| **employee_last_name** | **String** | Employee's last name | [optional] | +| **employee_name_suffix** | **String** | Employee's name suffix | [optional] | +| **employee_date_of_birth** | **Time** | Employee's date of birth | [optional] | +| **origin_of_health_coverage_code** | **String** | Origin of health coverage code | [optional] | +| **covered_individuals** | [**Array<CoveredIndividualRequest>**](CoveredIndividualRequest.md) | Covered individuals information | [optional] | +| **type** | **String** | | [optional] | +| **issuer_id** | **String** | Issuer ID | [optional] | +| **reference_id** | **String** | Reference ID | [optional] | +| **recipient_tin** | **String** | Recipient Tax ID Number | [optional] | +| **recipient_name** | **String** | Recipient name | | +| **tin_type** | **String** | Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN | [optional] | +| **recipient_second_name** | **String** | Recipient second name | [optional] | +| **address** | **String** | Address | | +| **address2** | **String** | Address line 2 | [optional] | +| **city** | **String** | City | | +| **state** | **String** | US state. Required if CountryCode is \"US\". | [optional] | +| **zip** | **String** | Zip/postal code | [optional] | +| **recipient_email** | **String** | Recipient email address | [optional] | +| **account_number** | **String** | Account number | [optional] | +| **office_code** | **String** | Office code | [optional] | +| **recipient_non_us_province** | **String** | Foreign province | [optional] | +| **country_code** | **String** | Country code, as defined at https://www.irs.gov/e-file-providers/country-codes | | +| **federal_e_file** | **Boolean** | Boolean indicating that federal e-filing should be scheduled for this form | [optional] | +| **postal_mail** | **Boolean** | Boolean indicating that postal mailing to the recipient should be scheduled for this form | [optional] | +| **state_e_file** | **Boolean** | Boolean indicating that state e-filing should be scheduled for this form | [optional] | +| **tin_match** | **Boolean** | Boolean indicating that TIN Matching should be scheduled for this form | [optional] | +| **address_verification** | **Boolean** | Boolean indicating that address verification should be scheduled for this form | [optional] | +| **state_and_local_withholding** | [**StateAndLocalWithholdingRequest**](StateAndLocalWithholdingRequest.md) | State and local withholding information | [optional] | ## Example @@ -46,13 +46,13 @@ instance = AvalaraSdk::A1099::V2::Form1095BRequest.new( employee_last_name: null, employee_name_suffix: null, employee_date_of_birth: null, - origin_of_health_coverage_code: SmallBusinessHealthOptionsProgram, + origin_of_health_coverage_code: A, covered_individuals: null, - type: Form1099Nec, + type: 1099-NEC, issuer_id: null, reference_id: null, - recipient_name: null, recipient_tin: null, + recipient_name: null, tin_type: EIN, recipient_second_name: null, address: null, diff --git a/docs/A1099/V2/Form1099BaseResponse.md b/docs/A1099/V2/Form1099BaseResponse.md new file mode 100644 index 0000000..5fbdea4 --- /dev/null +++ b/docs/A1099/V2/Form1099BaseResponse.md @@ -0,0 +1,82 @@ +# AvalaraSdk::A1099::V2::Form1099BaseResponse + +## Properties + +| 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 | | +| **issuer_id** | **Integer** | Issuer ID | | +| **issuer_reference_id** | **String** | Issuer Reference ID | [optional] | +| **issuer_tin** | **String** | Issuer TIN | [optional] | +| **tax_year** | **Integer** | Tax year | [optional] | +| **federal_efile** | **Boolean** | Boolean indicating that federal e-filing has been scheduled for this form | | +| **federal_efile_status** | [**Form1099StatusDetailResponse**](Form1099StatusDetailResponse.md) | Federal e-file status | [optional][readonly] | +| **state_efile** | **Boolean** | Boolean indicating that state e-filing has been scheduled for this form | | +| **state_efile_status** | [**Array<StateEfileStatusDetailResponse>**](StateEfileStatusDetailResponse.md) | State e-file status | [optional][readonly] | +| **postal_mail** | **Boolean** | Boolean indicating that postal mailing to the recipient has been scheduled for this form | | +| **postal_mail_status** | [**Form1099StatusDetailResponse**](Form1099StatusDetailResponse.md) | Postal mail to recipient status | [optional][readonly] | +| **tin_match** | **Boolean** | Boolean indicating that TIN Matching has been scheduled for this form | | +| **tin_match_status** | [**Form1099StatusDetailResponse**](Form1099StatusDetailResponse.md) | TIN Match status | [optional][readonly] | +| **address_verification** | **Boolean** | Boolean indicating that address verification has been scheduled for this form | | +| **address_verification_status** | [**Form1099StatusDetailResponse**](Form1099StatusDetailResponse.md) | Address verification status | [optional][readonly] | +| **reference_id** | **String** | Reference ID | [optional] | +| **email** | **String** | Recipient email address | [optional] | +| **tin_type** | **String** | Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN | [optional] | +| **tin** | **String** | Recipient Tax ID Number | [optional] | +| **recipient_name** | **String** | Recipient name | [optional] | +| **recipient_second_name** | **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] | +| **foreign_province** | **String** | Foreign province | [optional] | +| **country_code** | **String** | Country code, as defined at https://www.irs.gov/e-file-providers/country-codes | [optional] | +| **validation_errors** | [**Array<ValidationErrorResponse>**](ValidationErrorResponse.md) | Validation errors | [optional][readonly] | +| **created_at** | **Time** | Creation time | [optional][readonly] | +| **updated_at** | **Time** | Update time | [optional][readonly] | +| **state_and_local_withholding** | [**StateAndLocalWithholdingResponse**](StateAndLocalWithholdingResponse.md) | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::Form1099BaseResponse.new( + id: 123456789, + type: 1099-NEC, + issuer_id: 987654321, + issuer_reference_id: R-3898734, + issuer_tin: 59-387274, + tax_year: 2024, + federal_efile: false, + federal_efile_status: null, + state_efile: false, + state_efile_status: null, + postal_mail: false, + postal_mail_status: null, + tin_match: false, + tin_match_status: null, + address_verification: false, + address_verification_status: null, + reference_id: 1891810-9819891, + email: roadrunner@acmecorp.com, + tin_type: null, + tin: null, + recipient_name: null, + recipient_second_name: null, + address: 1234 Meep Meep Blvd, + address2: null, + city: Tucson, + state: AZ, + zip: 35004, + foreign_province: , + country_code: US, + validation_errors: null, + created_at: 2025-07-29T15:47:39.396860Z, + updated_at: 2025-07-29T15:47:39.396860500Z, + state_and_local_withholding: null +) +``` + diff --git a/docs/A1099/V2/Form1099DivListItem.md b/docs/A1099/V2/Form1099DivListItem.md index 9305ccf..6e590b0 100644 --- a/docs/A1099/V2/Form1099DivListItem.md +++ b/docs/A1099/V2/Form1099DivListItem.md @@ -4,50 +4,50 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **total_ordinary_dividends** | **String** | | [optional] | -| **qualified_dividends** | **String** | | [optional] | -| **total_capital_gain_distr** | **String** | | [optional] | -| **unrecap_sec1250_gain** | **String** | | [optional] | -| **section1202_gain** | **String** | | [optional] | -| **collectibles_gain** | **String** | | [optional] | -| **section897_ordinary_dividends** | **String** | | [optional] | -| **section897_capital_gain** | **String** | | [optional] | -| **nondividend_distributions** | **String** | | [optional] | -| **federal_income_tax_withheld** | **String** | | [optional] | -| **section199_a_dividends** | **String** | | [optional] | -| **investment_expenses** | **String** | | [optional] | -| **foreign_tax_paid** | **String** | | [optional] | -| **foreign_country_or_us_possession** | **String** | | [optional] | -| **cash_liquidation_distributions** | **String** | | [optional] | -| **noncash_liquidation_distributions** | **String** | | [optional] | -| **exempt_interest_dividends** | **String** | | [optional] | -| **specified_private_activity_bond_interest_dividends** | **String** | | [optional] | -| **fatca_filing_requirement** | **String** | | [optional] | -| **issuer_reference_id** | **String** | | [optional] | -| **issuer_tin** | **String** | | [optional] | -| **tax_year** | **Integer** | | [optional] | -| **issuer_id** | **String** | | [optional] | -| **reference_id** | **String** | | [optional] | -| **recipient_name** | **String** | | [optional] | -| **recipient_tin** | **String** | | [optional] | -| **tin_type** | **String** | | [optional] | -| **recipient_second_name** | **String** | | [optional] | -| **address** | **String** | | [optional] | -| **address2** | **String** | | [optional] | -| **city** | **String** | | [optional] | -| **state** | **String** | | [optional] | -| **zip** | **String** | | [optional] | -| **recipient_email** | **String** | | [optional] | -| **account_number** | **String** | | [optional] | -| **office_code** | **String** | | [optional] | -| **recipient_non_us_province** | **String** | | [optional] | -| **country_code** | **String** | | [optional] | -| **federal_e_file** | **Boolean** | | [optional] | -| **postal_mail** | **Boolean** | | [optional] | -| **state_e_file** | **Boolean** | | [optional] | -| **tin_match** | **Boolean** | | [optional] | -| **address_verification** | **Boolean** | | [optional] | -| **state_and_local_withholding** | [**StateAndLocalWithholdingRequest**](StateAndLocalWithholdingRequest.md) | | [optional] | +| **total_ordinary_dividends** | **String** | Total ordinary dividends | [optional] | +| **qualified_dividends** | **String** | Qualified dividends | [optional] | +| **total_capital_gain_distr** | **String** | Total capital gain distributions | [optional] | +| **unrecap_sec1250_gain** | **String** | Unrecaptured Section 1250 gain | [optional] | +| **section1202_gain** | **String** | Section 1202 gain | [optional] | +| **collectibles_gain** | **String** | Collectibles (28%) gain | [optional] | +| **section897_ordinary_dividends** | **String** | Section 897 ordinary dividends | [optional] | +| **section897_capital_gain** | **String** | Section 897 capital gain | [optional] | +| **nondividend_distributions** | **String** | Nondividend distributions | [optional] | +| **federal_income_tax_withheld** | **String** | Federal income tax withheld | [optional] | +| **section199_a_dividends** | **String** | Section 199A dividends | [optional] | +| **investment_expenses** | **String** | Investment expenses | [optional] | +| **foreign_tax_paid** | **String** | Foreign tax paid | [optional] | +| **foreign_country_or_us_possession** | **String** | Foreign country or U.S. possession | [optional] | +| **cash_liquidation_distributions** | **String** | Cash liquidation distributions | [optional] | +| **noncash_liquidation_distributions** | **String** | Noncash liquidation distributions | [optional] | +| **exempt_interest_dividends** | **String** | Exempt-interest dividends | [optional] | +| **specified_private_activity_bond_interest_dividends** | **String** | Specified private activity bond interest dividends | [optional] | +| **fatca_filing_requirement** | **String** | FATCA filing requirement | [optional] | +| **issuer_reference_id** | **String** | Issuer Reference ID. One of `issuerReferenceId` or `issuerTin` is required. | [optional] | +| **issuer_tin** | **String** | Issuer TIN. One of `issuerReferenceId` or `issuerTin` is required. | [optional] | +| **tax_year** | **Integer** | Tax year | | +| **issuer_id** | **String** | Issuer ID | [optional] | +| **reference_id** | **String** | Reference ID | [optional] | +| **recipient_tin** | **String** | Recipient Tax ID Number | [optional] | +| **recipient_name** | **String** | Recipient name | | +| **tin_type** | **String** | Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN | [optional] | +| **recipient_second_name** | **String** | Recipient second name | [optional] | +| **address** | **String** | Address | | +| **address2** | **String** | Address line 2 | [optional] | +| **city** | **String** | City | | +| **state** | **String** | US state. Required if CountryCode is \"US\". | [optional] | +| **zip** | **String** | Zip/postal code | [optional] | +| **recipient_email** | **String** | Recipient email address | [optional] | +| **account_number** | **String** | Account number | [optional] | +| **office_code** | **String** | Office code | [optional] | +| **recipient_non_us_province** | **String** | Foreign province | [optional] | +| **country_code** | **String** | Country code, as defined at https://www.irs.gov/e-file-providers/country-codes | | +| **federal_e_file** | **Boolean** | Boolean indicating that federal e-filing should be scheduled for this form | [optional] | +| **postal_mail** | **Boolean** | Boolean indicating that postal mailing to the recipient should be scheduled for this form | [optional] | +| **state_e_file** | **Boolean** | Boolean indicating that state e-filing should be scheduled for this form | [optional] | +| **tin_match** | **Boolean** | Boolean indicating that TIN Matching should be scheduled for this form | [optional] | +| **address_verification** | **Boolean** | Boolean indicating that address verification should be scheduled for this form | [optional] | +| **state_and_local_withholding** | [**StateAndLocalWithholdingRequest**](StateAndLocalWithholdingRequest.md) | State and local withholding information | [optional] | ## Example @@ -79,8 +79,8 @@ instance = AvalaraSdk::A1099::V2::Form1099DivListItem.new( tax_year: null, issuer_id: null, reference_id: null, - recipient_name: null, recipient_tin: null, + recipient_name: null, tin_type: EIN, recipient_second_name: null, address: null, diff --git a/docs/A1099/V2/Form1099DivRequest.md b/docs/A1099/V2/Form1099DivRequest.md index 82a364a..80e6cea 100644 --- a/docs/A1099/V2/Form1099DivRequest.md +++ b/docs/A1099/V2/Form1099DivRequest.md @@ -4,48 +4,48 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **total_ordinary_dividends** | **String** | | [optional] | -| **qualified_dividends** | **String** | | [optional] | -| **total_capital_gain_distr** | **String** | | [optional] | -| **unrecap_sec1250_gain** | **String** | | [optional] | -| **section1202_gain** | **String** | | [optional] | -| **collectibles_gain** | **String** | | [optional] | -| **section897_ordinary_dividends** | **String** | | [optional] | -| **section897_capital_gain** | **String** | | [optional] | -| **nondividend_distributions** | **String** | | [optional] | -| **federal_income_tax_withheld** | **String** | | [optional] | -| **section199_a_dividends** | **String** | | [optional] | -| **investment_expenses** | **String** | | [optional] | -| **foreign_tax_paid** | **String** | | [optional] | -| **foreign_country_or_us_possession** | **String** | | [optional] | -| **cash_liquidation_distributions** | **String** | | [optional] | -| **noncash_liquidation_distributions** | **String** | | [optional] | -| **exempt_interest_dividends** | **String** | | [optional] | -| **specified_private_activity_bond_interest_dividends** | **String** | | [optional] | -| **fatca_filing_requirement** | **String** | | [optional] | -| **type** | **String** | | [optional][readonly] | -| **issuer_id** | **String** | | [optional] | -| **reference_id** | **String** | | [optional] | -| **recipient_name** | **String** | | [optional] | -| **recipient_tin** | **String** | | [optional] | -| **tin_type** | **String** | | [optional] | -| **recipient_second_name** | **String** | | [optional] | -| **address** | **String** | | [optional] | -| **address2** | **String** | | [optional] | -| **city** | **String** | | [optional] | -| **state** | **String** | | [optional] | -| **zip** | **String** | | [optional] | -| **recipient_email** | **String** | | [optional] | -| **account_number** | **String** | | [optional] | -| **office_code** | **String** | | [optional] | -| **recipient_non_us_province** | **String** | | [optional] | -| **country_code** | **String** | | [optional] | -| **federal_e_file** | **Boolean** | | [optional] | -| **postal_mail** | **Boolean** | | [optional] | -| **state_e_file** | **Boolean** | | [optional] | -| **tin_match** | **Boolean** | | [optional] | -| **address_verification** | **Boolean** | | [optional] | -| **state_and_local_withholding** | [**StateAndLocalWithholdingRequest**](StateAndLocalWithholdingRequest.md) | | [optional] | +| **total_ordinary_dividends** | **String** | Total ordinary dividends | [optional] | +| **qualified_dividends** | **String** | Qualified dividends | [optional] | +| **total_capital_gain_distr** | **String** | Total capital gain distributions | [optional] | +| **unrecap_sec1250_gain** | **String** | Unrecaptured Section 1250 gain | [optional] | +| **section1202_gain** | **String** | Section 1202 gain | [optional] | +| **collectibles_gain** | **String** | Collectibles (28%) gain | [optional] | +| **section897_ordinary_dividends** | **String** | Section 897 ordinary dividends | [optional] | +| **section897_capital_gain** | **String** | Section 897 capital gain | [optional] | +| **nondividend_distributions** | **String** | Nondividend distributions | [optional] | +| **federal_income_tax_withheld** | **String** | Federal income tax withheld | [optional] | +| **section199_a_dividends** | **String** | Section 199A dividends | [optional] | +| **investment_expenses** | **String** | Investment expenses | [optional] | +| **foreign_tax_paid** | **String** | Foreign tax paid | [optional] | +| **foreign_country_or_us_possession** | **String** | Foreign country or U.S. possession | [optional] | +| **cash_liquidation_distributions** | **String** | Cash liquidation distributions | [optional] | +| **noncash_liquidation_distributions** | **String** | Noncash liquidation distributions | [optional] | +| **exempt_interest_dividends** | **String** | Exempt-interest dividends | [optional] | +| **specified_private_activity_bond_interest_dividends** | **String** | Specified private activity bond interest dividends | [optional] | +| **fatca_filing_requirement** | **String** | FATCA filing requirement | [optional] | +| **type** | **String** | | [optional] | +| **issuer_id** | **String** | Issuer ID | [optional] | +| **reference_id** | **String** | Reference ID | [optional] | +| **recipient_tin** | **String** | Recipient Tax ID Number | [optional] | +| **recipient_name** | **String** | Recipient name | | +| **tin_type** | **String** | Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN | [optional] | +| **recipient_second_name** | **String** | Recipient second name | [optional] | +| **address** | **String** | Address | | +| **address2** | **String** | Address line 2 | [optional] | +| **city** | **String** | City | | +| **state** | **String** | US state. Required if CountryCode is \"US\". | [optional] | +| **zip** | **String** | Zip/postal code | [optional] | +| **recipient_email** | **String** | Recipient email address | [optional] | +| **account_number** | **String** | Account number | [optional] | +| **office_code** | **String** | Office code | [optional] | +| **recipient_non_us_province** | **String** | Foreign province | [optional] | +| **country_code** | **String** | Country code, as defined at https://www.irs.gov/e-file-providers/country-codes | | +| **federal_e_file** | **Boolean** | Boolean indicating that federal e-filing should be scheduled for this form | [optional] | +| **postal_mail** | **Boolean** | Boolean indicating that postal mailing to the recipient should be scheduled for this form | [optional] | +| **state_e_file** | **Boolean** | Boolean indicating that state e-filing should be scheduled for this form | [optional] | +| **tin_match** | **Boolean** | Boolean indicating that TIN Matching should be scheduled for this form | [optional] | +| **address_verification** | **Boolean** | Boolean indicating that address verification should be scheduled for this form | [optional] | +| **state_and_local_withholding** | [**StateAndLocalWithholdingRequest**](StateAndLocalWithholdingRequest.md) | State and local withholding information | [optional] | ## Example @@ -72,11 +72,11 @@ instance = AvalaraSdk::A1099::V2::Form1099DivRequest.new( exempt_interest_dividends: null, specified_private_activity_bond_interest_dividends: null, fatca_filing_requirement: null, - type: Form1099Nec, + type: 1099-NEC, issuer_id: null, reference_id: null, - recipient_name: null, recipient_tin: null, + recipient_name: null, tin_type: EIN, recipient_second_name: null, address: null, diff --git a/docs/A1099/V2/Form1099DivResponse.md b/docs/A1099/V2/Form1099DivResponse.md index 7e9f36f..651cca8 100644 --- a/docs/A1099/V2/Form1099DivResponse.md +++ b/docs/A1099/V2/Form1099DivResponse.md @@ -35,11 +35,11 @@ | **tin_match** | **Boolean** | | [optional] | | **address_verification** | **Boolean** | | [optional] | | **federal_efile_status** | [**StatusDetail**](StatusDetail.md) | | [optional] | -| **state_efile_status** | [**Array<StateEfileStatusDetailApp>**](StateEfileStatusDetailApp.md) | | [optional] | +| **state_efile_status** | [**Array<StateEfileStatusDetailResponse>**](StateEfileStatusDetailResponse.md) | | [optional] | | **postal_mail_status** | [**StatusDetail**](StatusDetail.md) | | [optional] | | **tin_match_status** | [**StatusDetail**](StatusDetail.md) | | [optional] | | **address_verification_status** | [**StatusDetail**](StatusDetail.md) | | [optional] | -| **validation_errors** | [**Array<ValidationErrorApp>**](ValidationErrorApp.md) | | [optional] | +| **validation_errors** | [**Array<ValidationErrorResponse>**](ValidationErrorResponse.md) | | [optional] | ## Example @@ -47,7 +47,7 @@ require 'avalara_sdk' instance = AvalaraSdk::A1099::V2::Form1099DivResponse.new( - type: Form1099Nec, + type: 1099-NEC, created_at: null, updated_at: null, user_id: null, diff --git a/docs/A1099/V2/Form1099KListItem.md b/docs/A1099/V2/Form1099KListItem.md index 46920e7..8922859 100644 --- a/docs/A1099/V2/Form1099KListItem.md +++ b/docs/A1099/V2/Form1099KListItem.md @@ -4,51 +4,51 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **filer_type** | **String** | | [optional] | -| **payment_type** | **String** | | [optional] | -| **payment_settlement_entity_name_phone_number** | **String** | | [optional] | -| **gross_amount_payment_card** | **Float** | | [optional] | -| **card_not_present_transactions** | **Float** | | [optional] | -| **merchant_category_code** | **String** | | [optional] | -| **payment_transaction_number** | **Float** | | [optional] | -| **federal_income_tax_withheld** | **Float** | | [optional] | -| **january** | **Float** | | [optional] | -| **february** | **Float** | | [optional] | -| **march** | **Float** | | [optional] | -| **april** | **Float** | | [optional] | -| **may** | **Float** | | [optional] | -| **june** | **Float** | | [optional] | -| **july** | **Float** | | [optional] | -| **august** | **Float** | | [optional] | -| **sept** | **Float** | | [optional] | -| **october** | **Float** | | [optional] | -| **november** | **Float** | | [optional] | -| **december** | **Float** | | [optional] | -| **issuer_reference_id** | **String** | | [optional] | -| **issuer_tin** | **String** | | [optional] | -| **tax_year** | **Integer** | | [optional] | -| **issuer_id** | **String** | | [optional] | -| **reference_id** | **String** | | [optional] | -| **recipient_name** | **String** | | [optional] | -| **recipient_tin** | **String** | | [optional] | -| **tin_type** | **String** | | [optional] | -| **recipient_second_name** | **String** | | [optional] | -| **address** | **String** | | [optional] | -| **address2** | **String** | | [optional] | -| **city** | **String** | | [optional] | -| **state** | **String** | | [optional] | -| **zip** | **String** | | [optional] | -| **recipient_email** | **String** | | [optional] | -| **account_number** | **String** | | [optional] | -| **office_code** | **String** | | [optional] | -| **recipient_non_us_province** | **String** | | [optional] | -| **country_code** | **String** | | [optional] | -| **federal_e_file** | **Boolean** | | [optional] | -| **postal_mail** | **Boolean** | | [optional] | -| **state_e_file** | **Boolean** | | [optional] | -| **tin_match** | **Boolean** | | [optional] | -| **address_verification** | **Boolean** | | [optional] | -| **state_and_local_withholding** | [**StateAndLocalWithholdingRequest**](StateAndLocalWithholdingRequest.md) | | [optional] | +| **filer_type** | **String** | Filer type (PSE or EPF) | [optional] | +| **payment_type** | **String** | Payment type (payment card or third party network) | [optional] | +| **payment_settlement_entity_name_phone_number** | **String** | Payment settlement entity name and phone number | [optional] | +| **gross_amount_payment_card** | **Float** | Gross amount of payment card/third party network transactions | [optional] | +| **card_not_present_transactions** | **Float** | Card not present transactions | [optional] | +| **merchant_category_code** | **String** | Merchant category code | [optional] | +| **payment_transaction_number** | **Float** | Number of payment transactions | [optional] | +| **federal_income_tax_withheld** | **Float** | Federal income tax withheld | [optional] | +| **january** | **Float** | January gross payments | [optional] | +| **february** | **Float** | February gross payments | [optional] | +| **march** | **Float** | March gross payments | [optional] | +| **april** | **Float** | April gross payments | [optional] | +| **may** | **Float** | May gross payments | [optional] | +| **june** | **Float** | June gross payments | [optional] | +| **july** | **Float** | July gross payments | [optional] | +| **august** | **Float** | August gross payments | [optional] | +| **sept** | **Float** | September gross payments | [optional] | +| **october** | **Float** | October gross payments | [optional] | +| **november** | **Float** | November gross payments | [optional] | +| **december** | **Float** | December gross payments | [optional] | +| **issuer_reference_id** | **String** | Issuer Reference ID. One of `issuerReferenceId` or `issuerTin` is required. | [optional] | +| **issuer_tin** | **String** | Issuer TIN. One of `issuerReferenceId` or `issuerTin` is required. | [optional] | +| **tax_year** | **Integer** | Tax year | | +| **issuer_id** | **String** | Issuer ID | [optional] | +| **reference_id** | **String** | Reference ID | [optional] | +| **recipient_tin** | **String** | Recipient Tax ID Number | [optional] | +| **recipient_name** | **String** | Recipient name | | +| **tin_type** | **String** | Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN | [optional] | +| **recipient_second_name** | **String** | Recipient second name | [optional] | +| **address** | **String** | Address | | +| **address2** | **String** | Address line 2 | [optional] | +| **city** | **String** | City | | +| **state** | **String** | US state. Required if CountryCode is \"US\". | [optional] | +| **zip** | **String** | Zip/postal code | [optional] | +| **recipient_email** | **String** | Recipient email address | [optional] | +| **account_number** | **String** | Account number | [optional] | +| **office_code** | **String** | Office code | [optional] | +| **recipient_non_us_province** | **String** | Foreign province | [optional] | +| **country_code** | **String** | Country code, as defined at https://www.irs.gov/e-file-providers/country-codes | | +| **federal_e_file** | **Boolean** | Boolean indicating that federal e-filing should be scheduled for this form | [optional] | +| **postal_mail** | **Boolean** | Boolean indicating that postal mailing to the recipient should be scheduled for this form | [optional] | +| **state_e_file** | **Boolean** | Boolean indicating that state e-filing should be scheduled for this form | [optional] | +| **tin_match** | **Boolean** | Boolean indicating that TIN Matching should be scheduled for this form | [optional] | +| **address_verification** | **Boolean** | Boolean indicating that address verification should be scheduled for this form | [optional] | +| **state_and_local_withholding** | [**StateAndLocalWithholdingRequest**](StateAndLocalWithholdingRequest.md) | State and local withholding information | [optional] | ## Example @@ -81,8 +81,8 @@ instance = AvalaraSdk::A1099::V2::Form1099KListItem.new( tax_year: null, issuer_id: null, reference_id: null, - recipient_name: null, recipient_tin: null, + recipient_name: null, tin_type: EIN, recipient_second_name: null, address: null, diff --git a/docs/A1099/V2/Form1099KListItemResponse.md b/docs/A1099/V2/Form1099KListItemResponse.md new file mode 100644 index 0000000..e5d82cd --- /dev/null +++ b/docs/A1099/V2/Form1099KListItemResponse.md @@ -0,0 +1,122 @@ +# AvalaraSdk::A1099::V2::Form1099KListItemResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **filer_type** | **String** | Filer type (PSE or EPF) | [optional] | +| **payment_type** | **String** | Payment type (payment card or third party network) | [optional] | +| **payment_settlement_entity_name_phone_number** | **String** | Payment settlement entity name and phone number | [optional] | +| **gross_amount_payment_card** | **Float** | Gross amount of payment card/third party network transactions | [optional] | +| **card_not_present_transactions** | **Float** | Card not present transactions | [optional] | +| **merchant_category_code** | **String** | Merchant category code | [optional] | +| **payment_transaction_number** | **Float** | Number of payment transactions | [optional] | +| **federal_income_tax_withheld** | **Float** | Federal income tax withheld | [optional] | +| **january** | **Float** | January gross payments | [optional] | +| **february** | **Float** | February gross payments | [optional] | +| **march** | **Float** | March gross payments | [optional] | +| **april** | **Float** | April gross payments | [optional] | +| **may** | **Float** | May gross payments | [optional] | +| **june** | **Float** | June gross payments | [optional] | +| **july** | **Float** | July gross payments | [optional] | +| **august** | **Float** | August gross payments | [optional] | +| **sept** | **Float** | September gross payments | [optional] | +| **october** | **Float** | October gross payments | [optional] | +| **november** | **Float** | November gross payments | [optional] | +| **december** | **Float** | December gross payments | [optional] | +| **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 | | +| **issuer_id** | **Integer** | Issuer ID | | +| **issuer_reference_id** | **String** | Issuer Reference ID | [optional] | +| **issuer_tin** | **String** | Issuer TIN | [optional] | +| **tax_year** | **Integer** | Tax year | [optional] | +| **federal_efile** | **Boolean** | Boolean indicating that federal e-filing has been scheduled for this form | | +| **federal_efile_status** | [**Form1099StatusDetailResponse**](Form1099StatusDetailResponse.md) | Federal e-file status | [optional][readonly] | +| **state_efile** | **Boolean** | Boolean indicating that state e-filing has been scheduled for this form | | +| **state_efile_status** | [**Array<StateEfileStatusDetailResponse>**](StateEfileStatusDetailResponse.md) | State e-file status | [optional][readonly] | +| **postal_mail** | **Boolean** | Boolean indicating that postal mailing to the recipient has been scheduled for this form | | +| **postal_mail_status** | [**Form1099StatusDetailResponse**](Form1099StatusDetailResponse.md) | Postal mail to recipient status | [optional][readonly] | +| **tin_match** | **Boolean** | Boolean indicating that TIN Matching has been scheduled for this form | | +| **tin_match_status** | [**Form1099StatusDetailResponse**](Form1099StatusDetailResponse.md) | TIN Match status | [optional][readonly] | +| **address_verification** | **Boolean** | Boolean indicating that address verification has been scheduled for this form | | +| **address_verification_status** | [**Form1099StatusDetailResponse**](Form1099StatusDetailResponse.md) | Address verification status | [optional][readonly] | +| **reference_id** | **String** | Reference ID | [optional] | +| **email** | **String** | Recipient email address | [optional] | +| **tin_type** | **String** | Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN | [optional] | +| **tin** | **String** | Recipient Tax ID Number | [optional] | +| **recipient_name** | **String** | Recipient name | [optional] | +| **recipient_second_name** | **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] | +| **foreign_province** | **String** | Foreign province | [optional] | +| **country_code** | **String** | Country code, as defined at https://www.irs.gov/e-file-providers/country-codes | [optional] | +| **validation_errors** | [**Array<ValidationErrorResponse>**](ValidationErrorResponse.md) | Validation errors | [optional][readonly] | +| **created_at** | **Time** | Creation time | [optional][readonly] | +| **updated_at** | **Time** | Update time | [optional][readonly] | +| **state_and_local_withholding** | [**StateAndLocalWithholdingResponse**](StateAndLocalWithholdingResponse.md) | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::Form1099KListItemResponse.new( + filer_type: 0, + payment_type: 0, + payment_settlement_entity_name_phone_number: null, + gross_amount_payment_card: 0, + card_not_present_transactions: null, + merchant_category_code: null, + payment_transaction_number: 0, + federal_income_tax_withheld: null, + january: null, + february: null, + march: null, + april: null, + may: null, + june: null, + july: null, + august: null, + sept: null, + october: null, + november: null, + december: null, + id: 123456789, + type: 1099-NEC, + issuer_id: 987654321, + issuer_reference_id: R-3898734, + issuer_tin: 59-387274, + tax_year: 2024, + federal_efile: false, + federal_efile_status: null, + state_efile: false, + state_efile_status: null, + postal_mail: false, + postal_mail_status: null, + tin_match: false, + tin_match_status: null, + address_verification: false, + address_verification_status: null, + reference_id: 1891810-9819891, + email: roadrunner@acmecorp.com, + tin_type: null, + tin: null, + recipient_name: null, + recipient_second_name: null, + address: 1234 Meep Meep Blvd, + address2: null, + city: Tucson, + state: AZ, + zip: 35004, + foreign_province: , + country_code: US, + validation_errors: null, + created_at: 2025-07-29T15:47:39.396860Z, + updated_at: 2025-07-29T15:47:39.396860500Z, + state_and_local_withholding: null +) +``` + diff --git a/docs/A1099/V2/Form1099KRequest.md b/docs/A1099/V2/Form1099KRequest.md index 23c739c..55d1a94 100644 --- a/docs/A1099/V2/Form1099KRequest.md +++ b/docs/A1099/V2/Form1099KRequest.md @@ -4,49 +4,49 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **filer_type** | **Integer** | | [optional] | -| **payment_type** | **Integer** | | [optional] | -| **payment_settlement_entity_name_phone_number** | **String** | | [optional] | -| **gross_amount_payment_card** | **Float** | | [optional] | -| **card_not_present_transactions** | **Float** | | [optional] | -| **merchant_category_code** | **String** | | [optional] | -| **payment_transaction_number** | **Float** | | [optional] | -| **federal_income_tax_withheld** | **Float** | | [optional] | -| **january** | **Float** | | [optional] | -| **february** | **Float** | | [optional] | -| **march** | **Float** | | [optional] | -| **april** | **Float** | | [optional] | -| **may** | **Float** | | [optional] | -| **june** | **Float** | | [optional] | -| **july** | **Float** | | [optional] | -| **august** | **Float** | | [optional] | -| **sept** | **Float** | | [optional] | -| **october** | **Float** | | [optional] | -| **november** | **Float** | | [optional] | -| **december** | **Float** | | [optional] | -| **type** | **String** | | [optional][readonly] | -| **issuer_id** | **String** | | [optional] | -| **reference_id** | **String** | | [optional] | -| **recipient_name** | **String** | | [optional] | -| **recipient_tin** | **String** | | [optional] | -| **tin_type** | **String** | | [optional] | -| **recipient_second_name** | **String** | | [optional] | -| **address** | **String** | | [optional] | -| **address2** | **String** | | [optional] | -| **city** | **String** | | [optional] | -| **state** | **String** | | [optional] | -| **zip** | **String** | | [optional] | -| **recipient_email** | **String** | | [optional] | -| **account_number** | **String** | | [optional] | -| **office_code** | **String** | | [optional] | -| **recipient_non_us_province** | **String** | | [optional] | -| **country_code** | **String** | | [optional] | -| **federal_e_file** | **Boolean** | | [optional] | -| **postal_mail** | **Boolean** | | [optional] | -| **state_e_file** | **Boolean** | | [optional] | -| **tin_match** | **Boolean** | | [optional] | -| **address_verification** | **Boolean** | | [optional] | -| **state_and_local_withholding** | [**StateAndLocalWithholdingRequest**](StateAndLocalWithholdingRequest.md) | | [optional] | +| **filer_type** | **Integer** | Filer type (PSE or EPF) | [optional] | +| **payment_type** | **Integer** | Payment type (payment card or third party network) | [optional] | +| **payment_settlement_entity_name_phone_number** | **String** | Payment settlement entity name and phone number | [optional] | +| **gross_amount_payment_card** | **Float** | Gross amount of payment card/third party network transactions | [optional] | +| **card_not_present_transactions** | **Float** | Card not present transactions | [optional] | +| **merchant_category_code** | **String** | Merchant category code | [optional] | +| **payment_transaction_number** | **Float** | Number of payment transactions | [optional] | +| **federal_income_tax_withheld** | **Float** | Federal income tax withheld | [optional] | +| **january** | **Float** | January gross payments | [optional] | +| **february** | **Float** | February gross payments | [optional] | +| **march** | **Float** | March gross payments | [optional] | +| **april** | **Float** | April gross payments | [optional] | +| **may** | **Float** | May gross payments | [optional] | +| **june** | **Float** | June gross payments | [optional] | +| **july** | **Float** | July gross payments | [optional] | +| **august** | **Float** | August gross payments | [optional] | +| **sept** | **Float** | September gross payments | [optional] | +| **october** | **Float** | October gross payments | [optional] | +| **november** | **Float** | November gross payments | [optional] | +| **december** | **Float** | December gross payments | [optional] | +| **type** | **String** | | [optional] | +| **issuer_id** | **String** | Issuer ID | [optional] | +| **reference_id** | **String** | Reference ID | [optional] | +| **recipient_tin** | **String** | Recipient Tax ID Number | [optional] | +| **recipient_name** | **String** | Recipient name | | +| **tin_type** | **String** | Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN | [optional] | +| **recipient_second_name** | **String** | Recipient second name | [optional] | +| **address** | **String** | Address | | +| **address2** | **String** | Address line 2 | [optional] | +| **city** | **String** | City | | +| **state** | **String** | US state. Required if CountryCode is \"US\". | [optional] | +| **zip** | **String** | Zip/postal code | [optional] | +| **recipient_email** | **String** | Recipient email address | [optional] | +| **account_number** | **String** | Account number | [optional] | +| **office_code** | **String** | Office code | [optional] | +| **recipient_non_us_province** | **String** | Foreign province | [optional] | +| **country_code** | **String** | Country code, as defined at https://www.irs.gov/e-file-providers/country-codes | | +| **federal_e_file** | **Boolean** | Boolean indicating that federal e-filing should be scheduled for this form | [optional] | +| **postal_mail** | **Boolean** | Boolean indicating that postal mailing to the recipient should be scheduled for this form | [optional] | +| **state_e_file** | **Boolean** | Boolean indicating that state e-filing should be scheduled for this form | [optional] | +| **tin_match** | **Boolean** | Boolean indicating that TIN Matching should be scheduled for this form | [optional] | +| **address_verification** | **Boolean** | Boolean indicating that address verification should be scheduled for this form | [optional] | +| **state_and_local_withholding** | [**StateAndLocalWithholdingRequest**](StateAndLocalWithholdingRequest.md) | State and local withholding information | [optional] | ## Example @@ -74,11 +74,11 @@ instance = AvalaraSdk::A1099::V2::Form1099KRequest.new( october: null, november: null, december: null, - type: Form1099Nec, + type: 1099-NEC, issuer_id: null, reference_id: null, - recipient_name: null, recipient_tin: null, + recipient_name: null, tin_type: EIN, recipient_second_name: null, address: null, diff --git a/docs/A1099/V2/Form1099ListResponse.md b/docs/A1099/V2/Form1099ListResponse.md new file mode 100644 index 0000000..22ac2a8 --- /dev/null +++ b/docs/A1099/V2/Form1099ListResponse.md @@ -0,0 +1,18 @@ +# AvalaraSdk::A1099::V2::Form1099ListResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **value** | [**Array<Form1099ListResponseValueInner>**](Form1099ListResponseValueInner.md) | List of Form 1099 responses | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::Form1099ListResponse.new( + value: null +) +``` + diff --git a/docs/A1099/V2/Form1099ListResponseValueInner.md b/docs/A1099/V2/Form1099ListResponseValueInner.md new file mode 100644 index 0000000..98edd07 --- /dev/null +++ b/docs/A1099/V2/Form1099ListResponseValueInner.md @@ -0,0 +1,59 @@ +# AvalaraSdk::A1099::V2::Form1099ListResponseValueInner + +## Class instance methods + +### `openapi_one_of` + +Returns the list of classes defined in oneOf. + +#### Example + +```ruby +require 'avalara_sdk' + +AvalaraSdk::A1099::V2::Form1099ListResponseValueInner.openapi_one_of +# => +# [ +# :'Form1042SListItemResponse', +# :'Form1095BListItemResponse', +# :'Form1099BaseResponse', +# :'Form1099KListItemResponse', +# :'Form1099MiscListItemResponse', +# :'Form1099NecListItemResponse', +# :'Form1099RListItemResponse' +# ] +``` + +### build + +Find the appropriate object from the `openapi_one_of` list and casts the data into it. + +#### Example + +```ruby +require 'avalara_sdk' + +AvalaraSdk::A1099::V2::Form1099ListResponseValueInner.build(data) +# => # + +AvalaraSdk::A1099::V2::Form1099ListResponseValueInner.build(data_that_doesnt_match) +# => nil +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | ----------- | +| **data** | **Mixed** | data to be matched against the list of oneOf items | + +#### Return type + +- `Form1042SListItemResponse` +- `Form1095BListItemResponse` +- `Form1099BaseResponse` +- `Form1099KListItemResponse` +- `Form1099MiscListItemResponse` +- `Form1099NecListItemResponse` +- `Form1099RListItemResponse` +- `nil` (if no type matches) + diff --git a/docs/A1099/V2/Form1099MiscListItem.md b/docs/A1099/V2/Form1099MiscListItem.md index aa149ad..72a6ff7 100644 --- a/docs/A1099/V2/Form1099MiscListItem.md +++ b/docs/A1099/V2/Form1099MiscListItem.md @@ -4,47 +4,47 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **second_tin_notice** | **Boolean** | | [optional] | -| **rents** | **Float** | | [optional] | -| **royalties** | **Float** | | [optional] | -| **other_income** | **Float** | | [optional] | -| **fed_income_tax_withheld** | **Float** | | [optional] | -| **fishing_boat_proceeds** | **Float** | | [optional] | -| **medical_health_care_payments** | **Float** | | [optional] | -| **payer_made_direct_sales** | **Boolean** | | [optional] | -| **substitute_payments** | **Float** | | [optional] | -| **crop_insurance_proceeds** | **Float** | | [optional] | -| **gross_proceeds_paid_to_attorney** | **Float** | | [optional] | -| **fish_purchased_for_resale** | **Float** | | [optional] | -| **section409_a_deferrals** | **Float** | | [optional] | -| **fatca_filing_requirement** | **Boolean** | | [optional] | -| **excess_golden_parachute_payments** | **Float** | | [optional] | -| **nonqualified_deferred_compensation** | **Float** | | [optional] | -| **issuer_reference_id** | **String** | | [optional] | -| **issuer_tin** | **String** | | [optional] | -| **tax_year** | **Integer** | | [optional] | -| **issuer_id** | **String** | | [optional] | -| **reference_id** | **String** | | [optional] | -| **recipient_name** | **String** | | [optional] | -| **recipient_tin** | **String** | | [optional] | -| **tin_type** | **String** | | [optional] | -| **recipient_second_name** | **String** | | [optional] | -| **address** | **String** | | [optional] | -| **address2** | **String** | | [optional] | -| **city** | **String** | | [optional] | -| **state** | **String** | | [optional] | -| **zip** | **String** | | [optional] | -| **recipient_email** | **String** | | [optional] | -| **account_number** | **String** | | [optional] | -| **office_code** | **String** | | [optional] | -| **recipient_non_us_province** | **String** | | [optional] | -| **country_code** | **String** | | [optional] | -| **federal_e_file** | **Boolean** | | [optional] | -| **postal_mail** | **Boolean** | | [optional] | -| **state_e_file** | **Boolean** | | [optional] | -| **tin_match** | **Boolean** | | [optional] | -| **address_verification** | **Boolean** | | [optional] | -| **state_and_local_withholding** | [**StateAndLocalWithholdingRequest**](StateAndLocalWithholdingRequest.md) | | [optional] | +| **second_tin_notice** | **Boolean** | Second TIN notice | [optional] | +| **rents** | **Float** | Rents | [optional] | +| **royalties** | **Float** | Royalties | [optional] | +| **other_income** | **Float** | Other income | [optional] | +| **fed_income_tax_withheld** | **Float** | Federal income tax withheld | [optional] | +| **fishing_boat_proceeds** | **Float** | Fishing boat proceeds | [optional] | +| **medical_health_care_payments** | **Float** | Medical and health care payments | [optional] | +| **direct_sales_indicator** | **Boolean** | Payer made direct sales totaling $5,000 or more of consumer products to recipient for resale | [optional] | +| **substitute_payments** | **Float** | Substitute payments in lieu of dividends or interest | [optional] | +| **crop_insurance_proceeds** | **Float** | Crop insurance proceeds | [optional] | +| **gross_proceeds_paid_to_attorney** | **Float** | Gross proceeds paid to an attorney | [optional] | +| **fish_purchased_for_resale** | **Float** | Fish purchased for resale | [optional] | +| **section409_a_deferrals** | **Float** | Section 409A deferrals | [optional] | +| **fatca_filing_requirement** | **Boolean** | FATCA filing requirement | [optional] | +| **excess_golden_parachute_payments** | **Float** | (Legacy field) Excess golden parachute payments | [optional] | +| **nonqualified_deferred_compensation** | **Float** | Nonqualified deferred compensation | [optional] | +| **issuer_reference_id** | **String** | Issuer Reference ID. One of `issuerReferenceId` or `issuerTin` is required. | [optional] | +| **issuer_tin** | **String** | Issuer TIN. One of `issuerReferenceId` or `issuerTin` is required. | [optional] | +| **tax_year** | **Integer** | Tax year | | +| **issuer_id** | **String** | Issuer ID | [optional] | +| **reference_id** | **String** | Reference ID | [optional] | +| **recipient_tin** | **String** | Recipient Tax ID Number | [optional] | +| **recipient_name** | **String** | Recipient name | | +| **tin_type** | **String** | Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN | [optional] | +| **recipient_second_name** | **String** | Recipient second name | [optional] | +| **address** | **String** | Address | | +| **address2** | **String** | Address line 2 | [optional] | +| **city** | **String** | City | | +| **state** | **String** | US state. Required if CountryCode is \"US\". | [optional] | +| **zip** | **String** | Zip/postal code | [optional] | +| **recipient_email** | **String** | Recipient email address | [optional] | +| **account_number** | **String** | Account number | [optional] | +| **office_code** | **String** | Office code | [optional] | +| **recipient_non_us_province** | **String** | Foreign province | [optional] | +| **country_code** | **String** | Country code, as defined at https://www.irs.gov/e-file-providers/country-codes | | +| **federal_e_file** | **Boolean** | Boolean indicating that federal e-filing should be scheduled for this form | [optional] | +| **postal_mail** | **Boolean** | Boolean indicating that postal mailing to the recipient should be scheduled for this form | [optional] | +| **state_e_file** | **Boolean** | Boolean indicating that state e-filing should be scheduled for this form | [optional] | +| **tin_match** | **Boolean** | Boolean indicating that TIN Matching should be scheduled for this form | [optional] | +| **address_verification** | **Boolean** | Boolean indicating that address verification should be scheduled for this form | [optional] | +| **state_and_local_withholding** | [**StateAndLocalWithholdingRequest**](StateAndLocalWithholdingRequest.md) | State and local withholding information | [optional] | ## Example @@ -59,7 +59,7 @@ instance = AvalaraSdk::A1099::V2::Form1099MiscListItem.new( fed_income_tax_withheld: null, fishing_boat_proceeds: null, medical_health_care_payments: null, - payer_made_direct_sales: null, + direct_sales_indicator: null, substitute_payments: null, crop_insurance_proceeds: null, gross_proceeds_paid_to_attorney: null, @@ -73,8 +73,8 @@ instance = AvalaraSdk::A1099::V2::Form1099MiscListItem.new( tax_year: null, issuer_id: null, reference_id: null, - recipient_name: null, recipient_tin: null, + recipient_name: null, tin_type: EIN, recipient_second_name: null, address: null, diff --git a/docs/A1099/V2/Form1099MiscListItemResponse.md b/docs/A1099/V2/Form1099MiscListItemResponse.md new file mode 100644 index 0000000..fd25c27 --- /dev/null +++ b/docs/A1099/V2/Form1099MiscListItemResponse.md @@ -0,0 +1,108 @@ +# AvalaraSdk::A1099::V2::Form1099MiscListItemResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **rents** | **Float** | Rents | [optional] | +| **royalties** | **Float** | Royalties | [optional] | +| **other_income** | **Float** | Other income | [optional] | +| **fed_income_tax_withheld** | **Float** | Federal income tax withheld | [optional] | +| **fishing_boat_proceeds** | **Float** | Fishing boat proceeds | [optional] | +| **medical_and_health_care** | **Float** | Medical and health care payments | [optional] | +| **substitute_payments** | **Float** | Substitute payments in lieu of dividends or interest | [optional] | +| **direct_sales_indicator** | **Boolean** | Payer made direct sales totaling $5,000 or more of consumer products to recipient for resale | [optional] | +| **crop_insurance_proceeds** | **Float** | Crop insurance proceeds | [optional] | +| **excess_golden_parachute** | **Float** | (Legacy field) Excess golden parachute payments | [optional] | +| **gross_amount_paid_attorney** | **Float** | Gross proceeds paid to an attorney | [optional] | +| **section409_a_deferrals** | **Float** | Section 409A deferrals | [optional] | +| **section409_a_income** | **Float** | Nonqualified deferred compensation | [optional] | +| **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 | | +| **issuer_id** | **Integer** | Issuer ID | | +| **issuer_reference_id** | **String** | Issuer Reference ID | [optional] | +| **issuer_tin** | **String** | Issuer TIN | [optional] | +| **tax_year** | **Integer** | Tax year | [optional] | +| **federal_efile** | **Boolean** | Boolean indicating that federal e-filing has been scheduled for this form | | +| **federal_efile_status** | [**Form1099StatusDetailResponse**](Form1099StatusDetailResponse.md) | Federal e-file status | [optional][readonly] | +| **state_efile** | **Boolean** | Boolean indicating that state e-filing has been scheduled for this form | | +| **state_efile_status** | [**Array<StateEfileStatusDetailResponse>**](StateEfileStatusDetailResponse.md) | State e-file status | [optional][readonly] | +| **postal_mail** | **Boolean** | Boolean indicating that postal mailing to the recipient has been scheduled for this form | | +| **postal_mail_status** | [**Form1099StatusDetailResponse**](Form1099StatusDetailResponse.md) | Postal mail to recipient status | [optional][readonly] | +| **tin_match** | **Boolean** | Boolean indicating that TIN Matching has been scheduled for this form | | +| **tin_match_status** | [**Form1099StatusDetailResponse**](Form1099StatusDetailResponse.md) | TIN Match status | [optional][readonly] | +| **address_verification** | **Boolean** | Boolean indicating that address verification has been scheduled for this form | | +| **address_verification_status** | [**Form1099StatusDetailResponse**](Form1099StatusDetailResponse.md) | Address verification status | [optional][readonly] | +| **reference_id** | **String** | Reference ID | [optional] | +| **email** | **String** | Recipient email address | [optional] | +| **tin_type** | **String** | Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN | [optional] | +| **tin** | **String** | Recipient Tax ID Number | [optional] | +| **recipient_name** | **String** | Recipient name | [optional] | +| **recipient_second_name** | **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] | +| **foreign_province** | **String** | Foreign province | [optional] | +| **country_code** | **String** | Country code, as defined at https://www.irs.gov/e-file-providers/country-codes | [optional] | +| **validation_errors** | [**Array<ValidationErrorResponse>**](ValidationErrorResponse.md) | Validation errors | [optional][readonly] | +| **created_at** | **Time** | Creation time | [optional][readonly] | +| **updated_at** | **Time** | Update time | [optional][readonly] | +| **state_and_local_withholding** | [**StateAndLocalWithholdingResponse**](StateAndLocalWithholdingResponse.md) | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::Form1099MiscListItemResponse.new( + rents: null, + royalties: null, + other_income: 1402.71, + fed_income_tax_withheld: null, + fishing_boat_proceeds: null, + medical_and_health_care: null, + substitute_payments: null, + direct_sales_indicator: false, + crop_insurance_proceeds: null, + excess_golden_parachute: null, + gross_amount_paid_attorney: null, + section409_a_deferrals: null, + section409_a_income: null, + id: 123456789, + type: 1099-NEC, + issuer_id: 987654321, + issuer_reference_id: R-3898734, + issuer_tin: 59-387274, + tax_year: 2024, + federal_efile: false, + federal_efile_status: null, + state_efile: false, + state_efile_status: null, + postal_mail: false, + postal_mail_status: null, + tin_match: false, + tin_match_status: null, + address_verification: false, + address_verification_status: null, + reference_id: 1891810-9819891, + email: roadrunner@acmecorp.com, + tin_type: null, + tin: null, + recipient_name: null, + recipient_second_name: null, + address: 1234 Meep Meep Blvd, + address2: null, + city: Tucson, + state: AZ, + zip: 35004, + foreign_province: , + country_code: US, + validation_errors: null, + created_at: 2025-07-29T15:47:39.396860Z, + updated_at: 2025-07-29T15:47:39.396860500Z, + state_and_local_withholding: null +) +``` + diff --git a/docs/A1099/V2/Form1099MiscRequest.md b/docs/A1099/V2/Form1099MiscRequest.md index 5e60783..a1d7ff1 100644 --- a/docs/A1099/V2/Form1099MiscRequest.md +++ b/docs/A1099/V2/Form1099MiscRequest.md @@ -4,45 +4,45 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **second_tin_notice** | **Boolean** | | [optional] | -| **rents** | **Float** | | [optional] | -| **royalties** | **Float** | | [optional] | -| **other_income** | **Float** | | [optional] | -| **fed_income_tax_withheld** | **Float** | | [optional] | -| **fishing_boat_proceeds** | **Float** | | [optional] | -| **medical_health_care_payments** | **Float** | | [optional] | -| **payer_made_direct_sales** | **Boolean** | | [optional] | -| **substitute_payments** | **Float** | | [optional] | -| **crop_insurance_proceeds** | **Float** | | [optional] | -| **gross_proceeds_paid_to_attorney** | **Float** | | [optional] | -| **fish_purchased_for_resale** | **Float** | | [optional] | -| **section409_a_deferrals** | **Float** | | [optional] | -| **fatca_filing_requirement** | **Boolean** | | [optional] | -| **excess_golden_parachute_payments** | **Float** | | [optional] | -| **nonqualified_deferred_compensation** | **Float** | | [optional] | -| **type** | **String** | | [optional][readonly] | -| **issuer_id** | **String** | | [optional] | -| **reference_id** | **String** | | [optional] | -| **recipient_name** | **String** | | [optional] | -| **recipient_tin** | **String** | | [optional] | -| **tin_type** | **String** | | [optional] | -| **recipient_second_name** | **String** | | [optional] | -| **address** | **String** | | [optional] | -| **address2** | **String** | | [optional] | -| **city** | **String** | | [optional] | -| **state** | **String** | | [optional] | -| **zip** | **String** | | [optional] | -| **recipient_email** | **String** | | [optional] | -| **account_number** | **String** | | [optional] | -| **office_code** | **String** | | [optional] | -| **recipient_non_us_province** | **String** | | [optional] | -| **country_code** | **String** | | [optional] | -| **federal_e_file** | **Boolean** | | [optional] | -| **postal_mail** | **Boolean** | | [optional] | -| **state_e_file** | **Boolean** | | [optional] | -| **tin_match** | **Boolean** | | [optional] | -| **address_verification** | **Boolean** | | [optional] | -| **state_and_local_withholding** | [**StateAndLocalWithholdingRequest**](StateAndLocalWithholdingRequest.md) | | [optional] | +| **second_tin_notice** | **Boolean** | Second TIN notice | [optional] | +| **rents** | **Float** | Rents | [optional] | +| **royalties** | **Float** | Royalties | [optional] | +| **other_income** | **Float** | Other income | [optional] | +| **fed_income_tax_withheld** | **Float** | Federal income tax withheld | [optional] | +| **fishing_boat_proceeds** | **Float** | Fishing boat proceeds | [optional] | +| **medical_health_care_payments** | **Float** | Medical and health care payments | [optional] | +| **direct_sales_indicator** | **Boolean** | Payer made direct sales totaling $5,000 or more of consumer products to recipient for resale | [optional] | +| **substitute_payments** | **Float** | Substitute payments in lieu of dividends or interest | [optional] | +| **crop_insurance_proceeds** | **Float** | Crop insurance proceeds | [optional] | +| **gross_proceeds_paid_to_attorney** | **Float** | Gross proceeds paid to an attorney | [optional] | +| **fish_purchased_for_resale** | **Float** | Fish purchased for resale | [optional] | +| **section409_a_deferrals** | **Float** | Section 409A deferrals | [optional] | +| **fatca_filing_requirement** | **Boolean** | FATCA filing requirement | [optional] | +| **excess_golden_parachute_payments** | **Float** | (Legacy field) Excess golden parachute payments | [optional] | +| **nonqualified_deferred_compensation** | **Float** | Nonqualified deferred compensation | [optional] | +| **type** | **String** | | [optional] | +| **issuer_id** | **String** | Issuer ID | [optional] | +| **reference_id** | **String** | Reference ID | [optional] | +| **recipient_tin** | **String** | Recipient Tax ID Number | [optional] | +| **recipient_name** | **String** | Recipient name | | +| **tin_type** | **String** | Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN | [optional] | +| **recipient_second_name** | **String** | Recipient second name | [optional] | +| **address** | **String** | Address | | +| **address2** | **String** | Address line 2 | [optional] | +| **city** | **String** | City | | +| **state** | **String** | US state. Required if CountryCode is \"US\". | [optional] | +| **zip** | **String** | Zip/postal code | [optional] | +| **recipient_email** | **String** | Recipient email address | [optional] | +| **account_number** | **String** | Account number | [optional] | +| **office_code** | **String** | Office code | [optional] | +| **recipient_non_us_province** | **String** | Foreign province | [optional] | +| **country_code** | **String** | Country code, as defined at https://www.irs.gov/e-file-providers/country-codes | | +| **federal_e_file** | **Boolean** | Boolean indicating that federal e-filing should be scheduled for this form | [optional] | +| **postal_mail** | **Boolean** | Boolean indicating that postal mailing to the recipient should be scheduled for this form | [optional] | +| **state_e_file** | **Boolean** | Boolean indicating that state e-filing should be scheduled for this form | [optional] | +| **tin_match** | **Boolean** | Boolean indicating that TIN Matching should be scheduled for this form | [optional] | +| **address_verification** | **Boolean** | Boolean indicating that address verification should be scheduled for this form | [optional] | +| **state_and_local_withholding** | [**StateAndLocalWithholdingRequest**](StateAndLocalWithholdingRequest.md) | State and local withholding information | [optional] | ## Example @@ -57,7 +57,7 @@ instance = AvalaraSdk::A1099::V2::Form1099MiscRequest.new( fed_income_tax_withheld: null, fishing_boat_proceeds: null, medical_health_care_payments: null, - payer_made_direct_sales: null, + direct_sales_indicator: null, substitute_payments: null, crop_insurance_proceeds: null, gross_proceeds_paid_to_attorney: null, @@ -66,11 +66,11 @@ instance = AvalaraSdk::A1099::V2::Form1099MiscRequest.new( fatca_filing_requirement: null, excess_golden_parachute_payments: null, nonqualified_deferred_compensation: null, - type: Form1099Nec, + type: 1099-NEC, issuer_id: null, reference_id: null, - recipient_name: null, recipient_tin: null, + recipient_name: null, tin_type: EIN, recipient_second_name: null, address: null, diff --git a/docs/A1099/V2/Form1099MiscResponse.md b/docs/A1099/V2/Form1099MiscResponse.md index ea19977..5753f1a 100644 --- a/docs/A1099/V2/Form1099MiscResponse.md +++ b/docs/A1099/V2/Form1099MiscResponse.md @@ -11,7 +11,7 @@ | **fed_income_tax_withheld** | **Float** | | [optional] | | **fishing_boat_proceeds** | **Float** | | [optional] | | **medical_health_care_payments** | **Float** | | [optional] | -| **payer_made_direct_sales** | **Boolean** | | [optional] | +| **direct_sales_indicator** | **Boolean** | | [optional] | | **substitute_payments** | **Float** | | [optional] | | **crop_insurance_proceeds** | **Float** | | [optional] | | **gross_proceeds_paid_to_attorney** | **Float** | | [optional] | @@ -51,11 +51,11 @@ | **tin_match** | **Boolean** | | [optional] | | **address_verification** | **Boolean** | | [optional] | | **federal_efile_status** | [**StatusDetail**](StatusDetail.md) | | [optional] | -| **state_efile_status** | [**Array<StateEfileStatusDetailApp>**](StateEfileStatusDetailApp.md) | | [optional] | +| **state_efile_status** | [**Array<StateEfileStatusDetailResponse>**](StateEfileStatusDetailResponse.md) | | [optional] | | **postal_mail_status** | [**StatusDetail**](StatusDetail.md) | | [optional] | | **tin_match_status** | [**StatusDetail**](StatusDetail.md) | | [optional] | | **address_verification_status** | [**StatusDetail**](StatusDetail.md) | | [optional] | -| **validation_errors** | [**Array<ValidationErrorApp>**](ValidationErrorApp.md) | | [optional] | +| **validation_errors** | [**Array<ValidationErrorResponse>**](ValidationErrorResponse.md) | | [optional] | ## Example @@ -70,7 +70,7 @@ instance = AvalaraSdk::A1099::V2::Form1099MiscResponse.new( fed_income_tax_withheld: null, fishing_boat_proceeds: null, medical_health_care_payments: null, - payer_made_direct_sales: null, + direct_sales_indicator: null, substitute_payments: null, crop_insurance_proceeds: null, gross_proceeds_paid_to_attorney: null, @@ -79,7 +79,7 @@ instance = AvalaraSdk::A1099::V2::Form1099MiscResponse.new( fatca_filing_requirement: null, excess_golden_parachute_payments: null, nonqualified_deferred_compensation: null, - type: Form1099Nec, + type: 1099-NEC, created_at: null, updated_at: null, user_id: null, diff --git a/docs/A1099/V2/Form1099NecListItem.md b/docs/A1099/V2/Form1099NecListItem.md index 9ef9978..6e3bf47 100644 --- a/docs/A1099/V2/Form1099NecListItem.md +++ b/docs/A1099/V2/Form1099NecListItem.md @@ -4,35 +4,35 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **second_tin_notice** | **Boolean** | | [optional] | -| **nonemployee_compensation** | **Float** | | [optional] | -| **payer_made_direct_sales** | **Boolean** | | [optional] | -| **federal_income_tax_withheld** | **Float** | | [optional] | -| **issuer_reference_id** | **String** | | [optional] | -| **issuer_tin** | **String** | | [optional] | -| **tax_year** | **Integer** | | [optional] | -| **issuer_id** | **String** | | [optional] | -| **reference_id** | **String** | | [optional] | -| **recipient_name** | **String** | | [optional] | -| **recipient_tin** | **String** | | [optional] | -| **tin_type** | **String** | | [optional] | -| **recipient_second_name** | **String** | | [optional] | -| **address** | **String** | | [optional] | -| **address2** | **String** | | [optional] | -| **city** | **String** | | [optional] | -| **state** | **String** | | [optional] | -| **zip** | **String** | | [optional] | -| **recipient_email** | **String** | | [optional] | -| **account_number** | **String** | | [optional] | -| **office_code** | **String** | | [optional] | -| **recipient_non_us_province** | **String** | | [optional] | -| **country_code** | **String** | | [optional] | -| **federal_e_file** | **Boolean** | | [optional] | -| **postal_mail** | **Boolean** | | [optional] | -| **state_e_file** | **Boolean** | | [optional] | -| **tin_match** | **Boolean** | | [optional] | -| **address_verification** | **Boolean** | | [optional] | -| **state_and_local_withholding** | [**StateAndLocalWithholdingRequest**](StateAndLocalWithholdingRequest.md) | | [optional] | +| **second_tin_notice** | **Boolean** | Second TIN notice | [optional] | +| **nonemployee_compensation** | **Float** | Nonemployee compensation | | +| **direct_sales_indicator** | **Boolean** | Payer made direct sales totaling $5,000 or more of consumer products to recipient for resale | [optional] | +| **federal_income_tax_withheld** | **Float** | Federal income tax withheld | [optional] | +| **issuer_reference_id** | **String** | Issuer Reference ID. One of `issuerReferenceId` or `issuerTin` is required. | [optional] | +| **issuer_tin** | **String** | Issuer TIN. One of `issuerReferenceId` or `issuerTin` is required. | [optional] | +| **tax_year** | **Integer** | Tax year | | +| **issuer_id** | **String** | Issuer ID | [optional] | +| **reference_id** | **String** | Reference ID | [optional] | +| **recipient_tin** | **String** | Recipient Tax ID Number | [optional] | +| **recipient_name** | **String** | Recipient name | | +| **tin_type** | **String** | Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN | [optional] | +| **recipient_second_name** | **String** | Recipient second name | [optional] | +| **address** | **String** | Address | | +| **address2** | **String** | Address line 2 | [optional] | +| **city** | **String** | City | | +| **state** | **String** | US state. Required if CountryCode is \"US\". | [optional] | +| **zip** | **String** | Zip/postal code | [optional] | +| **recipient_email** | **String** | Recipient email address | [optional] | +| **account_number** | **String** | Account number | [optional] | +| **office_code** | **String** | Office code | [optional] | +| **recipient_non_us_province** | **String** | Foreign province | [optional] | +| **country_code** | **String** | Country code, as defined at https://www.irs.gov/e-file-providers/country-codes | | +| **federal_e_file** | **Boolean** | Boolean indicating that federal e-filing should be scheduled for this form | [optional] | +| **postal_mail** | **Boolean** | Boolean indicating that postal mailing to the recipient should be scheduled for this form | [optional] | +| **state_e_file** | **Boolean** | Boolean indicating that state e-filing should be scheduled for this form | [optional] | +| **tin_match** | **Boolean** | Boolean indicating that TIN Matching should be scheduled for this form | [optional] | +| **address_verification** | **Boolean** | Boolean indicating that address verification should be scheduled for this form | [optional] | +| **state_and_local_withholding** | [**StateAndLocalWithholdingRequest**](StateAndLocalWithholdingRequest.md) | State and local withholding information | [optional] | ## Example @@ -42,15 +42,15 @@ require 'avalara_sdk' instance = AvalaraSdk::A1099::V2::Form1099NecListItem.new( second_tin_notice: null, nonemployee_compensation: null, - payer_made_direct_sales: null, + direct_sales_indicator: null, federal_income_tax_withheld: null, issuer_reference_id: null, issuer_tin: null, tax_year: null, issuer_id: null, reference_id: null, - recipient_name: null, recipient_tin: null, + recipient_name: null, tin_type: EIN, recipient_second_name: null, address: null, diff --git a/docs/A1099/V2/Form1099NecListItemResponse.md b/docs/A1099/V2/Form1099NecListItemResponse.md new file mode 100644 index 0000000..aab96b8 --- /dev/null +++ b/docs/A1099/V2/Form1099NecListItemResponse.md @@ -0,0 +1,88 @@ +# AvalaraSdk::A1099::V2::Form1099NecListItemResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **nonemployee_compensation** | **Float** | Nonemployee compensation | [optional] | +| **federal_income_tax_withheld** | **Float** | Federal income tax withheld | [optional] | +| **direct_sales_indicator** | **Boolean** | Payer made direct sales totaling $5,000 or more of consumer products to recipient for resale | [optional] | +| **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 | | +| **issuer_id** | **Integer** | Issuer ID | | +| **issuer_reference_id** | **String** | Issuer Reference ID | [optional] | +| **issuer_tin** | **String** | Issuer TIN | [optional] | +| **tax_year** | **Integer** | Tax year | [optional] | +| **federal_efile** | **Boolean** | Boolean indicating that federal e-filing has been scheduled for this form | | +| **federal_efile_status** | [**Form1099StatusDetailResponse**](Form1099StatusDetailResponse.md) | Federal e-file status | [optional][readonly] | +| **state_efile** | **Boolean** | Boolean indicating that state e-filing has been scheduled for this form | | +| **state_efile_status** | [**Array<StateEfileStatusDetailResponse>**](StateEfileStatusDetailResponse.md) | State e-file status | [optional][readonly] | +| **postal_mail** | **Boolean** | Boolean indicating that postal mailing to the recipient has been scheduled for this form | | +| **postal_mail_status** | [**Form1099StatusDetailResponse**](Form1099StatusDetailResponse.md) | Postal mail to recipient status | [optional][readonly] | +| **tin_match** | **Boolean** | Boolean indicating that TIN Matching has been scheduled for this form | | +| **tin_match_status** | [**Form1099StatusDetailResponse**](Form1099StatusDetailResponse.md) | TIN Match status | [optional][readonly] | +| **address_verification** | **Boolean** | Boolean indicating that address verification has been scheduled for this form | | +| **address_verification_status** | [**Form1099StatusDetailResponse**](Form1099StatusDetailResponse.md) | Address verification status | [optional][readonly] | +| **reference_id** | **String** | Reference ID | [optional] | +| **email** | **String** | Recipient email address | [optional] | +| **tin_type** | **String** | Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN | [optional] | +| **tin** | **String** | Recipient Tax ID Number | [optional] | +| **recipient_name** | **String** | Recipient name | [optional] | +| **recipient_second_name** | **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] | +| **foreign_province** | **String** | Foreign province | [optional] | +| **country_code** | **String** | Country code, as defined at https://www.irs.gov/e-file-providers/country-codes | [optional] | +| **validation_errors** | [**Array<ValidationErrorResponse>**](ValidationErrorResponse.md) | Validation errors | [optional][readonly] | +| **created_at** | **Time** | Creation time | [optional][readonly] | +| **updated_at** | **Time** | Update time | [optional][readonly] | +| **state_and_local_withholding** | [**StateAndLocalWithholdingResponse**](StateAndLocalWithholdingResponse.md) | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::Form1099NecListItemResponse.new( + nonemployee_compensation: 1402.71, + federal_income_tax_withheld: null, + direct_sales_indicator: false, + id: 123456789, + type: 1099-NEC, + issuer_id: 987654321, + issuer_reference_id: R-3898734, + issuer_tin: 59-387274, + tax_year: 2024, + federal_efile: false, + federal_efile_status: null, + state_efile: false, + state_efile_status: null, + postal_mail: false, + postal_mail_status: null, + tin_match: false, + tin_match_status: null, + address_verification: false, + address_verification_status: null, + reference_id: 1891810-9819891, + email: roadrunner@acmecorp.com, + tin_type: null, + tin: null, + recipient_name: null, + recipient_second_name: null, + address: 1234 Meep Meep Blvd, + address2: null, + city: Tucson, + state: AZ, + zip: 35004, + foreign_province: , + country_code: US, + validation_errors: null, + created_at: 2025-07-29T15:47:39.396860Z, + updated_at: 2025-07-29T15:47:39.396860500Z, + state_and_local_withholding: null +) +``` + diff --git a/docs/A1099/V2/Form1099NecRequest.md b/docs/A1099/V2/Form1099NecRequest.md index 7903516..95210b1 100644 --- a/docs/A1099/V2/Form1099NecRequest.md +++ b/docs/A1099/V2/Form1099NecRequest.md @@ -4,33 +4,33 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **second_tin_notice** | **Boolean** | | [optional] | -| **nonemployee_compensation** | **Float** | | [optional] | -| **payer_made_direct_sales** | **Boolean** | | [optional] | -| **federal_income_tax_withheld** | **Float** | | [optional] | -| **type** | **String** | | [optional][readonly] | -| **issuer_id** | **String** | | [optional] | -| **reference_id** | **String** | | [optional] | -| **recipient_name** | **String** | | [optional] | -| **recipient_tin** | **String** | | [optional] | -| **tin_type** | **String** | | [optional] | -| **recipient_second_name** | **String** | | [optional] | -| **address** | **String** | | [optional] | -| **address2** | **String** | | [optional] | -| **city** | **String** | | [optional] | -| **state** | **String** | | [optional] | -| **zip** | **String** | | [optional] | -| **recipient_email** | **String** | | [optional] | -| **account_number** | **String** | | [optional] | -| **office_code** | **String** | | [optional] | -| **recipient_non_us_province** | **String** | | [optional] | -| **country_code** | **String** | | [optional] | -| **federal_e_file** | **Boolean** | | [optional] | -| **postal_mail** | **Boolean** | | [optional] | -| **state_e_file** | **Boolean** | | [optional] | -| **tin_match** | **Boolean** | | [optional] | -| **address_verification** | **Boolean** | | [optional] | -| **state_and_local_withholding** | [**StateAndLocalWithholdingRequest**](StateAndLocalWithholdingRequest.md) | | [optional] | +| **second_tin_notice** | **Boolean** | Second TIN notice | [optional] | +| **nonemployee_compensation** | **Float** | Nonemployee compensation | | +| **direct_sales_indicator** | **Boolean** | Payer made direct sales totaling $5,000 or more of consumer products to recipient for resale | [optional] | +| **federal_income_tax_withheld** | **Float** | Federal income tax withheld | [optional] | +| **type** | **String** | | [optional] | +| **issuer_id** | **String** | Issuer ID | [optional] | +| **reference_id** | **String** | Reference ID | [optional] | +| **recipient_tin** | **String** | Recipient Tax ID Number | [optional] | +| **recipient_name** | **String** | Recipient name | | +| **tin_type** | **String** | Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN | [optional] | +| **recipient_second_name** | **String** | Recipient second name | [optional] | +| **address** | **String** | Address | | +| **address2** | **String** | Address line 2 | [optional] | +| **city** | **String** | City | | +| **state** | **String** | US state. Required if CountryCode is \"US\". | [optional] | +| **zip** | **String** | Zip/postal code | [optional] | +| **recipient_email** | **String** | Recipient email address | [optional] | +| **account_number** | **String** | Account number | [optional] | +| **office_code** | **String** | Office code | [optional] | +| **recipient_non_us_province** | **String** | Foreign province | [optional] | +| **country_code** | **String** | Country code, as defined at https://www.irs.gov/e-file-providers/country-codes | | +| **federal_e_file** | **Boolean** | Boolean indicating that federal e-filing should be scheduled for this form | [optional] | +| **postal_mail** | **Boolean** | Boolean indicating that postal mailing to the recipient should be scheduled for this form | [optional] | +| **state_e_file** | **Boolean** | Boolean indicating that state e-filing should be scheduled for this form | [optional] | +| **tin_match** | **Boolean** | Boolean indicating that TIN Matching should be scheduled for this form | [optional] | +| **address_verification** | **Boolean** | Boolean indicating that address verification should be scheduled for this form | [optional] | +| **state_and_local_withholding** | [**StateAndLocalWithholdingRequest**](StateAndLocalWithholdingRequest.md) | State and local withholding information | [optional] | ## Example @@ -40,13 +40,13 @@ require 'avalara_sdk' instance = AvalaraSdk::A1099::V2::Form1099NecRequest.new( second_tin_notice: null, nonemployee_compensation: null, - payer_made_direct_sales: null, + direct_sales_indicator: null, federal_income_tax_withheld: null, - type: Form1099Nec, + type: 1099-NEC, issuer_id: null, reference_id: null, - recipient_name: null, recipient_tin: null, + recipient_name: null, tin_type: EIN, recipient_second_name: null, address: null, diff --git a/docs/A1099/V2/Form1099NecResponse.md b/docs/A1099/V2/Form1099NecResponse.md index 67446cd..4f17857 100644 --- a/docs/A1099/V2/Form1099NecResponse.md +++ b/docs/A1099/V2/Form1099NecResponse.md @@ -6,7 +6,7 @@ | ---- | ---- | ----------- | ----- | | **second_tin_notice** | **Boolean** | | [optional] | | **nonemployee_compensation** | **Float** | | [optional] | -| **payer_made_direct_sales** | **Boolean** | | [optional] | +| **direct_sales_indicator** | **Boolean** | | [optional] | | **federal_income_tax_withheld** | **Float** | | [optional] | | **type** | **String** | | [optional][readonly] | | **created_at** | **Time** | | [optional] | @@ -39,11 +39,11 @@ | **tin_match** | **Boolean** | | [optional] | | **address_verification** | **Boolean** | | [optional] | | **federal_efile_status** | [**StatusDetail**](StatusDetail.md) | | [optional] | -| **state_efile_status** | [**Array<StateEfileStatusDetailApp>**](StateEfileStatusDetailApp.md) | | [optional] | +| **state_efile_status** | [**Array<StateEfileStatusDetailResponse>**](StateEfileStatusDetailResponse.md) | | [optional] | | **postal_mail_status** | [**StatusDetail**](StatusDetail.md) | | [optional] | | **tin_match_status** | [**StatusDetail**](StatusDetail.md) | | [optional] | | **address_verification_status** | [**StatusDetail**](StatusDetail.md) | | [optional] | -| **validation_errors** | [**Array<ValidationErrorApp>**](ValidationErrorApp.md) | | [optional] | +| **validation_errors** | [**Array<ValidationErrorResponse>**](ValidationErrorResponse.md) | | [optional] | ## Example @@ -53,9 +53,9 @@ require 'avalara_sdk' instance = AvalaraSdk::A1099::V2::Form1099NecResponse.new( second_tin_notice: null, nonemployee_compensation: null, - payer_made_direct_sales: null, + direct_sales_indicator: null, federal_income_tax_withheld: null, - type: Form1099Nec, + type: 1099-NEC, created_at: null, updated_at: null, user_id: null, diff --git a/docs/A1099/V2/Form1099RListItem.md b/docs/A1099/V2/Form1099RListItem.md index 3ba1011..b84148e 100644 --- a/docs/A1099/V2/Form1099RListItem.md +++ b/docs/A1099/V2/Form1099RListItem.md @@ -4,51 +4,51 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **gross_distribution** | **Float** | | [optional] | -| **taxable_amount** | **Float** | | [optional] | -| **taxable_amount_not_determined** | **Boolean** | | [optional] | -| **total_distribution_determined** | **Boolean** | | [optional] | -| **capital_gain** | **Float** | | [optional] | -| **federal_income_tax_withheld** | **Float** | | [optional] | -| **employee_contributions_or_designated_roth_or_insurance_premiums** | **Float** | | [optional] | -| **net_unrealized_appreciation_in_employer_securities** | **Float** | | [optional] | -| **distribution_code** | **String** | | [optional] | -| **second_distribution_code** | **String** | | [optional] | -| **ira_sep_simple** | **Boolean** | | [optional] | -| **traditional_ira_sep_simple_or_roth_conversion_amount** | **Float** | | [optional] | -| **other_amount** | **Float** | | [optional] | -| **other_percentage** | **String** | | [optional] | -| **total_distribution_percentage** | **String** | | [optional] | -| **total_employee_contributions** | **Float** | | [optional] | -| **amount_allocable_to_irr_within5_years** | **Float** | | [optional] | -| **first_year_of_designated_roth_contribution** | **Integer** | | [optional] | -| **fatca_filing_requirement** | **Boolean** | | [optional] | -| **date_of_payment** | **Time** | | [optional] | -| **issuer_reference_id** | **String** | | [optional] | -| **issuer_tin** | **String** | | [optional] | -| **tax_year** | **Integer** | | [optional] | -| **issuer_id** | **String** | | [optional] | -| **reference_id** | **String** | | [optional] | -| **recipient_name** | **String** | | [optional] | -| **recipient_tin** | **String** | | [optional] | -| **tin_type** | **String** | | [optional] | -| **recipient_second_name** | **String** | | [optional] | -| **address** | **String** | | [optional] | -| **address2** | **String** | | [optional] | -| **city** | **String** | | [optional] | -| **state** | **String** | | [optional] | -| **zip** | **String** | | [optional] | -| **recipient_email** | **String** | | [optional] | -| **account_number** | **String** | | [optional] | -| **office_code** | **String** | | [optional] | -| **recipient_non_us_province** | **String** | | [optional] | -| **country_code** | **String** | | [optional] | -| **federal_e_file** | **Boolean** | | [optional] | -| **postal_mail** | **Boolean** | | [optional] | -| **state_e_file** | **Boolean** | | [optional] | -| **tin_match** | **Boolean** | | [optional] | -| **address_verification** | **Boolean** | | [optional] | -| **state_and_local_withholding** | [**StateAndLocalWithholdingRequest**](StateAndLocalWithholdingRequest.md) | | [optional] | +| **gross_distribution** | **Float** | Gross distribution | [optional] | +| **taxable_amount** | **Float** | Taxable amount | [optional] | +| **taxable_amount_not_determined** | **Boolean** | Taxable amount not determined | [optional] | +| **total_distribution_determined** | **Boolean** | Total distribution | [optional] | +| **capital_gain** | **Float** | Capital gain (included in Box 2a) | [optional] | +| **federal_income_tax_withheld** | **Float** | Federal income tax withheld | [optional] | +| **employee_contributions_or_designated_roth_or_insurance_premiums** | **Float** | Employee contributions/Designated Roth contributions or insurance premiums | [optional] | +| **net_unrealized_appreciation_in_employer_securities** | **Float** | Net unrealized appreciation in employer's securities | [optional] | +| **distribution_code** | **String** | Distribution code | [optional] | +| **second_distribution_code** | **String** | Second distribution code | [optional] | +| **ira_sep_simple** | **Boolean** | IRA/SEP/SIMPLE | [optional] | +| **traditional_ira_sep_simple_or_roth_conversion_amount** | **Float** | Traditional IRA/SEP/SIMPLE or Roth conversion amount | [optional] | +| **other_amount** | **Float** | Other amount | [optional] | +| **other_percentage** | **String** | Other percentage | [optional] | +| **total_distribution_percentage** | **String** | Total distribution percentage | [optional] | +| **total_employee_contributions** | **Float** | Total employee contributions | [optional] | +| **amount_allocable_to_irr_within5_years** | **Float** | Amount allocable to IRR within 5 years | [optional] | +| **first_year_of_designated_roth_contribution** | **Integer** | First year of designated Roth contribution | [optional] | +| **fatca_filing_requirement** | **Boolean** | FATCA filing requirement | [optional] | +| **date_of_payment** | **Time** | Date of payment | [optional] | +| **issuer_reference_id** | **String** | Issuer Reference ID. One of `issuerReferenceId` or `issuerTin` is required. | [optional] | +| **issuer_tin** | **String** | Issuer TIN. One of `issuerReferenceId` or `issuerTin` is required. | [optional] | +| **tax_year** | **Integer** | Tax year | | +| **issuer_id** | **String** | Issuer ID | [optional] | +| **reference_id** | **String** | Reference ID | [optional] | +| **recipient_tin** | **String** | Recipient Tax ID Number | [optional] | +| **recipient_name** | **String** | Recipient name | | +| **tin_type** | **String** | Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN | [optional] | +| **recipient_second_name** | **String** | Recipient second name | [optional] | +| **address** | **String** | Address | | +| **address2** | **String** | Address line 2 | [optional] | +| **city** | **String** | City | | +| **state** | **String** | US state. Required if CountryCode is \"US\". | [optional] | +| **zip** | **String** | Zip/postal code | [optional] | +| **recipient_email** | **String** | Recipient email address | [optional] | +| **account_number** | **String** | Account number | [optional] | +| **office_code** | **String** | Office code | [optional] | +| **recipient_non_us_province** | **String** | Foreign province | [optional] | +| **country_code** | **String** | Country code, as defined at https://www.irs.gov/e-file-providers/country-codes | | +| **federal_e_file** | **Boolean** | Boolean indicating that federal e-filing should be scheduled for this form | [optional] | +| **postal_mail** | **Boolean** | Boolean indicating that postal mailing to the recipient should be scheduled for this form | [optional] | +| **state_e_file** | **Boolean** | Boolean indicating that state e-filing should be scheduled for this form | [optional] | +| **tin_match** | **Boolean** | Boolean indicating that TIN Matching should be scheduled for this form | [optional] | +| **address_verification** | **Boolean** | Boolean indicating that address verification should be scheduled for this form | [optional] | +| **state_and_local_withholding** | [**StateAndLocalWithholdingRequest**](StateAndLocalWithholdingRequest.md) | State and local withholding information | [optional] | ## Example @@ -64,7 +64,7 @@ instance = AvalaraSdk::A1099::V2::Form1099RListItem.new( federal_income_tax_withheld: null, employee_contributions_or_designated_roth_or_insurance_premiums: null, net_unrealized_appreciation_in_employer_securities: null, - distribution_code: EarlyDistributionNoException, + distribution_code: 1, second_distribution_code: null, ira_sep_simple: null, traditional_ira_sep_simple_or_roth_conversion_amount: null, @@ -81,8 +81,8 @@ instance = AvalaraSdk::A1099::V2::Form1099RListItem.new( tax_year: null, issuer_id: null, reference_id: null, - recipient_name: null, recipient_tin: null, + recipient_name: null, tin_type: EIN, recipient_second_name: null, address: null, diff --git a/docs/A1099/V2/Form1099RListItemResponse.md b/docs/A1099/V2/Form1099RListItemResponse.md new file mode 100644 index 0000000..88a3be8 --- /dev/null +++ b/docs/A1099/V2/Form1099RListItemResponse.md @@ -0,0 +1,122 @@ +# AvalaraSdk::A1099::V2::Form1099RListItemResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **gross_distributions** | **Float** | Gross distribution | [optional] | +| **taxable_amount** | **Float** | Taxable amount | [optional] | +| **taxable_amount_not_determined** | **Boolean** | Taxable amount not determined | [optional] | +| **total_distribution_indicator** | **Boolean** | Total distribution | [optional] | +| **capital_gain** | **Float** | Capital gain (included in Box 2a) | [optional] | +| **fed_income_tax_withheld** | **Float** | Federal income tax withheld | [optional] | +| **employee_contributions** | **Float** | Employee contributions/Designated Roth contributions or insurance premiums | [optional] | +| **net_unrealized_appreciation** | **Float** | Net unrealized appreciation in employer's securities | [optional] | +| **distribution_code_required** | **String** | Distribution code | [optional] | +| **distribution_code_optional** | **String** | Second distribution code | [optional] | +| **ira_sep_simple_indicator** | **Boolean** | IRA/SEP/SIMPLE | [optional] | +| **total_ira_sep_simple_distribution** | **Float** | Traditional IRA/SEP/SIMPLE or Roth conversion amount | [optional] | +| **other** | **Float** | Other amount | [optional] | +| **other_percent** | **String** | Other percentage | [optional] | +| **percentage_total_distribution** | **String** | Total distribution percentage | [optional] | +| **total_employee_contributions** | **Float** | Total employee contributions | [optional] | +| **amount_allocable_to_irr** | **Float** | Amount allocable to IRR within 5 years | [optional] | +| **first_year_designated_roth_contrib** | **String** | First year of designated Roth contribution | [optional] | +| **fatca_requirement_indicator** | **Boolean** | FATCA filing requirement | [optional] | +| **date_of_payment** | **String** | Date of payment | [optional] | +| **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 | | +| **issuer_id** | **Integer** | Issuer ID | | +| **issuer_reference_id** | **String** | Issuer Reference ID | [optional] | +| **issuer_tin** | **String** | Issuer TIN | [optional] | +| **tax_year** | **Integer** | Tax year | [optional] | +| **federal_efile** | **Boolean** | Boolean indicating that federal e-filing has been scheduled for this form | | +| **federal_efile_status** | [**Form1099StatusDetailResponse**](Form1099StatusDetailResponse.md) | Federal e-file status | [optional][readonly] | +| **state_efile** | **Boolean** | Boolean indicating that state e-filing has been scheduled for this form | | +| **state_efile_status** | [**Array<StateEfileStatusDetailResponse>**](StateEfileStatusDetailResponse.md) | State e-file status | [optional][readonly] | +| **postal_mail** | **Boolean** | Boolean indicating that postal mailing to the recipient has been scheduled for this form | | +| **postal_mail_status** | [**Form1099StatusDetailResponse**](Form1099StatusDetailResponse.md) | Postal mail to recipient status | [optional][readonly] | +| **tin_match** | **Boolean** | Boolean indicating that TIN Matching has been scheduled for this form | | +| **tin_match_status** | [**Form1099StatusDetailResponse**](Form1099StatusDetailResponse.md) | TIN Match status | [optional][readonly] | +| **address_verification** | **Boolean** | Boolean indicating that address verification has been scheduled for this form | | +| **address_verification_status** | [**Form1099StatusDetailResponse**](Form1099StatusDetailResponse.md) | Address verification status | [optional][readonly] | +| **reference_id** | **String** | Reference ID | [optional] | +| **email** | **String** | Recipient email address | [optional] | +| **tin_type** | **String** | Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN | [optional] | +| **tin** | **String** | Recipient Tax ID Number | [optional] | +| **recipient_name** | **String** | Recipient name | [optional] | +| **recipient_second_name** | **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] | +| **foreign_province** | **String** | Foreign province | [optional] | +| **country_code** | **String** | Country code, as defined at https://www.irs.gov/e-file-providers/country-codes | [optional] | +| **validation_errors** | [**Array<ValidationErrorResponse>**](ValidationErrorResponse.md) | Validation errors | [optional][readonly] | +| **created_at** | **Time** | Creation time | [optional][readonly] | +| **updated_at** | **Time** | Update time | [optional][readonly] | +| **state_and_local_withholding** | [**StateAndLocalWithholdingResponse**](StateAndLocalWithholdingResponse.md) | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::Form1099RListItemResponse.new( + gross_distributions: 8004.12, + taxable_amount: null, + taxable_amount_not_determined: null, + total_distribution_indicator: null, + capital_gain: null, + fed_income_tax_withheld: null, + employee_contributions: null, + net_unrealized_appreciation: null, + distribution_code_required: 7, + distribution_code_optional: null, + ira_sep_simple_indicator: null, + total_ira_sep_simple_distribution: null, + other: null, + other_percent: null, + percentage_total_distribution: null, + total_employee_contributions: null, + amount_allocable_to_irr: null, + first_year_designated_roth_contrib: null, + fatca_requirement_indicator: null, + date_of_payment: null, + id: 123456789, + type: 1099-NEC, + issuer_id: 987654321, + issuer_reference_id: R-3898734, + issuer_tin: 59-387274, + tax_year: 2024, + federal_efile: false, + federal_efile_status: null, + state_efile: false, + state_efile_status: null, + postal_mail: false, + postal_mail_status: null, + tin_match: false, + tin_match_status: null, + address_verification: false, + address_verification_status: null, + reference_id: 1891810-9819891, + email: roadrunner@acmecorp.com, + tin_type: null, + tin: null, + recipient_name: null, + recipient_second_name: null, + address: 1234 Meep Meep Blvd, + address2: null, + city: Tucson, + state: AZ, + zip: 35004, + foreign_province: , + country_code: US, + validation_errors: null, + created_at: 2025-07-29T15:47:39.396860Z, + updated_at: 2025-07-29T15:47:39.396860500Z, + state_and_local_withholding: null +) +``` + diff --git a/docs/A1099/V2/Form1099RRequest.md b/docs/A1099/V2/Form1099RRequest.md index fd36339..54e17eb 100644 --- a/docs/A1099/V2/Form1099RRequest.md +++ b/docs/A1099/V2/Form1099RRequest.md @@ -4,49 +4,49 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **gross_distribution** | **Float** | | [optional] | -| **taxable_amount** | **Float** | | [optional] | -| **taxable_amount_not_determined** | **Boolean** | | [optional] | -| **total_distribution_determined** | **Boolean** | | [optional] | -| **capital_gain** | **Float** | | [optional] | -| **federal_income_tax_withheld** | **Float** | | [optional] | -| **employee_contributions_or_designated_roth_or_insurance_premiums** | **Float** | | [optional] | -| **net_unrealized_appreciation_in_employer_securities** | **Float** | | [optional] | -| **distribution_code** | **String** | | [optional] | -| **second_distribution_code** | **String** | | [optional] | -| **ira_sep_simple** | **Boolean** | | [optional] | -| **traditional_ira_sep_simple_or_roth_conversion_amount** | **Float** | | [optional] | -| **other_amount** | **Float** | | [optional] | -| **other_percentage** | **String** | | [optional] | -| **total_distribution_percentage** | **String** | | [optional] | -| **total_employee_contributions** | **Float** | | [optional] | -| **amount_allocable_to_irr_within5_years** | **Float** | | [optional] | -| **first_year_of_designated_roth_contribution** | **String** | | [optional] | -| **fatca_filing_requirement** | **Boolean** | | [optional] | -| **date_of_payment** | **Time** | | [optional] | -| **type** | **String** | | [optional][readonly] | -| **issuer_id** | **String** | | [optional] | -| **reference_id** | **String** | | [optional] | -| **recipient_name** | **String** | | [optional] | -| **recipient_tin** | **String** | | [optional] | -| **tin_type** | **String** | | [optional] | -| **recipient_second_name** | **String** | | [optional] | -| **address** | **String** | | [optional] | -| **address2** | **String** | | [optional] | -| **city** | **String** | | [optional] | -| **state** | **String** | | [optional] | -| **zip** | **String** | | [optional] | -| **recipient_email** | **String** | | [optional] | -| **account_number** | **String** | | [optional] | -| **office_code** | **String** | | [optional] | -| **recipient_non_us_province** | **String** | | [optional] | -| **country_code** | **String** | | [optional] | -| **federal_e_file** | **Boolean** | | [optional] | -| **postal_mail** | **Boolean** | | [optional] | -| **state_e_file** | **Boolean** | | [optional] | -| **tin_match** | **Boolean** | | [optional] | -| **address_verification** | **Boolean** | | [optional] | -| **state_and_local_withholding** | [**StateAndLocalWithholdingRequest**](StateAndLocalWithholdingRequest.md) | | [optional] | +| **gross_distribution** | **Float** | Gross distribution | [optional] | +| **taxable_amount** | **Float** | Taxable amount | [optional] | +| **taxable_amount_not_determined** | **Boolean** | Taxable amount not determined | [optional] | +| **total_distribution_determined** | **Boolean** | Total distribution | [optional] | +| **capital_gain** | **Float** | Capital gain (included in Box 2a) | [optional] | +| **federal_income_tax_withheld** | **Float** | Federal income tax withheld | [optional] | +| **employee_contributions_or_designated_roth_or_insurance_premiums** | **Float** | Employee contributions/Designated Roth contributions or insurance premiums | [optional] | +| **net_unrealized_appreciation_in_employer_securities** | **Float** | Net unrealized appreciation in employer's securities | [optional] | +| **distribution_code** | **String** | Distribution code | [optional] | +| **second_distribution_code** | **String** | Second distribution code | [optional] | +| **ira_sep_simple** | **Boolean** | IRA/SEP/SIMPLE | [optional] | +| **traditional_ira_sep_simple_or_roth_conversion_amount** | **Float** | Traditional IRA/SEP/SIMPLE or Roth conversion amount | [optional] | +| **other_amount** | **Float** | Other amount | [optional] | +| **other_percentage** | **String** | Other percentage | [optional] | +| **total_distribution_percentage** | **String** | Total distribution percentage | [optional] | +| **total_employee_contributions** | **Float** | Total employee contributions | [optional] | +| **amount_allocable_to_irr_within5_years** | **Float** | Amount allocable to IRR within 5 years | [optional] | +| **first_year_of_designated_roth_contribution** | **String** | First year of designated Roth contribution | [optional] | +| **fatca_filing_requirement** | **Boolean** | FATCA filing requirement | [optional] | +| **date_of_payment** | **Time** | Date of payment | [optional] | +| **type** | **String** | | [optional] | +| **issuer_id** | **String** | Issuer ID | [optional] | +| **reference_id** | **String** | Reference ID | [optional] | +| **recipient_tin** | **String** | Recipient Tax ID Number | [optional] | +| **recipient_name** | **String** | Recipient name | | +| **tin_type** | **String** | Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN | [optional] | +| **recipient_second_name** | **String** | Recipient second name | [optional] | +| **address** | **String** | Address | | +| **address2** | **String** | Address line 2 | [optional] | +| **city** | **String** | City | | +| **state** | **String** | US state. Required if CountryCode is \"US\". | [optional] | +| **zip** | **String** | Zip/postal code | [optional] | +| **recipient_email** | **String** | Recipient email address | [optional] | +| **account_number** | **String** | Account number | [optional] | +| **office_code** | **String** | Office code | [optional] | +| **recipient_non_us_province** | **String** | Foreign province | [optional] | +| **country_code** | **String** | Country code, as defined at https://www.irs.gov/e-file-providers/country-codes | | +| **federal_e_file** | **Boolean** | Boolean indicating that federal e-filing should be scheduled for this form | [optional] | +| **postal_mail** | **Boolean** | Boolean indicating that postal mailing to the recipient should be scheduled for this form | [optional] | +| **state_e_file** | **Boolean** | Boolean indicating that state e-filing should be scheduled for this form | [optional] | +| **tin_match** | **Boolean** | Boolean indicating that TIN Matching should be scheduled for this form | [optional] | +| **address_verification** | **Boolean** | Boolean indicating that address verification should be scheduled for this form | [optional] | +| **state_and_local_withholding** | [**StateAndLocalWithholdingRequest**](StateAndLocalWithholdingRequest.md) | State and local withholding information | [optional] | ## Example @@ -74,11 +74,11 @@ instance = AvalaraSdk::A1099::V2::Form1099RRequest.new( first_year_of_designated_roth_contribution: null, fatca_filing_requirement: null, date_of_payment: null, - type: Form1099Nec, + type: 1099-NEC, issuer_id: null, reference_id: null, - recipient_name: null, recipient_tin: null, + recipient_name: null, tin_type: EIN, recipient_second_name: null, address: null, diff --git a/docs/A1099/V2/Form1099StatusDetailResponse.md b/docs/A1099/V2/Form1099StatusDetailResponse.md new file mode 100644 index 0000000..5d3020e --- /dev/null +++ b/docs/A1099/V2/Form1099StatusDetailResponse.md @@ -0,0 +1,20 @@ +# AvalaraSdk::A1099::V2::Form1099StatusDetailResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **time** | **String** | The date the form is scheduled for or the time the status last changed | [optional] | +| **status** | **String** | The status of the form. Will be one of: * unsent * scheduled * sent * corrected_scheduled * accepted * corrected * corrected_accepted * held * pending * delivered * bad_verify * bad_verify_limit * bounced * verified * incomplete * failed * unchanged * unknown | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::Form1099StatusDetailResponse.new( + time: 2025-07-29T15:47:39.3790485Z, + status: accepted +) +``` + diff --git a/docs/A1099/V2/FormRequestBase.md b/docs/A1099/V2/FormRequestBase.md index c3185c1..f5859ad 100644 --- a/docs/A1099/V2/FormRequestBase.md +++ b/docs/A1099/V2/FormRequestBase.md @@ -4,28 +4,28 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **issuer_id** | **String** | | [optional] | -| **reference_id** | **String** | | [optional] | -| **recipient_name** | **String** | | [optional] | -| **recipient_tin** | **String** | | [optional] | -| **tin_type** | **String** | | [optional] | -| **recipient_second_name** | **String** | | [optional] | -| **address** | **String** | | [optional] | -| **address2** | **String** | | [optional] | -| **city** | **String** | | [optional] | -| **state** | **String** | | [optional] | -| **zip** | **String** | | [optional] | -| **recipient_email** | **String** | | [optional] | -| **account_number** | **String** | | [optional] | -| **office_code** | **String** | | [optional] | -| **recipient_non_us_province** | **String** | | [optional] | -| **country_code** | **String** | | [optional] | -| **federal_e_file** | **Boolean** | | [optional] | -| **postal_mail** | **Boolean** | | [optional] | -| **state_e_file** | **Boolean** | | [optional] | -| **tin_match** | **Boolean** | | [optional] | -| **address_verification** | **Boolean** | | [optional] | -| **state_and_local_withholding** | [**StateAndLocalWithholdingRequest**](StateAndLocalWithholdingRequest.md) | | [optional] | +| **issuer_id** | **String** | Issuer ID | [optional] | +| **reference_id** | **String** | Reference ID | [optional] | +| **recipient_tin** | **String** | Recipient Tax ID Number | [optional] | +| **recipient_name** | **String** | Recipient name | | +| **tin_type** | **String** | Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN | [optional] | +| **recipient_second_name** | **String** | Recipient second name | [optional] | +| **address** | **String** | Address | | +| **address2** | **String** | Address line 2 | [optional] | +| **city** | **String** | City | | +| **state** | **String** | US state. Required if CountryCode is \"US\". | [optional] | +| **zip** | **String** | Zip/postal code | [optional] | +| **recipient_email** | **String** | Recipient email address | [optional] | +| **account_number** | **String** | Account number | [optional] | +| **office_code** | **String** | Office code | [optional] | +| **recipient_non_us_province** | **String** | Foreign province | [optional] | +| **country_code** | **String** | Country code, as defined at https://www.irs.gov/e-file-providers/country-codes | | +| **federal_e_file** | **Boolean** | Boolean indicating that federal e-filing should be scheduled for this form | [optional] | +| **postal_mail** | **Boolean** | Boolean indicating that postal mailing to the recipient should be scheduled for this form | [optional] | +| **state_e_file** | **Boolean** | Boolean indicating that state e-filing should be scheduled for this form | [optional] | +| **tin_match** | **Boolean** | Boolean indicating that TIN Matching should be scheduled for this form | [optional] | +| **address_verification** | **Boolean** | Boolean indicating that address verification should be scheduled for this form | [optional] | +| **state_and_local_withholding** | [**StateAndLocalWithholdingRequest**](StateAndLocalWithholdingRequest.md) | State and local withholding information | [optional] | ## Example @@ -35,8 +35,8 @@ require 'avalara_sdk' instance = AvalaraSdk::A1099::V2::FormRequestBase.new( issuer_id: null, reference_id: null, - recipient_name: null, recipient_tin: null, + recipient_name: null, tin_type: EIN, recipient_second_name: null, address: null, diff --git a/docs/A1099/V2/FormRequestListItemBase.md b/docs/A1099/V2/FormRequestListItemBase.md new file mode 100644 index 0000000..0100446 --- /dev/null +++ b/docs/A1099/V2/FormRequestListItemBase.md @@ -0,0 +1,66 @@ +# AvalaraSdk::A1099::V2::FormRequestListItemBase + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **issuer_reference_id** | **String** | Issuer Reference ID. One of `issuerReferenceId` or `issuerTin` is required. | [optional] | +| **issuer_tin** | **String** | Issuer TIN. One of `issuerReferenceId` or `issuerTin` is required. | [optional] | +| **tax_year** | **Integer** | Tax year | | +| **issuer_id** | **String** | Issuer ID | [optional] | +| **reference_id** | **String** | Reference ID | [optional] | +| **recipient_tin** | **String** | Recipient Tax ID Number | [optional] | +| **recipient_name** | **String** | Recipient name | | +| **tin_type** | **String** | Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN | [optional] | +| **recipient_second_name** | **String** | Recipient second name | [optional] | +| **address** | **String** | Address | | +| **address2** | **String** | Address line 2 | [optional] | +| **city** | **String** | City | | +| **state** | **String** | US state. Required if CountryCode is \"US\". | [optional] | +| **zip** | **String** | Zip/postal code | [optional] | +| **recipient_email** | **String** | Recipient email address | [optional] | +| **account_number** | **String** | Account number | [optional] | +| **office_code** | **String** | Office code | [optional] | +| **recipient_non_us_province** | **String** | Foreign province | [optional] | +| **country_code** | **String** | Country code, as defined at https://www.irs.gov/e-file-providers/country-codes | | +| **federal_e_file** | **Boolean** | Boolean indicating that federal e-filing should be scheduled for this form | [optional] | +| **postal_mail** | **Boolean** | Boolean indicating that postal mailing to the recipient should be scheduled for this form | [optional] | +| **state_e_file** | **Boolean** | Boolean indicating that state e-filing should be scheduled for this form | [optional] | +| **tin_match** | **Boolean** | Boolean indicating that TIN Matching should be scheduled for this form | [optional] | +| **address_verification** | **Boolean** | Boolean indicating that address verification should be scheduled for this form | [optional] | +| **state_and_local_withholding** | [**StateAndLocalWithholdingRequest**](StateAndLocalWithholdingRequest.md) | State and local withholding information | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::FormRequestListItemBase.new( + issuer_reference_id: null, + issuer_tin: null, + tax_year: null, + issuer_id: null, + reference_id: null, + recipient_tin: null, + recipient_name: null, + tin_type: EIN, + recipient_second_name: null, + address: null, + address2: null, + city: null, + state: null, + zip: null, + recipient_email: null, + account_number: null, + office_code: null, + recipient_non_us_province: null, + country_code: null, + federal_e_file: null, + postal_mail: null, + state_e_file: null, + tin_match: null, + address_verification: null, + state_and_local_withholding: null +) +``` + diff --git a/docs/A1099/V2/FormResponseBase.md b/docs/A1099/V2/FormResponseBase.md index b2872c4..32c374b 100644 --- a/docs/A1099/V2/FormResponseBase.md +++ b/docs/A1099/V2/FormResponseBase.md @@ -35,11 +35,11 @@ | **tin_match** | **Boolean** | | [optional] | | **address_verification** | **Boolean** | | [optional] | | **federal_efile_status** | [**StatusDetail**](StatusDetail.md) | | [optional] | -| **state_efile_status** | [**Array<StateEfileStatusDetailApp>**](StateEfileStatusDetailApp.md) | | [optional] | +| **state_efile_status** | [**Array<StateEfileStatusDetailResponse>**](StateEfileStatusDetailResponse.md) | | [optional] | | **postal_mail_status** | [**StatusDetail**](StatusDetail.md) | | [optional] | | **tin_match_status** | [**StatusDetail**](StatusDetail.md) | | [optional] | | **address_verification_status** | [**StatusDetail**](StatusDetail.md) | | [optional] | -| **validation_errors** | [**Array<ValidationErrorApp>**](ValidationErrorApp.md) | | [optional] | +| **validation_errors** | [**Array<ValidationErrorResponse>**](ValidationErrorResponse.md) | | [optional] | ## Example @@ -47,7 +47,7 @@ require 'avalara_sdk' instance = AvalaraSdk::A1099::V2::FormResponseBase.new( - type: Form1099Nec, + type: 1099-NEC, created_at: null, updated_at: null, user_id: null, diff --git a/docs/A1099/V2/FormSingleRequestBase.md b/docs/A1099/V2/FormSingleRequestBase.md index aa6e8f6..9e19a9f 100644 --- a/docs/A1099/V2/FormSingleRequestBase.md +++ b/docs/A1099/V2/FormSingleRequestBase.md @@ -4,29 +4,29 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **type** | **String** | | [optional][readonly] | -| **issuer_id** | **String** | | [optional] | -| **reference_id** | **String** | | [optional] | -| **recipient_name** | **String** | | [optional] | -| **recipient_tin** | **String** | | [optional] | -| **tin_type** | **String** | | [optional] | -| **recipient_second_name** | **String** | | [optional] | -| **address** | **String** | | [optional] | -| **address2** | **String** | | [optional] | -| **city** | **String** | | [optional] | -| **state** | **String** | | [optional] | -| **zip** | **String** | | [optional] | -| **recipient_email** | **String** | | [optional] | -| **account_number** | **String** | | [optional] | -| **office_code** | **String** | | [optional] | -| **recipient_non_us_province** | **String** | | [optional] | -| **country_code** | **String** | | [optional] | -| **federal_e_file** | **Boolean** | | [optional] | -| **postal_mail** | **Boolean** | | [optional] | -| **state_e_file** | **Boolean** | | [optional] | -| **tin_match** | **Boolean** | | [optional] | -| **address_verification** | **Boolean** | | [optional] | -| **state_and_local_withholding** | [**StateAndLocalWithholdingRequest**](StateAndLocalWithholdingRequest.md) | | [optional] | +| **type** | **String** | | [optional] | +| **issuer_id** | **String** | Issuer ID | [optional] | +| **reference_id** | **String** | Reference ID | [optional] | +| **recipient_tin** | **String** | Recipient Tax ID Number | [optional] | +| **recipient_name** | **String** | Recipient name | | +| **tin_type** | **String** | Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN | [optional] | +| **recipient_second_name** | **String** | Recipient second name | [optional] | +| **address** | **String** | Address | | +| **address2** | **String** | Address line 2 | [optional] | +| **city** | **String** | City | | +| **state** | **String** | US state. Required if CountryCode is \"US\". | [optional] | +| **zip** | **String** | Zip/postal code | [optional] | +| **recipient_email** | **String** | Recipient email address | [optional] | +| **account_number** | **String** | Account number | [optional] | +| **office_code** | **String** | Office code | [optional] | +| **recipient_non_us_province** | **String** | Foreign province | [optional] | +| **country_code** | **String** | Country code, as defined at https://www.irs.gov/e-file-providers/country-codes | | +| **federal_e_file** | **Boolean** | Boolean indicating that federal e-filing should be scheduled for this form | [optional] | +| **postal_mail** | **Boolean** | Boolean indicating that postal mailing to the recipient should be scheduled for this form | [optional] | +| **state_e_file** | **Boolean** | Boolean indicating that state e-filing should be scheduled for this form | [optional] | +| **tin_match** | **Boolean** | Boolean indicating that TIN Matching should be scheduled for this form | [optional] | +| **address_verification** | **Boolean** | Boolean indicating that address verification should be scheduled for this form | [optional] | +| **state_and_local_withholding** | [**StateAndLocalWithholdingRequest**](StateAndLocalWithholdingRequest.md) | State and local withholding information | [optional] | ## Example @@ -34,11 +34,11 @@ require 'avalara_sdk' instance = AvalaraSdk::A1099::V2::FormSingleRequestBase.new( - type: Form1099Nec, + type: 1099-NEC, issuer_id: null, reference_id: null, - recipient_name: null, recipient_tin: null, + recipient_name: null, tin_type: EIN, recipient_second_name: null, address: null, diff --git a/docs/A1099/V2/Forms1099Api.md b/docs/A1099/V2/Forms1099Api.md index 793edfd..1a4831f 100644 --- a/docs/A1099/V2/Forms1099Api.md +++ b/docs/A1099/V2/Forms1099Api.md @@ -4,22 +4,22 @@ All URIs are relative to *https://api-ava1099.eta.sbx.us-east-1.aws.avalara.io/a | Method | HTTP request | Description | | ------ | ------------ | ----------- | -| [**bulk_upsert1099_forms**](Forms1099Api.md#bulk_upsert1099_forms) | **POST** /1099/forms/$bulk-upsert | Creates or updates multiple 1099 forms. | -| [**create1099_form**](Forms1099Api.md#create1099_form) | **POST** /1099/forms | Creates a 1099 form. | -| [**delete1099_form**](Forms1099Api.md#delete1099_form) | **DELETE** /1099/forms/{id} | Deletes a 1099 form. | -| [**get1099_form**](Forms1099Api.md#get1099_form) | **GET** /1099/forms/{id} | Retrieves a 1099 form. | -| [**get1099_form_pdf**](Forms1099Api.md#get1099_form_pdf) | **GET** /1099/forms/{id}/pdf | Retrieves the PDF file for a single 1099 by form id. | -| [**list1099_forms**](Forms1099Api.md#list1099_forms) | **GET** /1099/forms | Retrieves a list of 1099 forms based on query parameters. | -| [**update1099_form**](Forms1099Api.md#update1099_form) | **PUT** /1099/forms/{id} | Updates a 1099 form. | +| [**bulk_upsert1099_forms**](Forms1099Api.md#bulk_upsert1099_forms) | **POST** /1099/forms/$bulk-upsert | Create or update multiple 1099/1095/W2/1042S forms | +| [**create1099_form**](Forms1099Api.md#create1099_form) | **POST** /1099/forms | Create a 1099/1095/W2/1042S form | +| [**delete1099_form**](Forms1099Api.md#delete1099_form) | **DELETE** /1099/forms/{id} | Delete a 1099/1095/W2/1042S form | +| [**get1099_form**](Forms1099Api.md#get1099_form) | **GET** /1099/forms/{id} | Retrieve a 1099/1095/W2/1042S form | +| [**get1099_form_pdf**](Forms1099Api.md#get1099_form_pdf) | **GET** /1099/forms/{id}/pdf | Retrieve the PDF file for a 1099/1095/W2/1042S form | +| [**list1099_forms**](Forms1099Api.md#list1099_forms) | **GET** /1099/forms | List 1099/1095/W2/1042S forms | +| [**update1099_form**](Forms1099Api.md#update1099_form) | **PUT** /1099/forms/{id} | Update a 1099/1095/W2/1042S form | ## bulk_upsert1099_forms > bulk_upsert1099_forms(avalara_version, opts) -Creates or updates multiple 1099 forms. +Create or update multiple 1099/1095/W2/1042S forms -This endpoint allows you to create or update multiple 1099 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\": \"987-65-4321\", \"TinType\": \"IEN\", \"RecipientSecondName\": \"Jane Doe\", \"Address\": \"123 Main Street\", \"Address2\": \"Apt 4B\", \"City\": \"New York\", \"State\": \"NY\", \"Zip\": \"10001\", \"RecipientEmail\": \"john.doe@email.com\", \"AccountNumber\": \"ACC123456\", \"OfficeCode\": \"NYC01\", \"SecondTinNotice\": false, \"RecipientNonUsProvince\": \"\", \"CountryCode\": \"US\", \"Rents\": 12000.00, \"Royalties\": 5000.00, \"OtherIncome\": 3000.00, \"FishingBoatProceeds\": 0.00, \"MedicalHealthCarePayments\": 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, \"PayerMadeDirectSales\": 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\": \"987-65-4321\", \"tinType\": \"IEN\", \"address\": \"123 Center St\", \"address2\": \"\", \"city\": \"Santa Monica\", \"state\": \"CA\", \"zip\": \"90401\", \"countryCode\": \"US\", \"recipientNonUsProvince\": \"\", \"recipientEmail\": \"\", \"accountNumber\": \"\", \"officeCode\": \"\", \"secondTinNotice\": false, \"nonemployeeCompensation\": 123.45, \"payerMadeDirectSales\": 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. 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\", \"RecipientEmail\": \"john.doe@email.com\", \"AccountNumber\": \"ACC123456\", \"OfficeCode\": \"NYC01\", \"SecondTinNotice\": false, \"RecipientNonUsProvince\": \"\", \"CountryCode\": \"US\", \"Rents\": 12000.00, \"Royalties\": 5000.00, \"OtherIncome\": 3000.00, \"FishingBoatProceeds\": 0.00, \"MedicalHealthCarePayments\": 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\", \"recipientNonUsProvince\": \"\", \"recipientEmail\": \"\", \"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. ### Examples @@ -39,16 +39,16 @@ end api_client = AvalaraSdk::ApiClient.new config api_instance = AvalaraSdk::A1099::V2::Forms1099Api.new api_client -avalara_version = '2.0' # String | API version +avalara_version = '2.0.0' # String | API version opts = { dry_run: true, # Boolean | - x_correlation_id: 'e5719e20-8805-4ccc-b626-013045304315', # String | Unique correlation Id in a GUID format + x_correlation_id: '032e11a9-1930-48bc-9cd5-865dfeb5f8bb', # String | Unique correlation Id in a GUID format x_avalara_client: '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/) . - bulk_upsert1099_forms_request: AvalaraSdk::A1099::V2::Form1095BList.new # BulkUpsert1099FormsRequest | + bulk_upsert1099_forms_request: AvalaraSdk::A1099::V2::Form1042SList.new # BulkUpsert1099FormsRequest | } begin - # Creates or updates multiple 1099 forms. + # Create or update multiple 1099/1095/W2/1042S forms result = api_instance.bulk_upsert1099_forms(avalara_version, opts) p result rescue AvalaraSdk::ApiError => e @@ -64,7 +64,7 @@ This returns an Array which contains the response data, status code and headers. ```ruby begin - # Creates or updates multiple 1099 forms. + # Create or update multiple 1099/1095/W2/1042S forms data, status_code, headers = api_instance.bulk_upsert1099_forms_with_http_info(avalara_version, opts) p status_code # => 2xx p headers # => { ... } @@ -100,9 +100,11 @@ end ## create1099_form -> create1099_form(avalara_version, opts) +> create1099_form(avalara_version, opts) -Creates a 1099 form. +Create a 1099/1095/W2/1042S form + +Create a 1099/1095/W2/1042S form. ### Examples @@ -122,15 +124,15 @@ end api_client = AvalaraSdk::ApiClient.new config api_instance = AvalaraSdk::A1099::V2::Forms1099Api.new api_client -avalara_version = '2.0' # String | API version +avalara_version = '2.0.0' # String | API version opts = { - x_correlation_id: '6095f693-4fb2-48c8-b6e5-c7ab4611f673', # String | Unique correlation Id in a GUID format + x_correlation_id: '2a525a1d-2ac8-4894-87a5-1bd347d76b1c', # String | Unique correlation Id in a GUID format x_avalara_client: '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/) . - i_create_form1099_request: AvalaraSdk::A1099::V2::Form1099DivRequest.new # ICreateForm1099Request | + i_create_form1099_request: AvalaraSdk::A1099::V2::Form1099DivRequest.new({recipient_name: 'recipient_name_example', address: 'address_example', city: 'city_example', country_code: 'country_code_example'}) # ICreateForm1099Request | } begin - # Creates a 1099 form. + # Create a 1099/1095/W2/1042S form result = api_instance.create1099_form(avalara_version, opts) p result rescue AvalaraSdk::ApiError => e @@ -142,15 +144,15 @@ end This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> create1099_form_with_http_info(avalara_version, opts) +> , Integer, Hash)> create1099_form_with_http_info(avalara_version, opts) ```ruby begin - # Creates a 1099 form. + # Create a 1099/1095/W2/1042S form data, status_code, headers = api_instance.create1099_form_with_http_info(avalara_version, opts) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => rescue AvalaraSdk::A1099::V2::ApiError => e puts "Error when calling Forms1099Api->create1099_form_with_http_info: #{e}" end @@ -167,7 +169,7 @@ end ### Return type -[**Get1099Form200Response**](Get1099Form200Response.md) +[**Create1099Form201Response**](Create1099Form201Response.md) ### Authorization @@ -183,7 +185,9 @@ end > delete1099_form(id, avalara_version, opts) -Deletes a 1099 form. +Delete a 1099/1095/W2/1042S form + +Delete a 1099/1095/W2/1042S form. ### Examples @@ -204,14 +208,14 @@ api_client = AvalaraSdk::ApiClient.new config api_instance = AvalaraSdk::A1099::V2::Forms1099Api.new api_client id = 'id_example' # String | The unique identifier of the desired form to delete. -avalara_version = '2.0' # String | API version +avalara_version = '2.0.0' # String | API version opts = { - x_correlation_id: '15d84d4b-81ef-4d59-af08-94e94dc49322', # String | Unique correlation Id in a GUID format + x_correlation_id: 'ba633be6-e650-424e-a01c-28c6693b9e3a', # String | Unique correlation Id in a GUID format x_avalara_client: '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/) . } begin - # Deletes a 1099 form. + # Delete a 1099/1095/W2/1042S form api_instance.delete1099_form(id, avalara_version, opts) rescue AvalaraSdk::ApiError => e puts "Error when calling Forms1099Api->delete1099_form: #{e}" @@ -226,7 +230,7 @@ This returns an Array which contains the response data (`nil` in this case), sta ```ruby begin - # Deletes a 1099 form. + # Delete a 1099/1095/W2/1042S form data, status_code, headers = api_instance.delete1099_form_with_http_info(id, avalara_version, opts) p status_code # => 2xx p headers # => { ... } @@ -263,7 +267,9 @@ nil (empty response body) > get1099_form(id, avalara_version, opts) -Retrieves a 1099 form. +Retrieve a 1099/1095/W2/1042S form + +Retrieve a 1099/1095/W2/1042S form. ### Examples @@ -284,14 +290,14 @@ api_client = AvalaraSdk::ApiClient.new config api_instance = AvalaraSdk::A1099::V2::Forms1099Api.new api_client id = 'id_example' # String | -avalara_version = '2.0' # String | API version +avalara_version = '2.0.0' # String | API version opts = { - x_correlation_id: '72e6716a-27d0-4cd0-8a93-a9aaef422691', # String | Unique correlation Id in a GUID format + x_correlation_id: 'f311cf9a-de50-4d53-9663-bdf93020dd26', # String | Unique correlation Id in a GUID format x_avalara_client: '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/) . } begin - # Retrieves a 1099 form. + # Retrieve a 1099/1095/W2/1042S form result = api_instance.get1099_form(id, avalara_version, opts) p result rescue AvalaraSdk::ApiError => e @@ -307,7 +313,7 @@ This returns an Array which contains the response data, status code and headers. ```ruby begin - # Retrieves a 1099 form. + # Retrieve a 1099/1095/W2/1042S form data, status_code, headers = api_instance.get1099_form_with_http_info(id, avalara_version, opts) p status_code # => 2xx p headers # => { ... } @@ -342,9 +348,11 @@ end ## get1099_form_pdf -> get1099_form_pdf(id, avalara_version, opts) +> File get1099_form_pdf(id, avalara_version, opts) + +Retrieve the PDF file for a 1099/1095/W2/1042S form -Retrieves the PDF file for a single 1099 by form id. +Retrieve the PDF file for a 1099/1095/W2/1042S form. ### Examples @@ -364,16 +372,16 @@ end api_client = AvalaraSdk::ApiClient.new config api_instance = AvalaraSdk::A1099::V2::Forms1099Api.new api_client -id = 'id_example' # String | -avalara_version = '2.0' # String | API version +id = 'id_example' # String | The ID of the form +avalara_version = '2.0.0' # String | API version opts = { - mark_edelivered: true, # Boolean | The parameter for marked e-delivered - x_correlation_id: '782ecb31-ec05-4880-a431-bd7a890e63e6', # String | Unique correlation Id in a GUID format + mark_edelivered: true, # Boolean | Optional boolean that if set indicates that the form should be marked as having been successfully edelivered + x_correlation_id: 'a1c63b5e-c575-4315-90ad-0ac98e71a981', # String | Unique correlation Id in a GUID format x_avalara_client: '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/) . } begin - # Retrieves the PDF file for a single 1099 by form id. + # Retrieve the PDF file for a 1099/1095/W2/1042S form result = api_instance.get1099_form_pdf(id, avalara_version, opts) p result rescue AvalaraSdk::ApiError => e @@ -385,15 +393,15 @@ end This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> get1099_form_pdf_with_http_info(id, avalara_version, opts) +> get1099_form_pdf_with_http_info(id, avalara_version, opts) ```ruby begin - # Retrieves the PDF file for a single 1099 by form id. + # Retrieve the PDF file for a 1099/1095/W2/1042S form data, status_code, headers = api_instance.get1099_form_pdf_with_http_info(id, avalara_version, opts) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => File rescue AvalaraSdk::A1099::V2::ApiError => e puts "Error when calling Forms1099Api->get1099_form_pdf_with_http_info: #{e}" end @@ -403,15 +411,15 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **id** | **String** | | | +| **id** | **String** | The ID of the form | | | **avalara_version** | **String** | API version | | -| **mark_edelivered** | **Boolean** | The parameter for marked e-delivered | [optional] | +| **mark_edelivered** | **Boolean** | Optional boolean that if set indicates that the form should be marked as having been successfully edelivered | [optional] | | **x_correlation_id** | **String** | Unique correlation Id in a GUID format | [optional] | | **x_avalara_client** | **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 -[**Update1099Form200Response**](Update1099Form200Response.md) +**File** ### Authorization @@ -420,14 +428,16 @@ end ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: application/pdf, application/json ## list1099_forms -> list1099_forms(avalara_version, opts) +> list1099_forms(avalara_version, opts) + +List 1099/1095/W2/1042S forms -Retrieves a list of 1099 forms based on query parameters. +List 1099/1095/W2/1042S forms. Filterable fields are name, referenceId and taxYear. ### Examples @@ -447,18 +457,18 @@ end api_client = AvalaraSdk::ApiClient.new config api_instance = AvalaraSdk::A1099::V2::Forms1099Api.new api_client -avalara_version = '2.0' # String | API version +avalara_version = '2.0.0' # String | API version opts = { filter: 'filter_example', # 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 top: 56, # 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. skip: 56, # Integer | If nonzero, skip this number of results before returning data. Used with top to provide pagination for large datasets. order_by: 'order_by_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 - x_correlation_id: '3023fd6b-afc3-488f-ad85-1dd9f72d9f64', # String | Unique correlation Id in a GUID format + x_correlation_id: '443e5440-659c-4f7d-865e-fd185b0ed923', # String | Unique correlation Id in a GUID format x_avalara_client: '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/) . } begin - # Retrieves a list of 1099 forms based on query parameters. + # List 1099/1095/W2/1042S forms result = api_instance.list1099_forms(avalara_version, opts) p result rescue AvalaraSdk::ApiError => e @@ -470,15 +480,15 @@ end This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> list1099_forms_with_http_info(avalara_version, opts) +> , Integer, Hash)> list1099_forms_with_http_info(avalara_version, opts) ```ruby begin - # Retrieves a list of 1099 forms based on query parameters. + # List 1099/1095/W2/1042S forms data, status_code, headers = api_instance.list1099_forms_with_http_info(avalara_version, opts) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => rescue AvalaraSdk::A1099::V2::ApiError => e puts "Error when calling Forms1099Api->list1099_forms_with_http_info: #{e}" end @@ -498,7 +508,7 @@ end ### Return type -[**Form1099List**](Form1099List.md) +[**Form1099ListResponse**](Form1099ListResponse.md) ### Authorization @@ -514,7 +524,9 @@ end > update1099_form(id, avalara_version, opts) -Updates a 1099 form. +Update a 1099/1095/W2/1042S form + +Update a 1099/1095/W2/1042S form. ### Examples @@ -535,15 +547,15 @@ api_client = AvalaraSdk::ApiClient.new config api_instance = AvalaraSdk::A1099::V2::Forms1099Api.new api_client id = 'id_example' # String | -avalara_version = '2.0' # String | API version +avalara_version = '2.0.0' # String | API version opts = { - x_correlation_id: '6a610d02-ab2b-4ef8-9554-5149445333f1', # String | Unique correlation Id in a GUID format + x_correlation_id: 'd65ebcaf-e252-421c-a543-3d1ba4e4175b', # String | Unique correlation Id in a GUID format x_avalara_client: '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/) . - i_update_form1099_request: AvalaraSdk::A1099::V2::Form1099DivRequest.new # IUpdateForm1099Request | + i_update_form1099_request: AvalaraSdk::A1099::V2::Form1099DivRequest.new({recipient_name: 'recipient_name_example', address: 'address_example', city: 'city_example', country_code: 'country_code_example'}) # IUpdateForm1099Request | } begin - # Updates a 1099 form. + # Update a 1099/1095/W2/1042S form result = api_instance.update1099_form(id, avalara_version, opts) p result rescue AvalaraSdk::ApiError => e @@ -559,7 +571,7 @@ This returns an Array which contains the response data, status code and headers. ```ruby begin - # Updates a 1099 form. + # Update a 1099/1095/W2/1042S form data, status_code, headers = api_instance.update1099_form_with_http_info(id, avalara_version, opts) p status_code # => 2xx p headers # => { ... } diff --git a/docs/A1099/V2/FormsW9Api.md b/docs/A1099/V2/FormsW9Api.md index 40cb38a..4a414d4 100644 --- a/docs/A1099/V2/FormsW9Api.md +++ b/docs/A1099/V2/FormsW9Api.md @@ -5,20 +5,22 @@ All URIs are relative to *https://api-ava1099.eta.sbx.us-east-1.aws.avalara.io/a | Method | HTTP request | Description | | ------ | ------------ | ----------- | | [**create_w9_form**](FormsW9Api.md#create_w9_form) | **POST** /w9/forms | Create a W9/W4/W8 form | -| [**delete_w9_form**](FormsW9Api.md#delete_w9_form) | **DELETE** /w9/forms/{id} | Delete a form | +| [**delete_w9_form**](FormsW9Api.md#delete_w9_form) | **DELETE** /w9/forms/{id} | Delete a W9/W4/W8 form | | [**get_w9_form**](FormsW9Api.md#get_w9_form) | **GET** /w9/forms/{id} | Retrieve a W9/W4/W8 form | -| [**list_w9_forms**](FormsW9Api.md#list_w9_forms) | **GET** /w9/forms | List W9/W4/W8 forms. | -| [**send_w9_form_email**](FormsW9Api.md#send_w9_form_email) | **POST** /w9/forms/{id}/$send-email | Sends a W9 email request to a vendor/payee | +| [**list_w9_forms**](FormsW9Api.md#list_w9_forms) | **GET** /w9/forms | List W9/W4/W8 forms | +| [**send_w9_form_email**](FormsW9Api.md#send_w9_form_email) | **POST** /w9/forms/{id}/$send-email | Send an email to the vendor/payee requesting they fill out a W9/W4/W8 form | | [**update_w9_form**](FormsW9Api.md#update_w9_form) | **PUT** /w9/forms/{id} | Update a W9/W4/W8 form | -| [**upload_w9_files**](FormsW9Api.md#upload_w9_files) | **PUT** /w9/forms/{id}/attachment | Upload files for a W9/W4/W8 form | +| [**upload_w9_files**](FormsW9Api.md#upload_w9_files) | **POST** /w9/forms/{id}/attachment | Replace the PDF file for a W9/W4/W8 form | ## create_w9_form -> create_w9_form(avalara_version, opts) +> create_w9_form(avalara_version, opts) Create a W9/W4/W8 form +Create a W9/W4/W8 form. + ### Examples ```ruby @@ -37,11 +39,11 @@ end api_client = AvalaraSdk::ApiClient.new config api_instance = AvalaraSdk::A1099::V2::FormsW9Api.new api_client -avalara_version = '2.0' # String | API version +avalara_version = '2.0.0' # String | API version opts = { - x_correlation_id: '5003c014-1aa4-48a4-91c5-3176fcf2bf73', # String | Unique correlation Id in a GUID format + x_correlation_id: '968b9850-b859-4a5a-8165-bd1e444fbf47', # String | Unique correlation Id in a GUID format x_avalara_client: '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/) . - iw9_form_data_models_one_of: AvalaraSdk::A1099::V2::W4FormDataModel.new # IW9FormDataModelsOneOf | Form to be created + create_w9_form_request: AvalaraSdk::A1099::V2::W4FormRequest.new # CreateW9FormRequest | Form to be created } begin @@ -57,7 +59,7 @@ end This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> create_w9_form_with_http_info(avalara_version, opts) +> , Integer, Hash)> create_w9_form_with_http_info(avalara_version, opts) ```ruby begin @@ -65,7 +67,7 @@ begin data, status_code, headers = api_instance.create_w9_form_with_http_info(avalara_version, opts) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => rescue AvalaraSdk::A1099::V2::ApiError => e puts "Error when calling FormsW9Api->create_w9_form_with_http_info: #{e}" end @@ -78,11 +80,11 @@ end | **avalara_version** | **String** | API version | | | **x_correlation_id** | **String** | Unique correlation Id in a GUID format | [optional] | | **x_avalara_client** | **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] | -| **iw9_form_data_models_one_of** | [**IW9FormDataModelsOneOf**](IW9FormDataModelsOneOf.md) | Form to be created | [optional] | +| **create_w9_form_request** | [**CreateW9FormRequest**](CreateW9FormRequest.md) | Form to be created | [optional] | ### Return type -[**IW9FormDataModelsOneOf**](IW9FormDataModelsOneOf.md) +[**CreateW9Form201Response**](CreateW9Form201Response.md) ### Authorization @@ -98,9 +100,9 @@ end > delete_w9_form(id, avalara_version, opts) -Delete a form +Delete a W9/W4/W8 form -Delete a form +Delete a W9/W4/W8 form. ### Examples @@ -120,15 +122,15 @@ end api_client = AvalaraSdk::ApiClient.new config api_instance = AvalaraSdk::A1099::V2::FormsW9Api.new api_client -id = 'id_example' # String | Id of the form to delete -avalara_version = '2.0' # String | API version +id = 'id_example' # String | ID of the form to delete +avalara_version = '2.0.0' # String | API version opts = { - x_correlation_id: '949a3535-39c5-4928-8214-2dc8c4224670', # String | Unique correlation Id in a GUID format + x_correlation_id: '69926298-ed5b-4d78-8099-b5488589912d', # String | Unique correlation Id in a GUID format x_avalara_client: '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/) . } begin - # Delete a form + # Delete a W9/W4/W8 form api_instance.delete_w9_form(id, avalara_version, opts) rescue AvalaraSdk::ApiError => e puts "Error when calling FormsW9Api->delete_w9_form: #{e}" @@ -143,7 +145,7 @@ This returns an Array which contains the response data (`nil` in this case), sta ```ruby begin - # Delete a form + # Delete a W9/W4/W8 form data, status_code, headers = api_instance.delete_w9_form_with_http_info(id, avalara_version, opts) p status_code # => 2xx p headers # => { ... } @@ -157,7 +159,7 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **id** | **String** | Id of the form to delete | | +| **id** | **String** | ID of the form to delete | | | **avalara_version** | **String** | API version | | | **x_correlation_id** | **String** | Unique correlation Id in a GUID format | [optional] | | **x_avalara_client** | **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] | @@ -178,11 +180,11 @@ nil (empty response body) ## get_w9_form -> get_w9_form(id, avalara_version, opts) +> get_w9_form(id, avalara_version, opts) Retrieve a W9/W4/W8 form -Retrieve a W9/W4/W8 form +Retrieve a W9/W4/W8 form. ### Examples @@ -202,10 +204,10 @@ end api_client = AvalaraSdk::ApiClient.new config api_instance = AvalaraSdk::A1099::V2::FormsW9Api.new api_client -id = 'id_example' # String | Id of the form -avalara_version = '2.0' # String | API version +id = 'id_example' # String | ID of the form +avalara_version = '2.0.0' # String | API version opts = { - x_correlation_id: '5a0f7713-ffaf-49f0-be47-96783364c87d', # String | Unique correlation Id in a GUID format + x_correlation_id: 'e138390c-5561-49df-a969-49427e2c5ffa', # String | Unique correlation Id in a GUID format x_avalara_client: '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/) . } @@ -222,7 +224,7 @@ end This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> get_w9_form_with_http_info(id, avalara_version, opts) +> , Integer, Hash)> get_w9_form_with_http_info(id, avalara_version, opts) ```ruby begin @@ -230,7 +232,7 @@ begin data, status_code, headers = api_instance.get_w9_form_with_http_info(id, avalara_version, opts) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => rescue AvalaraSdk::A1099::V2::ApiError => e puts "Error when calling FormsW9Api->get_w9_form_with_http_info: #{e}" end @@ -240,14 +242,14 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **id** | **String** | Id of the form | | +| **id** | **String** | ID of the form | | | **avalara_version** | **String** | API version | | | **x_correlation_id** | **String** | Unique correlation Id in a GUID format | [optional] | | **x_avalara_client** | **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 -[**IW9FormDataModelsOneOf**](IW9FormDataModelsOneOf.md) +[**CreateW9Form201Response**](CreateW9Form201Response.md) ### Authorization @@ -263,7 +265,7 @@ end > list_w9_forms(avalara_version, opts) -List W9/W4/W8 forms. +List W9/W4/W8 forms List W9/W4/W8 forms. @@ -285,19 +287,19 @@ end api_client = AvalaraSdk::ApiClient.new config api_instance = AvalaraSdk::A1099::V2::FormsW9Api.new api_client -avalara_version = '2.0' # String | API version +avalara_version = '2.0.0' # String | API version opts = { filter: 'filter_example', # String | A filter statement to identify specific records to retrieve. For more information on filtering, see Filtering in REST. top: 56, # 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. skip: 56, # Integer | If nonzero, skip this number of results before returning data. Used with top to provide pagination for large datasets. order_by: 'order_by_example', # String | A comma separated list of sort statements in the format (fieldname) [ASC|DESC], for example id ASC. count: true, # Boolean | When true, returns a @recordSetCount in the result set - x_correlation_id: 'ee2ba593-ca8c-41f1-b96e-5cec3fc8e068', # String | Unique correlation Id in a GUID format + x_correlation_id: 'f80bd20b-84ec-47de-913f-304dd9951b58', # String | Unique correlation Id in a GUID format x_avalara_client: '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/) . } begin - # List W9/W4/W8 forms. + # List W9/W4/W8 forms result = api_instance.list_w9_forms(avalara_version, opts) p result rescue AvalaraSdk::ApiError => e @@ -313,7 +315,7 @@ This returns an Array which contains the response data, status code and headers. ```ruby begin - # List W9/W4/W8 forms. + # List W9/W4/W8 forms data, status_code, headers = api_instance.list_w9_forms_with_http_info(avalara_version, opts) p status_code # => 2xx p headers # => { ... } @@ -354,7 +356,9 @@ end > send_w9_form_email(id, avalara_version, opts) -Sends a W9 email request to a vendor/payee +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. ### Examples @@ -375,14 +379,14 @@ api_client = AvalaraSdk::ApiClient.new config api_instance = AvalaraSdk::A1099::V2::FormsW9Api.new api_client id = 'id_example' # String | The ID of the W9/W4/W8 form. -avalara_version = '2.0' # String | API version +avalara_version = '2.0.0' # String | API version opts = { - x_correlation_id: '6503b7f4-7f28-42c1-8a3c-d158c4b5aa76', # String | Unique correlation Id in a GUID format + x_correlation_id: '75735dc9-2909-4f11-bc6c-6e1ec0d77264', # String | Unique correlation Id in a GUID format x_avalara_client: '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/) . } begin - # Sends a W9 email request to a vendor/payee + # Send an email to the vendor/payee requesting they fill out a W9/W4/W8 form result = api_instance.send_w9_form_email(id, avalara_version, opts) p result rescue AvalaraSdk::ApiError => e @@ -398,7 +402,7 @@ This returns an Array which contains the response data, status code and headers. ```ruby begin - # Sends a W9 email request to a vendor/payee + # Send an email to the vendor/payee requesting they fill out a W9/W4/W8 form data, status_code, headers = api_instance.send_w9_form_email_with_http_info(id, avalara_version, opts) p status_code # => 2xx p headers # => { ... } @@ -437,6 +441,8 @@ end Update a W9/W4/W8 form +Update a W9/W4/W8 form. + ### Examples ```ruby @@ -455,10 +461,10 @@ end api_client = AvalaraSdk::ApiClient.new config api_instance = AvalaraSdk::A1099::V2::FormsW9Api.new api_client -id = 'id_example' # String | Id of the form to update -avalara_version = '2.0' # String | API version +id = 'id_example' # String | ID of the form to update +avalara_version = '2.0.0' # String | API version opts = { - x_correlation_id: 'a40ce0b3-6438-4890-ba0a-ad7be75fb3e1', # String | Unique correlation Id in a GUID format + x_correlation_id: 'd24784a4-9522-46c7-b6e0-8f44cb176f17', # String | Unique correlation Id in a GUID format x_avalara_client: '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/) . iw9_form_data_models_one_of: AvalaraSdk::A1099::V2::W4FormDataModel.new # IW9FormDataModelsOneOf | Form to be updated } @@ -494,7 +500,7 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **id** | **String** | Id of the form to update | | +| **id** | **String** | ID of the form to update | | | **avalara_version** | **String** | API version | | | **x_correlation_id** | **String** | Unique correlation Id in a GUID format | [optional] | | **x_avalara_client** | **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] | @@ -516,11 +522,11 @@ end ## upload_w9_files -> String upload_w9_files(id, avalara_version, opts) +> upload_w9_files(id, avalara_version, opts) -Upload files for a W9/W4/W8 form +Replace the PDF file for a W9/W4/W8 form -Upload files for a W9/W4/W8 form +Replaces the PDF file for a W9/W4/W8 form. ### Examples @@ -541,17 +547,16 @@ api_client = AvalaraSdk::ApiClient.new config api_instance = AvalaraSdk::A1099::V2::FormsW9Api.new api_client id = 'id_example' # String | Id of the form -avalara_version = '2.0' # String | API version +avalara_version = '2.0.0' # String | API version opts = { - x_correlation_id: 'fe4f3600-70a9-4fa1-a8a8-28bcf27e678c', # String | Unique correlation Id in a GUID format + x_correlation_id: 'ee2e9278-6cdb-47ad-82a0-9d5a726f7412', # String | Unique correlation Id in a GUID format x_avalara_client: '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('/path/to/some/file') # File | } begin - # Upload files for a W9/W4/W8 form - result = api_instance.upload_w9_files(id, avalara_version, opts) - p result + # Replace the PDF file for a W9/W4/W8 form + api_instance.upload_w9_files(id, avalara_version, opts) rescue AvalaraSdk::ApiError => e puts "Error when calling FormsW9Api->upload_w9_files: #{e}" end @@ -559,17 +564,17 @@ end #### Using the upload_w9_files_with_http_info variant -This returns an Array which contains the response data, status code and headers. +This returns an Array which contains the response data (`nil` in this case), status code and headers. -> upload_w9_files_with_http_info(id, avalara_version, opts) +> upload_w9_files_with_http_info(id, avalara_version, opts) ```ruby begin - # Upload files for a W9/W4/W8 form + # Replace the PDF file for a W9/W4/W8 form data, status_code, headers = api_instance.upload_w9_files_with_http_info(id, avalara_version, opts) p status_code # => 2xx p headers # => { ... } - p data # => String + p data # => nil rescue AvalaraSdk::A1099::V2::ApiError => e puts "Error when calling FormsW9Api->upload_w9_files_with_http_info: #{e}" end @@ -587,7 +592,7 @@ end ### Return type -**String** +nil (empty response body) ### Authorization diff --git a/docs/A1099/V2/Get1099Form200Response.md b/docs/A1099/V2/Get1099Form200Response.md index da4c285..1667f0c 100644 --- a/docs/A1099/V2/Get1099Form200Response.md +++ b/docs/A1099/V2/Get1099Form200Response.md @@ -14,11 +14,13 @@ require 'avalara_sdk' AvalaraSdk::A1099::V2::Get1099Form200Response.openapi_one_of # => # [ -# :'Form1095B', -# :'Form1099K', -# :'Form1099Misc', -# :'Form1099Nec', -# :'Form1099R' +# :'Form1042SListItemResponse', +# :'Form1095BListItemResponse', +# :'Form1099BaseResponse', +# :'Form1099KListItemResponse', +# :'Form1099MiscListItemResponse', +# :'Form1099NecListItemResponse', +# :'Form1099RListItemResponse' # ] ``` @@ -32,7 +34,7 @@ Find the appropriate object from the `openapi_one_of` list and casts the data in require 'avalara_sdk' AvalaraSdk::A1099::V2::Get1099Form200Response.build(data) -# => # +# => # AvalaraSdk::A1099::V2::Get1099Form200Response.build(data_that_doesnt_match) # => nil @@ -46,10 +48,12 @@ AvalaraSdk::A1099::V2::Get1099Form200Response.build(data_that_doesnt_match) #### Return type -- `Form1095B` -- `Form1099K` -- `Form1099Misc` -- `Form1099Nec` -- `Form1099R` +- `Form1042SListItemResponse` +- `Form1095BListItemResponse` +- `Form1099BaseResponse` +- `Form1099KListItemResponse` +- `Form1099MiscListItemResponse` +- `Form1099NecListItemResponse` +- `Form1099RListItemResponse` - `nil` (if no type matches) diff --git a/docs/A1099/V2/IntermediaryOrFlowThrough.md b/docs/A1099/V2/IntermediaryOrFlowThrough.md new file mode 100644 index 0000000..5222911 --- /dev/null +++ b/docs/A1099/V2/IntermediaryOrFlowThrough.md @@ -0,0 +1,38 @@ +# AvalaraSdk::A1099::V2::IntermediaryOrFlowThrough + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **ein** | **String** | | [optional] | +| **chap3_status_code** | **String** | | [optional] | +| **chap4_status_code** | **String** | | [optional] | +| **name** | **String** | | [optional] | +| **giin** | **String** | | [optional] | +| **country_code** | **String** | | [optional] | +| **foreign_tin** | **String** | | [optional] | +| **address** | **String** | | [optional] | +| **city** | **String** | | [optional] | +| **state** | **String** | | [optional] | +| **zip** | **String** | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::IntermediaryOrFlowThrough.new( + ein: null, + chap3_status_code: null, + chap4_status_code: null, + name: null, + giin: null, + country_code: null, + foreign_tin: null, + address: null, + city: null, + state: null, + zip: null +) +``` + diff --git a/docs/A1099/V2/IntermediaryOrFlowThroughRequest.md b/docs/A1099/V2/IntermediaryOrFlowThroughRequest.md new file mode 100644 index 0000000..251ab26 --- /dev/null +++ b/docs/A1099/V2/IntermediaryOrFlowThroughRequest.md @@ -0,0 +1,38 @@ +# AvalaraSdk::A1099::V2::IntermediaryOrFlowThroughRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **ein** | **String** | | [optional] | +| **chap3_status_code** | **String** | | [optional] | +| **chap4_status_code** | **String** | | [optional] | +| **name** | **String** | | [optional] | +| **giin** | **String** | | [optional] | +| **country_code** | **String** | | [optional] | +| **foreign_tin** | **String** | | [optional] | +| **address** | **String** | | [optional] | +| **city** | **String** | | [optional] | +| **state** | **String** | | [optional] | +| **zip** | **String** | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::IntermediaryOrFlowThroughRequest.new( + ein: null, + chap3_status_code: null, + chap4_status_code: null, + name: null, + giin: null, + country_code: null, + foreign_tin: null, + address: null, + city: null, + state: null, + zip: null +) +``` + diff --git a/docs/A1099/V2/IntermediaryOrFlowThroughResponse.md b/docs/A1099/V2/IntermediaryOrFlowThroughResponse.md new file mode 100644 index 0000000..53e08fa --- /dev/null +++ b/docs/A1099/V2/IntermediaryOrFlowThroughResponse.md @@ -0,0 +1,38 @@ +# AvalaraSdk::A1099::V2::IntermediaryOrFlowThroughResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **ein** | **String** | | [optional] | +| **chap3_status_code** | **String** | | [optional] | +| **chap4_status_code** | **String** | | [optional] | +| **name** | **String** | | [optional] | +| **giin** | **String** | | [optional] | +| **country_code** | **String** | | [optional] | +| **foreign_tin** | **String** | | [optional] | +| **address** | **String** | | [optional] | +| **city** | **String** | | [optional] | +| **state** | **String** | | [optional] | +| **zip** | **String** | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::IntermediaryOrFlowThroughResponse.new( + ein: null, + chap3_status_code: null, + chap4_status_code: null, + name: null, + giin: null, + country_code: null, + foreign_tin: null, + address: null, + city: null, + state: null, + zip: null +) +``` + diff --git a/docs/A1099/V2/Issuers1099Api.md b/docs/A1099/V2/Issuers1099Api.md index bc85dd8..4d654ec 100644 --- a/docs/A1099/V2/Issuers1099Api.md +++ b/docs/A1099/V2/Issuers1099Api.md @@ -6,7 +6,7 @@ All URIs are relative to *https://api-ava1099.eta.sbx.us-east-1.aws.avalara.io/a | ------ | ------------ | ----------- | | [**create_issuer**](Issuers1099Api.md#create_issuer) | **POST** /1099/issuers | Create an issuer | | [**delete_issuer**](Issuers1099Api.md#delete_issuer) | **DELETE** /1099/issuers/{id} | Delete an issuer | -| [**get_issuer**](Issuers1099Api.md#get_issuer) | **GET** /1099/issuers/{id} | Get an issuer | +| [**get_issuer**](Issuers1099Api.md#get_issuer) | **GET** /1099/issuers/{id} | Retrieve an issuer | | [**get_issuers**](Issuers1099Api.md#get_issuers) | **GET** /1099/issuers | List issuers | | [**update_issuer**](Issuers1099Api.md#update_issuer) | **PUT** /1099/issuers/{id} | Update an issuer | @@ -17,7 +17,7 @@ All URIs are relative to *https://api-ava1099.eta.sbx.us-east-1.aws.avalara.io/a Create an issuer -Create a new issuer +Create an issuer (also known as a Payer). ### Examples @@ -37,9 +37,9 @@ end api_client = AvalaraSdk::ApiClient.new config api_instance = AvalaraSdk::A1099::V2::Issuers1099Api.new api_client -avalara_version = '2.0' # String | API version +avalara_version = '2.0.0' # String | API version opts = { - x_correlation_id: 'fa8cab77-a162-404b-8bd9-a580287c744f', # String | Unique correlation Id in a GUID format + x_correlation_id: 'ce42bd72-2b6a-438a-8e8b-983910339267', # String | Unique correlation Id in a GUID format x_avalara_client: '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/) . issuer_command: AvalaraSdk::A1099::V2::IssuerCommand.new # IssuerCommand | The issuer to create } @@ -100,7 +100,7 @@ end Delete an issuer -Delete an issuer +Delete an issuer (also known as a Payer). ### Examples @@ -121,9 +121,9 @@ api_client = AvalaraSdk::ApiClient.new config api_instance = AvalaraSdk::A1099::V2::Issuers1099Api.new api_client id = 'id_example' # String | Id of the issuer to delete -avalara_version = '2.0' # String | API version +avalara_version = '2.0.0' # String | API version opts = { - x_correlation_id: 'b341ad72-1306-4af4-9c02-a742c55d8d97', # String | Unique correlation Id in a GUID format + x_correlation_id: '706821c8-d3fe-4fb8-82c2-5d6cf92c475e', # String | Unique correlation Id in a GUID format x_avalara_client: '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/) . } @@ -180,9 +180,9 @@ nil (empty response body) > get_issuer(id, avalara_version, opts) -Get an issuer +Retrieve an issuer -Get an issuer +Retrieve an issuer (also known as a Payer). ### Examples @@ -202,15 +202,15 @@ end api_client = AvalaraSdk::ApiClient.new config api_instance = AvalaraSdk::A1099::V2::Issuers1099Api.new api_client -id = 'id_example' # String | -avalara_version = '2.0' # String | API version +id = 'id_example' # String | Id of the issuer to retrieve +avalara_version = '2.0.0' # String | API version opts = { - x_correlation_id: '7d676bbe-e39a-4d59-a548-f9a8e026beed', # String | Unique correlation Id in a GUID format + x_correlation_id: '14762757-396e-4e07-851b-2b7dd2542250', # String | Unique correlation Id in a GUID format x_avalara_client: '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/) . } begin - # Get an issuer + # Retrieve an issuer result = api_instance.get_issuer(id, avalara_version, opts) p result rescue AvalaraSdk::ApiError => e @@ -226,7 +226,7 @@ This returns an Array which contains the response data, status code and headers. ```ruby begin - # Get an issuer + # Retrieve an issuer data, status_code, headers = api_instance.get_issuer_with_http_info(id, avalara_version, opts) p status_code # => 2xx p headers # => { ... } @@ -240,7 +240,7 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **id** | **String** | | | +| **id** | **String** | Id of the issuer to retrieve | | | **avalara_version** | **String** | API version | | | **x_correlation_id** | **String** | Unique correlation Id in a GUID format | [optional] | | **x_avalara_client** | **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] | @@ -265,7 +265,7 @@ end List issuers -List issuers for a given tax year. Filterable fields are name, referenceId and taxYear +List issuers (also known as Payers). Filterable fields are name, referenceId and taxYear. ### Examples @@ -285,7 +285,7 @@ end api_client = AvalaraSdk::ApiClient.new config api_instance = AvalaraSdk::A1099::V2::Issuers1099Api.new api_client -avalara_version = '2.0' # String | API version +avalara_version = '2.0.0' # String | API version opts = { filter: 'filter_example', # String | A filter statement to identify specific records to retrieve. For more information on filtering, see Filtering in REST. 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. @@ -293,7 +293,7 @@ opts = { order_by: 'order_by_example', # String | A comma separated list of sort statements in the format (fieldname) [ASC|DESC], for example id ASC. count: true, # Boolean | If true, return the global count of elements in the collection. count_only: true, # Boolean | If true, return ONLY the global count of elements in the collection. It only applies when count=true. - x_correlation_id: '84029679-b1eb-4ebf-8c73-2612f83c1981', # String | Unique correlation Id in a GUID format + x_correlation_id: '99c911ff-f4eb-42a8-841d-342a6cd1c7d5', # String | Unique correlation Id in a GUID format x_avalara_client: '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/) . } @@ -358,7 +358,7 @@ end Update an issuer -Update an existing issuer +Update an issuer (also known as a Payer). ### Examples @@ -378,10 +378,10 @@ end api_client = AvalaraSdk::ApiClient.new config api_instance = AvalaraSdk::A1099::V2::Issuers1099Api.new api_client -id = 'id_example' # String | Id of the issuer to Update -avalara_version = '2.0' # String | API version +id = 'id_example' # String | Id of the issuer to update +avalara_version = '2.0.0' # String | API version opts = { - x_correlation_id: '5eac330a-bb0c-4122-9f83-ec27fc871b05', # String | Unique correlation Id in a GUID format + x_correlation_id: '092e5597-f724-49e7-bffa-4f1f21cb6236', # String | Unique correlation Id in a GUID format x_avalara_client: '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/) . issuer_command: AvalaraSdk::A1099::V2::IssuerCommand.new # IssuerCommand | The issuer to update } @@ -416,7 +416,7 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **id** | **String** | Id of the issuer to Update | | +| **id** | **String** | Id of the issuer to update | | | **avalara_version** | **String** | API version | | | **x_correlation_id** | **String** | Unique correlation Id in a GUID format | [optional] | | **x_avalara_client** | **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] | diff --git a/docs/A1099/V2/JobResult.md b/docs/A1099/V2/JobResult.md index 206e6a0..822a8ba 100644 --- a/docs/A1099/V2/JobResult.md +++ b/docs/A1099/V2/JobResult.md @@ -6,22 +6,22 @@ | ---- | ---- | ----------- | ----- | | **id** | **String** | | [optional] | | **type** | **String** | | [optional] | -| **dry_run** | **Boolean** | | [optional] | -| **upsert** | **Boolean** | | [optional] | -| **status** | **String** | | [optional] | +| **dry_run** | **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] | +| **status** | **String** | Status of the job | [optional] | | **error_message** | **String** | | [optional] | -| **total_processed** | **Integer** | | [optional] | -| **total_rows** | **Integer** | | [optional] | -| **updated_valid** | **Integer** | | [optional] | -| **updated_no_email** | **Integer** | | [optional] | -| **updated_invalid** | **Integer** | | [optional] | -| **skipped_duplicate** | **Integer** | | [optional] | -| **skipped_invalid** | **Integer** | | [optional] | -| **skipped_multiple_matches** | **Integer** | | [optional] | -| **not_found** | **Integer** | | [optional] | -| **created_invalid** | **Integer** | | [optional] | -| **created_no_email** | **Integer** | | [optional] | -| **created_valid** | **Integer** | | [optional] | +| **total_processed** | **Integer** | Total number of forms processed | [optional] | +| **total_rows** | **Integer** | Total number of forms in the request | [optional] | +| **updated_valid** | **Integer** | Number of forms updated and valid for e-filing and e-delivery | [optional] | +| **updated_no_email** | **Integer** | Number of forms updated and valid for e-filing but missing email or email is undeliverable | [optional] | +| **updated_invalid** | **Integer** | Number of forms updated but invalid for e-filing | [optional] | +| **skipped_duplicate** | **Integer** | Number of forms skipped because they would have updated a record already updated once in the request | [optional] | +| **skipped_invalid** | **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 | [optional] | +| **skipped_multiple_matches** | **Integer** | Number of forms skipped because they matched multiple forms | [optional] | +| **not_found** | **Integer** | Number of forms skipped because no matching form or issuer could be found | [optional] | +| **created_invalid** | **Integer** | Number of new forms created because no matching form could be found (and `upsert` was true) - with errors | [optional] | +| **created_no_email** | **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 | [optional] | +| **created_valid** | **Integer** | Number of new forms created because no matching form could be found (and `upsert` was true) - valid for e-filing and e-delivery | [optional] | ## Example diff --git a/docs/A1099/V2/Jobs1099Api.md b/docs/A1099/V2/Jobs1099Api.md index 2229880..f445591 100644 --- a/docs/A1099/V2/Jobs1099Api.md +++ b/docs/A1099/V2/Jobs1099Api.md @@ -34,9 +34,9 @@ api_client = AvalaraSdk::ApiClient.new config api_instance = AvalaraSdk::A1099::V2::Jobs1099Api.new api_client id = 'id_example' # String | Job id obtained from other API responses, like `/1099/bulk-upsert`. -avalara_version = '2.0' # String | API version +avalara_version = '2.0.0' # String | API version opts = { - x_correlation_id: '3473f78f-f1bd-48ce-8cad-ad651630addb', # String | Unique correlation Id in a GUID format + x_correlation_id: '0d84e31f-0d44-4920-9f1b-5daa360e7925', # String | Unique correlation Id in a GUID format x_avalara_client: '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/) . } diff --git a/docs/A1099/V2/PrimaryWithholdingAgent.md b/docs/A1099/V2/PrimaryWithholdingAgent.md new file mode 100644 index 0000000..f055ad5 --- /dev/null +++ b/docs/A1099/V2/PrimaryWithholdingAgent.md @@ -0,0 +1,20 @@ +# AvalaraSdk::A1099::V2::PrimaryWithholdingAgent + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **primary_withholding_agent_name** | **String** | | [optional] | +| **primary_withholding_agent_ein** | **String** | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::PrimaryWithholdingAgent.new( + primary_withholding_agent_name: null, + primary_withholding_agent_ein: null +) +``` + diff --git a/docs/A1099/V2/PrimaryWithholdingAgentRequest.md b/docs/A1099/V2/PrimaryWithholdingAgentRequest.md new file mode 100644 index 0000000..302918c --- /dev/null +++ b/docs/A1099/V2/PrimaryWithholdingAgentRequest.md @@ -0,0 +1,20 @@ +# AvalaraSdk::A1099::V2::PrimaryWithholdingAgentRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **primary_withholding_agent_name** | **String** | | [optional] | +| **primary_withholding_agent_ein** | **String** | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::PrimaryWithholdingAgentRequest.new( + primary_withholding_agent_name: null, + primary_withholding_agent_ein: null +) +``` + diff --git a/docs/A1099/V2/PrimaryWithholdingAgentResponse.md b/docs/A1099/V2/PrimaryWithholdingAgentResponse.md new file mode 100644 index 0000000..1339237 --- /dev/null +++ b/docs/A1099/V2/PrimaryWithholdingAgentResponse.md @@ -0,0 +1,20 @@ +# AvalaraSdk::A1099::V2::PrimaryWithholdingAgentResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **primary_withholding_agent_name** | **String** | | [optional] | +| **primary_withholding_agent_ein** | **String** | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::PrimaryWithholdingAgentResponse.new( + primary_withholding_agent_name: null, + primary_withholding_agent_ein: null +) +``` + diff --git a/docs/A1099/V2/StateAndLocalWithholdingResponse.md b/docs/A1099/V2/StateAndLocalWithholdingResponse.md index b170020..2a4474d 100644 --- a/docs/A1099/V2/StateAndLocalWithholdingResponse.md +++ b/docs/A1099/V2/StateAndLocalWithholdingResponse.md @@ -4,14 +4,14 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **state_tax_withheld** | **Float** | | [optional] | -| **state** | **String** | | [optional] | -| **state_id_number** | **String** | | [optional] | -| **state_income** | **Float** | | [optional] | -| **local_tax_withheld** | **Float** | | [optional] | -| **locality** | **String** | | [optional] | -| **locality_id_number** | **String** | | [optional] | -| **local_income** | **Float** | | [optional] | +| **state_tax_withheld** | **Float** | Amount of state tax that was withheld | [optional] | +| **state** | **String** | US state | [optional] | +| **state_id_number** | **String** | State ID number of the entity issuing the form | [optional] | +| **state_income** | **Float** | Amount of state income | [optional] | +| **local_tax_withheld** | **Float** | Amount of local tax that was withheld | [optional] | +| **locality** | **String** | Locality name | [optional] | +| **locality_id_number** | **String** | Locality ID number of the entity issuing the form | [optional] | +| **local_income** | **Float** | Amount of local income | [optional] | ## Example diff --git a/docs/A1099/V2/StateEfileStatusDetailResponse.md b/docs/A1099/V2/StateEfileStatusDetailResponse.md new file mode 100644 index 0000000..a9f1da4 --- /dev/null +++ b/docs/A1099/V2/StateEfileStatusDetailResponse.md @@ -0,0 +1,22 @@ +# AvalaraSdk::A1099::V2::StateEfileStatusDetailResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **status** | **String** | | [optional] | +| **time** | **String** | | [optional] | +| **jurisdiction** | **String** | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::StateEfileStatusDetailResponse.new( + status: null, + time: null, + jurisdiction: null +) +``` + diff --git a/docs/A1099/V2/SubstantialUsOwnerRequest.md b/docs/A1099/V2/SubstantialUsOwnerRequest.md new file mode 100644 index 0000000..32e9d35 --- /dev/null +++ b/docs/A1099/V2/SubstantialUsOwnerRequest.md @@ -0,0 +1,22 @@ +# AvalaraSdk::A1099::V2::SubstantialUsOwnerRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | The name of the substantial U.S. owner of the NFFE. | [optional] | +| **address** | **String** | The address of the substantial U.S. owner of the NFFE. | [optional] | +| **tin** | **String** | The taxpayer identification number (TIN) of the substantial U.S. owner of the NFFE. | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::SubstantialUsOwnerRequest.new( + name: null, + address: null, + tin: null +) +``` + diff --git a/docs/A1099/V2/Update1099Form200Response.md b/docs/A1099/V2/Update1099Form200Response.md index 8e11cd2..4d13880 100644 --- a/docs/A1099/V2/Update1099Form200Response.md +++ b/docs/A1099/V2/Update1099Form200Response.md @@ -14,6 +14,7 @@ require 'avalara_sdk' AvalaraSdk::A1099::V2::Update1099Form200Response.openapi_one_of # => # [ +# :'Form1042SResponse', # :'Form1099DivResponse', # :'Form1099MiscResponse', # :'Form1099NecResponse', @@ -31,7 +32,7 @@ Find the appropriate object from the `openapi_one_of` list and casts the data in require 'avalara_sdk' AvalaraSdk::A1099::V2::Update1099Form200Response.build(data) -# => # +# => # AvalaraSdk::A1099::V2::Update1099Form200Response.build(data_that_doesnt_match) # => nil @@ -45,6 +46,7 @@ AvalaraSdk::A1099::V2::Update1099Form200Response.build(data_that_doesnt_match) #### Return type +- `Form1042SResponse` - `Form1099DivResponse` - `Form1099MiscResponse` - `Form1099NecResponse` diff --git a/docs/A1099/V2/ValidationErrorResponse.md b/docs/A1099/V2/ValidationErrorResponse.md new file mode 100644 index 0000000..719b6b3 --- /dev/null +++ b/docs/A1099/V2/ValidationErrorResponse.md @@ -0,0 +1,20 @@ +# AvalaraSdk::A1099::V2::ValidationErrorResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **field** | **String** | The field containing the error | [optional] | +| **errors** | **Array<String>** | The list of error messages | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::ValidationErrorResponse.new( + field: null, + errors: null +) +``` + diff --git a/docs/A1099/V2/W4FormDataModel.md b/docs/A1099/V2/W4FormDataModel.md index 42733c5..6162e92 100644 --- a/docs/A1099/V2/W4FormDataModel.md +++ b/docs/A1099/V2/W4FormDataModel.md @@ -120,9 +120,9 @@ | **certify_box41** | **Boolean** | | [optional] | | **certify_box43** | **Boolean** | | [optional] | | **certify_part29_signature** | **Boolean** | | [optional] | -| **part19_formation_or_resolution_date** | **Time** | | [optional] | -| **part20_filing_date** | **Time** | | [optional] | -| **part21_determination_date** | **Time** | | [optional] | +| **part19_formation_or_resolution_date** | **Date** | | [optional] | +| **part20_filing_date** | **Date** | | [optional] | +| **part21_determination_date** | **Date** | | [optional] | | **substantial_us_owners** | [**Array<W8BenESubstantialUsOwnerDataModel>**](W8BenESubstantialUsOwnerDataModel.md) | | [optional] | | **birthday** | **String** | The birthday of the individual associated with the form. | [optional] | | **foreign_tin_not_required** | **Boolean** | Indicates whether a foreign TIN is not required. | [optional] | @@ -201,8 +201,8 @@ | **certify_box40** | **Boolean** | Indicates certification for box 40. | [optional] | | **box41_sponsoring_entity** | **String** | The sponsoring entity information for box 41. | [optional] | | **certify_box42** | **Boolean** | Indicates certification for box 42. | [optional] | -| **box35_formed_on_date** | **Time** | | [optional] | -| **box36_filed_on_date** | **Time** | | [optional] | +| **box35_formed_on_date** | **Date** | | [optional] | +| **box36_filed_on_date** | **Date** | | [optional] | | **tin_match_status** | **String** | The status of the TIN match. | [optional] | | **signature** | **String** | The signature itself | [optional] | | **business_classification** | **String** | The classification of the business. | [optional] | diff --git a/docs/A1099/V2/W4FormRequest.md b/docs/A1099/V2/W4FormRequest.md new file mode 100644 index 0000000..f9c3a57 --- /dev/null +++ b/docs/A1099/V2/W4FormRequest.md @@ -0,0 +1,66 @@ +# AvalaraSdk::A1099::V2::W4FormRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **type** | **String** | The form type (always \"w4\" for this model). | [optional][readonly] | +| **employee_first_name** | **String** | The first name of the employee. | [optional] | +| **employee_middle_name** | **String** | The middle name of the employee. | [optional] | +| **employee_last_name** | **String** | The last name of the employee. | [optional] | +| **employee_name_suffix** | **String** | The name suffix of the employee. | [optional] | +| **tin_type** | **String** | The type of TIN provided. | [optional] | +| **tin** | **String** | The taxpayer identification number (TIN). | [optional] | +| **address** | **String** | The address of the employee. | [optional] | +| **city** | **String** | The city of residence of the employee. | [optional] | +| **state** | **String** | The state of residence of the employee. | [optional] | +| **zip** | **String** | The ZIP code of residence of the employee. | [optional] | +| **marital_status** | **String** | The marital status of the employee. | [optional] | +| **last_name_differs** | **Boolean** | Indicates whether the last name differs from prior records. | [optional] | +| **num_allowances** | **Integer** | The number of allowances claimed by the employee. | [optional] | +| **other_dependents** | **Integer** | The number of dependents other than allowances. | [optional] | +| **non_job_income** | **Float** | The amount of non-job income. | [optional] | +| **deductions** | **Float** | The amount of deductions claimed. | [optional] | +| **additional_withheld** | **Float** | The additional amount withheld. | [optional] | +| **exempt_from_withholding** | **Boolean** | Indicates whether the employee is exempt from withholding. | [optional] | +| **office_code** | **String** | The office code associated with the form. | [optional] | +| **company_id** | **String** | The ID of the associated company. | [optional] | +| **reference_id** | **String** | A reference identifier for the form. | [optional] | +| **email** | **String** | The email address of the individual associated with the form. | [optional] | +| **e_delivery_consented_at** | **Time** | The date when e-delivery was consented. | [optional] | +| **signature** | **String** | The signature of the form. | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::W4FormRequest.new( + type: W4, + employee_first_name: null, + employee_middle_name: null, + employee_last_name: null, + employee_name_suffix: null, + tin_type: null, + tin: null, + address: null, + city: null, + state: null, + zip: null, + marital_status: null, + last_name_differs: null, + num_allowances: null, + other_dependents: null, + non_job_income: null, + deductions: null, + additional_withheld: null, + exempt_from_withholding: null, + office_code: null, + company_id: null, + reference_id: null, + email: null, + e_delivery_consented_at: null, + signature: null +) +``` + diff --git a/docs/A1099/V2/W8BenEFormRequest.md b/docs/A1099/V2/W8BenEFormRequest.md new file mode 100644 index 0000000..735e72a --- /dev/null +++ b/docs/A1099/V2/W8BenEFormRequest.md @@ -0,0 +1,218 @@ +# AvalaraSdk::A1099::V2::W8BenEFormRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **type** | **String** | The form type (always \"w8bene\" for this model). | [optional][readonly] | +| **name** | **String** | The name of the individual or entity associated with the form. | [optional] | +| **citizenship_country** | **String** | The country of citizenship. | [optional] | +| **disregarded_entity** | **String** | The name of the disregarded entity receiving the payment (if applicable). | [optional] | +| **entity_type** | **String** | The entity type. | [optional] | +| **making_treaty_claim** | **Boolean** | Indicates whether the entity is making a treaty claim. | [optional] | +| **fatca_status** | **String** | The FATCA status. | [optional] | +| **residence_address** | **String** | The residential address of the individual or entity. | [optional] | +| **residence_city** | **String** | The city of residence. | [optional] | +| **residence_state** | **String** | The state of residence. | [optional] | +| **residence_zip** | **String** | The ZIP code of the residence. | [optional] | +| **residence_country** | **String** | The country of residence. | [optional] | +| **residence_is_mailing** | **Boolean** | Indicates whether the residence address is also the mailing address. | [optional] | +| **mailing_address** | **String** | The mailing address. | [optional] | +| **mailing_city** | **String** | The city of the mailing address. | [optional] | +| **mailing_state** | **String** | The state of the mailing address. | [optional] | +| **mailing_zip** | **String** | The ZIP code of the mailing address. | [optional] | +| **mailing_country** | **String** | The country of the mailing address. | [optional] | +| **tin** | **String** | The taxpayer identification number (TIN). | [optional] | +| **giin** | **String** | The global intermediary identification number (GIIN). | [optional] | +| **foreign_tin_not_required** | **Boolean** | Indicates whether a foreign TIN is not required. | [optional] | +| **foreign_tin** | **String** | The foreign taxpayer identification number (TIN). | [optional] | +| **reference_number** | **String** | A reference number for the form. | [optional] | +| **disregarded_entity_fatca_status** | **String** | The FATCA status of disregarded entity or branch receiving payment. | [optional] | +| **disregarded_address** | **String** | The address for disregarded entities. | [optional] | +| **disregarded_city** | **String** | The city for disregarded entities. | [optional] | +| **disregarded_state** | **String** | The state for disregarded entities. | [optional] | +| **disregarded_zip** | **String** | The ZIP code for disregarded entities. | [optional] | +| **disregarded_country** | **String** | The country for disregarded entities. | [optional] | +| **disregarded_entity_giin** | **String** | The GIIN for disregarded entities. | [optional] | +| **treaty_country_certification** | **Boolean** | Certifies the beneficial owner's country under the U.S. tax treaty. | [optional] | +| **treaty_country** | **String** | The treaty country of the beneficial owner. | [optional] | +| **benefit_limitation_certification** | **Boolean** | Certifies that the beneficial owner is eligible for treaty benefits and meets any limitation on benefits requirements. | [optional] | +| **benefit_limitation** | **String** | The benefit limitation for tax treaty claims. | [optional] | +| **qualified_resident_status_certification** | **Boolean** | Certifies that the beneficial owner claims treaty benefits and meets the qualified resident status for specific U.S. source income. | [optional] | +| **treaty_article** | **String** | Indicates the specific article and paragraph of the tax treaty under which the beneficial owner is claiming benefits. | [optional] | +| **withholding_rate** | **String** | Specifies the reduced withholding rate claimed under the applicable tax treaty. | [optional] | +| **income_type** | **String** | Specifies the type of income for which the reduced treaty withholding rate is being claimed. | [optional] | +| **treaty_reasons** | **String** | The additional conditions in the article the beneficial owner meets to be eligible for the rate of withholding. | [optional] | +| **ffi_sponsoring_entity** | **String** | The name of the entity that sponsors the foreign financial institution (FFI). | [optional] | +| **investment_entity_certification** | **Boolean** | Certifies that the entity is an investment entity, not a QI, WP, or WT, and has an agreement with a sponsoring entity. | [optional] | +| **controlled_foreign_corporation_certification** | **Boolean** | Certifies that the entity is a controlled foreign corporation sponsored by a U.S. financial institution, not a QI, WP, or WT, and shares a common electronic account system for full transparency. | [optional] | +| **compliant_nonregistering_local_bank_certification** | **Boolean** | Certifies that the FFI operates solely as a limited bank or credit union within its country, meets asset thresholds, and has no foreign operations or affiliations outside its country of organization. | [optional] | +| **compliant_ffi_low_value_accounts_certification** | **Boolean** | Certifies that the FFI is not primarily engaged in investment activities, maintains only low-value accounts, and has limited total assets within its group. | [optional] | +| **sponsored_closely_held_entity_sponsoring_entity** | **String** | The name of sponsoring entity for a certified deemed-compliant, closely held investment vehicle. | [optional] | +| **sponsored_closely_held_investment_vehicle_certification** | **Boolean** | Certifies that the entity is a sponsored investment entity with 20 or fewer individual owners, and that all compliance obligations are fulfilled by the sponsoring entity. | [optional] | +| **compliant_limited_life_debt_entity_certification** | **Boolean** | Certifies that the entity qualifies as a limited life debt investment entity based on its formation date, issuance terms, and compliance with regulatory requirements. | [optional] | +| **investment_entity_no_financial_accounts_certification** | **Boolean** | Certifies that the entity is a financial institution solely because it is an investment entity under regulations and the entity does not maintain financial accounts. | [optional] | +| **owner_documented_ffi_certification** | **Boolean** | Certifies that the FFI meets all requirements to qualify as an owner-documented FFI, including restrictions on activities, ownership, and account relationships. | [optional] | +| **owner_documented_ffi_reporting_statement_certification** | **Boolean** | Certifies that the FFI will provide a complete owner reporting statement and required documentation for each relevant owner or debt holder. | [optional] | +| **owner_documented_ffi_auditor_letter_certification** | **Boolean** | Certifies that the FFI will provide an auditor’s letter and required owner reporting documentation to confirm its status as an owner-documented FFI. | [optional] | +| **owner_documented_ffi_trust_beneficiaries_certification** | **Boolean** | Certifies that the trust has no contingent or unidentified beneficiaries or designated classes of beneficiaries. | [optional] | +| **restricted_distributor_certification** | **Boolean** | Certifies that the entity qualifies as a restricted distributor based on its operations, customer base, regulatory compliance, and financial and geographic limitations. | [optional] | +| **restricted_distributor_agreement_certification** | **Boolean** | Certifies that the entity is, and has been, bound by distribution agreements prohibiting sales of fund interests to specified U.S. persons and certain non-U.S. entities. | [optional] | +| **restricted_distributor_preexisting_sales_compliance_certification** | **Boolean** | Certifies that the entity complies with distribution restrictions for U.S.-linked investors and has addressed any preexisting sales in accordance with FATCA regulations. | [optional] | +| **nonreporting_iga_ffi_certification** | **Boolean** | Certifies that the entity meets the requirements to be considered a nonreporting financial institution to an applicable IGA. | [optional] | +| **iga_country** | **String** | The country for the applicable IGA with the United States. | [optional] | +| **iga_model** | **String** | The applicable IGA model. | [optional] | +| **iga_legal_status_treatment** | **String** | Specifies how the applicable IGA is treated under the IGA provisions or Treasury regulations. | [optional] | +| **iga_ffi_trustee_or_sponsor** | **String** | The trustee or sponsor name for the nonreporting IGA FFI. | [optional] | +| **iga_ffi_trustee_is_foreign** | **Boolean** | Indicates whether the trustee for the nonreporting IGA FFI is foreign. | [optional] | +| **non_commercial_financial_activity_certification** | **Boolean** | Certifies that the entity is the beneficial owner and is not engaged in commercial financial activities related to the specified payments, accounts or obligations for which this form is submitted. | [optional] | +| **internation_organization_certification** | **Boolean** | Certifies that the entity is an international organization described in section 7701(a)(18). | [optional] | +| **intergovernmental_organization_certification** | **Boolean** | Certifies that the entity is an intergovernmental or supranational organization primarily comprised of foreign governments, is the beneficial owner, and is not engaged in commercial financial activities. | [optional] | +| **treaty_qualified_pension_fund_certification** | **Boolean** | Certifies that the entity is a pension or retirement fund established in a treaty country and is entitled to treaty benefits on U.S. source income. | [optional] | +| **qualified_retirement_fund_certification** | **Boolean** | Certifies that the entity is a government-regulated retirement fund meeting specific requirements for contributions, tax exemption, beneficiary limits, and distribution restrictions. | [optional] | +| **narrow_participation_retirement_fund_certification** | **Boolean** | Certifies that the entity is a government-regulated retirement fund with fewer than 50 participants, limited foreign ownership, and employer sponsorship that is not from investment entities or passive NFFEs. | [optional] | +| **section401_a_equivalent_pension_plan_certification** | **Boolean** | Certifies that the entity is formed under a pension plan meeting section 401(a) requirements, except for being U.S.-trust funded. | [optional] | +| **investment_entity_for_retirement_funds_certification** | **Boolean** | Certifies that the entity is established solely to earn income for the benefit of qualifying retirement funds or accounts under applicable FATCA regulations or IGAs. | [optional] | +| **exempt_beneficial_owner_sponsored_retirement_fund_certification** | **Boolean** | Certifies that the entity is established and sponsored by a qualifying exempt beneficial owner to provide retirement, disability, or death benefits to individuals based on services performed for the sponsor. | [optional] | +| **exempt_beneficial_owner_owned_investment_entity_certification** | **Boolean** | Certifies that the entity is an investment entity wholly owned by exempt beneficial owners and has provided complete ownership and documentation details as required under FATCA regulations. | [optional] | +| **territory_financial_institution_certification** | **Boolean** | Certifies that the entity is a financial institution (other than an investment entity) that is incorporated or organized under the laws of a possession of the United States. | [optional] | +| **excepted_nonfinancial_group_entity_certification** | **Boolean** | Certifies that the entity is a holding company, treasury center, or captive finance company operating within a nonfinancial group and not functioning as an investment or financial institution. | [optional] | +| **excepted_nonfinancial_start_up_certification** | **Boolean** | Certifies that the entity is a recently formed startup NFFE investing in a non-financial business and is not operating as or presenting itself as an investment fund. | [optional] | +| **startup_formation_or_resolution_date** | **Date** | The date the start-up company was formed on (or, in case of new line of business, the date of board resolution approving the new line of business). | [optional] | +| **excepted_nonfinancial_entity_in_liquidation_or_bankruptcy_certification** | **Boolean** | Certifies that the entity is in liquidation, reorganization, or bankruptcy and intends to operate as a nonfinancial entity, with supporting documentation available if the process exceeds three years. | [optional] | +| **nonfinancial_entity_filing_date** | **Date** | The filed date for a plan of reorganization, liquidation or bankruptcy. | [optional] | +| **section501_c_organization_certification** | **Boolean** | Certifies that the entity is a section 501(c) organization based on a valid IRS determination letter or a legal opinion from U.S. counsel. | [optional] | +| **determination_letter_date** | **Date** | The date of the IRS determination letter confirming the entity’s section 501(c) status. | [optional] | +| **nonprofit_organization_certification** | **Boolean** | Certifies that the entity is a nonprofit organization established for charitable or similar purposes, exempt from income tax, and restricted in the use and distribution of its assets under applicable law. | [optional] | +| **publicly_traded_nffe_certification** | **Boolean** | Certifies that the entity is a foreign corporation that is not a financial institution and whose stock is regularly traded on an established securities market. | [optional] | +| **publicly_traded_nffe_securities_market** | **String** | The name of the securities market where the corporation's stock is regularly traded. | [optional] | +| **nffe_affiliate_of_publicly_traded_entity_certification** | **Boolean** | Certifies that the entity is a foreign corporation that is not a financial institution and is affiliated with a publicly traded entity within the same expanded affiliated group. | [optional] | +| **publicly_traded_entity** | **String** | The name of the affiliated entity whose stock is regularly traded on an established securities market. | [optional] | +| **nffe_affiliate_of_publicly_traded_entity_securities_market** | **String** | The name of the established securities market where the affiliated entity's stock is traded. | [optional] | +| **excepted_territory_nffe_certification** | **Boolean** | Certifies that the entity is organized in a U.S. possession, is not engaged in financial activities, and is entirely owned by bona fide residents of that possession. | [optional] | +| **active_nffe_certification** | **Boolean** | Certifies that the entity is a foreign non-financial institution with less than 50% passive income and less than 50% of its assets producing or held to produce passive income. | [optional] | +| **passive_nffe_certification** | **Boolean** | Certifies that the entity is a foreign non-financial entity that does not qualify for any other NFFE category and is not a financial institution. | [optional] | +| **passive_nffe_no_substantial_us_owners_certification** | **Boolean** | Certifies that the passive NFFE has no substantial U.S. owners or controlling U.S. persons. | [optional] | +| **passive_nffe_substantial_us_owners_provided_certification** | **Boolean** | Certifies that the passive NFFE has provided the name, address, and TIN of each substantial U.S. owner or controlling U.S. person. | [optional] | +| **excepted_inter_affiliate_ffi_certification** | **Boolean** | Certifies that the entity is an inter-affiliate FFI meeting all conditions for exemption, including limited account activity and payment interactions within its expanded affiliated group. | [optional] | +| **sponsored_direct_reporting_nffe_certification** | **Boolean** | Certifies that the entity is a sponsored direct reporting NFFE. | [optional] | +| **direct_reporting_nffe_sponsoring_entity** | **String** | The name of the entity that sponsors the direct reporting NFFE. | [optional] | +| **substantial_us_owners** | [**Array<SubstantialUsOwnerRequest>**](SubstantialUsOwnerRequest.md) | The list of substantial U.S. owners of passive NFFE. | [optional] | +| **signer_name** | **String** | The name of the signer. | [optional] | +| **capacity_to_sign_certification** | **Boolean** | Certifies signer has the capacity to sign for the beneficial owner. | [optional] | +| **company_id** | **String** | The ID of the associated company. | [optional] | +| **reference_id** | **String** | A reference identifier for the form. | [optional] | +| **email** | **String** | The email address of the individual associated with the form. | [optional] | +| **e_delivery_consented_at** | **Time** | The date when e-delivery was consented. | [optional] | +| **signature** | **String** | The signature of the form. | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::W8BenEFormRequest.new( + type: W4, + name: null, + citizenship_country: null, + disregarded_entity: null, + entity_type: null, + making_treaty_claim: null, + fatca_status: null, + residence_address: null, + residence_city: null, + residence_state: null, + residence_zip: null, + residence_country: null, + residence_is_mailing: null, + mailing_address: null, + mailing_city: null, + mailing_state: null, + mailing_zip: null, + mailing_country: null, + tin: null, + giin: null, + foreign_tin_not_required: null, + foreign_tin: null, + reference_number: null, + disregarded_entity_fatca_status: null, + disregarded_address: null, + disregarded_city: null, + disregarded_state: null, + disregarded_zip: null, + disregarded_country: null, + disregarded_entity_giin: null, + treaty_country_certification: null, + treaty_country: null, + benefit_limitation_certification: null, + benefit_limitation: null, + qualified_resident_status_certification: null, + treaty_article: null, + withholding_rate: null, + income_type: null, + treaty_reasons: null, + ffi_sponsoring_entity: null, + investment_entity_certification: null, + controlled_foreign_corporation_certification: null, + compliant_nonregistering_local_bank_certification: null, + compliant_ffi_low_value_accounts_certification: null, + sponsored_closely_held_entity_sponsoring_entity: null, + sponsored_closely_held_investment_vehicle_certification: null, + compliant_limited_life_debt_entity_certification: null, + investment_entity_no_financial_accounts_certification: null, + owner_documented_ffi_certification: null, + owner_documented_ffi_reporting_statement_certification: null, + owner_documented_ffi_auditor_letter_certification: null, + owner_documented_ffi_trust_beneficiaries_certification: null, + restricted_distributor_certification: null, + restricted_distributor_agreement_certification: null, + restricted_distributor_preexisting_sales_compliance_certification: null, + nonreporting_iga_ffi_certification: null, + iga_country: null, + iga_model: null, + iga_legal_status_treatment: null, + iga_ffi_trustee_or_sponsor: null, + iga_ffi_trustee_is_foreign: null, + non_commercial_financial_activity_certification: null, + internation_organization_certification: null, + intergovernmental_organization_certification: null, + treaty_qualified_pension_fund_certification: null, + qualified_retirement_fund_certification: null, + narrow_participation_retirement_fund_certification: null, + section401_a_equivalent_pension_plan_certification: null, + investment_entity_for_retirement_funds_certification: null, + exempt_beneficial_owner_sponsored_retirement_fund_certification: null, + exempt_beneficial_owner_owned_investment_entity_certification: null, + territory_financial_institution_certification: null, + excepted_nonfinancial_group_entity_certification: null, + excepted_nonfinancial_start_up_certification: null, + startup_formation_or_resolution_date: null, + excepted_nonfinancial_entity_in_liquidation_or_bankruptcy_certification: null, + nonfinancial_entity_filing_date: null, + section501_c_organization_certification: null, + determination_letter_date: null, + nonprofit_organization_certification: null, + publicly_traded_nffe_certification: null, + publicly_traded_nffe_securities_market: null, + nffe_affiliate_of_publicly_traded_entity_certification: null, + publicly_traded_entity: null, + nffe_affiliate_of_publicly_traded_entity_securities_market: null, + excepted_territory_nffe_certification: null, + active_nffe_certification: null, + passive_nffe_certification: null, + passive_nffe_no_substantial_us_owners_certification: null, + passive_nffe_substantial_us_owners_provided_certification: null, + excepted_inter_affiliate_ffi_certification: null, + sponsored_direct_reporting_nffe_certification: null, + direct_reporting_nffe_sponsoring_entity: null, + substantial_us_owners: null, + signer_name: null, + capacity_to_sign_certification: null, + company_id: null, + reference_id: null, + email: null, + e_delivery_consented_at: null, + signature: null +) +``` + diff --git a/docs/A1099/V2/W8BenEFormResponse.md b/docs/A1099/V2/W8BenEFormResponse.md index f260758..a7edd59 100644 --- a/docs/A1099/V2/W8BenEFormResponse.md +++ b/docs/A1099/V2/W8BenEFormResponse.md @@ -78,11 +78,11 @@ | **territory_financial_institution_certification** | **Boolean** | Certifies that the entity is a financial institution (other than an investment entity) that is incorporated or organized under the laws of a possession of the United States. | [optional] | | **excepted_nonfinancial_group_entity_certification** | **Boolean** | Certifies that the entity is a holding company, treasury center, or captive finance company operating within a nonfinancial group and not functioning as an investment or financial institution. | [optional] | | **excepted_nonfinancial_start_up_certification** | **Boolean** | Certifies that the entity is a recently formed startup NFFE investing in a non-financial business and is not operating as or presenting itself as an investment fund. | [optional] | -| **startup_formation_or_resolution_date** | **Time** | The date the start-up company was formed on (or, in case of new line of business, the date of board resolution approving the new line of business). | [optional] | +| **startup_formation_or_resolution_date** | **Date** | The date the start-up company was formed on (or, in case of new line of business, the date of board resolution approving the new line of business). | [optional] | | **excepted_nonfinancial_entity_in_liquidation_or_bankruptcy_certification** | **Boolean** | Certifies that the entity is in liquidation, reorganization, or bankruptcy and intends to operate as a nonfinancial entity, with supporting documentation available if the process exceeds three years. | [optional] | -| **nonfinancial_entity_filing_date** | **Time** | The filed date for a plan of reorganization, liquidation or bankruptcy. | [optional] | +| **nonfinancial_entity_filing_date** | **Date** | The filed date for a plan of reorganization, liquidation or bankruptcy. | [optional] | | **section501_c_organization_certification** | **Boolean** | Certifies that the entity is a section 501(c) organization based on a valid IRS determination letter or a legal opinion from U.S. counsel. | [optional] | -| **determination_letter_date** | **Time** | The date of the IRS determination letter confirming the entity’s section 501(c) status. | [optional] | +| **determination_letter_date** | **Date** | The date of the IRS determination letter confirming the entity’s section 501(c) status. | [optional] | | **nonprofit_organization_certification** | **Boolean** | Certifies that the entity is a nonprofit organization established for charitable or similar purposes, exempt from income tax, and restricted in the use and distribution of its assets under applicable law. | [optional] | | **publicly_traded_nffe_certification** | **Boolean** | Certifies that the entity is a foreign corporation that is not a financial institution and whose stock is regularly traded on an established securities market. | [optional] | | **publicly_traded_nffe_securities_market** | **String** | The name of the securities market where the corporation's stock is regularly traded. | [optional] | diff --git a/docs/A1099/V2/W8BenFormDataModel.md b/docs/A1099/V2/W8BenFormDataModel.md index 99236c7..72b8421 100644 --- a/docs/A1099/V2/W8BenFormDataModel.md +++ b/docs/A1099/V2/W8BenFormDataModel.md @@ -129,9 +129,9 @@ | **certify_box41** | **Boolean** | | [optional] | | **certify_box43** | **Boolean** | | [optional] | | **certify_part29_signature** | **Boolean** | | [optional] | -| **part19_formation_or_resolution_date** | **Time** | | [optional] | -| **part20_filing_date** | **Time** | | [optional] | -| **part21_determination_date** | **Time** | | [optional] | +| **part19_formation_or_resolution_date** | **Date** | | [optional] | +| **part20_filing_date** | **Date** | | [optional] | +| **part21_determination_date** | **Date** | | [optional] | | **substantial_us_owners** | [**Array<W8BenESubstantialUsOwnerDataModel>**](W8BenESubstantialUsOwnerDataModel.md) | | [optional] | | **ein** | **String** | The employer identification number (EIN). | [optional] | | **ein_type** | **String** | The type of employer identification number (EIN). | [optional] | @@ -201,8 +201,8 @@ | **certify_box40** | **Boolean** | Indicates certification for box 40. | [optional] | | **box41_sponsoring_entity** | **String** | The sponsoring entity information for box 41. | [optional] | | **certify_box42** | **Boolean** | Indicates certification for box 42. | [optional] | -| **box35_formed_on_date** | **Time** | | [optional] | -| **box36_filed_on_date** | **Time** | | [optional] | +| **box35_formed_on_date** | **Date** | | [optional] | +| **box36_filed_on_date** | **Date** | | [optional] | | **tin_match_status** | **String** | The status of the TIN match. | [optional] | | **signature** | **String** | The signature itself | [optional] | | **business_classification** | **String** | The classification of the business. | [optional] | diff --git a/docs/A1099/V2/W8BenFormRequest.md b/docs/A1099/V2/W8BenFormRequest.md new file mode 100644 index 0000000..815bba9 --- /dev/null +++ b/docs/A1099/V2/W8BenFormRequest.md @@ -0,0 +1,76 @@ +# AvalaraSdk::A1099::V2::W8BenFormRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **type** | **String** | The form type (always \"w8ben\" for this model). | [optional][readonly] | +| **name** | **String** | The name of the individual or entity associated with the form. | [optional] | +| **citizenship_country** | **String** | The country of citizenship. | [optional] | +| **residence_address** | **String** | The residential address of the individual or entity. | [optional] | +| **residence_city** | **String** | The city of residence. | [optional] | +| **residence_state** | **String** | The state of residence. | [optional] | +| **residence_zip** | **String** | The ZIP code of the residence. | [optional] | +| **residence_country** | **String** | The country of residence. | [optional] | +| **residence_is_mailing** | **Boolean** | Indicates whether the residence address is the mailing address. | [optional] | +| **mailing_address** | **String** | The mailing address. | [optional] | +| **mailing_city** | **String** | The city of the mailing address. | [optional] | +| **mailing_state** | **String** | The state of the mailing address. | [optional] | +| **mailing_zip** | **String** | The ZIP code of the mailing address. | [optional] | +| **mailing_country** | **String** | The country of the mailing address. | [optional] | +| **tin** | **String** | The taxpayer identification number (TIN). | [optional] | +| **foreign_tin_not_required** | **Boolean** | Indicates whether a foreign TIN is not legally required. | [optional] | +| **foreign_tin** | **String** | The foreign taxpayer identification number (TIN). | [optional] | +| **reference_number** | **String** | A reference number for the form. | [optional] | +| **birthday** | **Date** | The birthday of the individual associated with the form. | [optional] | +| **treaty_country** | **String** | The country for which the treaty applies. | [optional] | +| **treaty_article** | **String** | The specific article of the treaty being claimed. | [optional] | +| **treaty_reasons** | **String** | The reasons for claiming treaty benefits. | [optional] | +| **withholding_rate** | **String** | The withholding rate applied as per the treaty. | [optional] | +| **income_type** | **String** | The type of income covered by the treaty. | [optional] | +| **signer_name** | **String** | The name of the signer of the form. | [optional] | +| **company_id** | **String** | The ID of the associated company. | [optional] | +| **reference_id** | **String** | A reference identifier for the form. | [optional] | +| **email** | **String** | The email address of the individual associated with the form. | [optional] | +| **e_delivery_consented_at** | **Time** | The date when e-delivery was consented. | [optional] | +| **signature** | **String** | The signature of the form. | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::W8BenFormRequest.new( + type: W4, + name: null, + citizenship_country: null, + residence_address: null, + residence_city: null, + residence_state: null, + residence_zip: null, + residence_country: null, + residence_is_mailing: null, + mailing_address: null, + mailing_city: null, + mailing_state: null, + mailing_zip: null, + mailing_country: null, + tin: null, + foreign_tin_not_required: null, + foreign_tin: null, + reference_number: null, + birthday: null, + treaty_country: null, + treaty_article: null, + treaty_reasons: null, + withholding_rate: null, + income_type: null, + signer_name: null, + company_id: null, + reference_id: null, + email: null, + e_delivery_consented_at: null, + signature: null +) +``` + diff --git a/docs/A1099/V2/W8BeneFormDataModel.md b/docs/A1099/V2/W8BeneFormDataModel.md index 1183f97..693e405 100644 --- a/docs/A1099/V2/W8BeneFormDataModel.md +++ b/docs/A1099/V2/W8BeneFormDataModel.md @@ -103,9 +103,9 @@ | **certify_box41** | **Boolean** | | [optional] | | **certify_box43** | **Boolean** | | [optional] | | **certify_part29_signature** | **Boolean** | | [optional] | -| **part19_formation_or_resolution_date** | **Time** | | [optional] | -| **part20_filing_date** | **Time** | | [optional] | -| **part21_determination_date** | **Time** | | [optional] | +| **part19_formation_or_resolution_date** | **Date** | | [optional] | +| **part20_filing_date** | **Date** | | [optional] | +| **part21_determination_date** | **Date** | | [optional] | | **substantial_us_owners** | [**Array<W8BenESubstantialUsOwnerDataModel>**](W8BenESubstantialUsOwnerDataModel.md) | | [optional] | | **employee_first_name** | **String** | The first name of the employee. | [optional] | | **employee_middle_name** | **String** | The middle name of the employee. | [optional] | @@ -201,8 +201,8 @@ | **certify_box40** | **Boolean** | Indicates certification for box 40. | [optional] | | **box41_sponsoring_entity** | **String** | The sponsoring entity information for box 41. | [optional] | | **certify_box42** | **Boolean** | Indicates certification for box 42. | [optional] | -| **box35_formed_on_date** | **Time** | | [optional] | -| **box36_filed_on_date** | **Time** | | [optional] | +| **box35_formed_on_date** | **Date** | | [optional] | +| **box36_filed_on_date** | **Date** | | [optional] | | **tin_match_status** | **String** | The status of the TIN match. | [optional] | | **signature** | **String** | The signature itself | [optional] | | **business_classification** | **String** | The classification of the business. | [optional] | diff --git a/docs/A1099/V2/W8ImyFormDataModel.md b/docs/A1099/V2/W8ImyFormDataModel.md index 3ab0af3..a85439e 100644 --- a/docs/A1099/V2/W8ImyFormDataModel.md +++ b/docs/A1099/V2/W8ImyFormDataModel.md @@ -122,8 +122,8 @@ | **certify_box42** | **Boolean** | Indicates certification for box 42. | [optional] | | **signer_name** | **String** | The name of the signer of the form. | [optional] | | **e_delivery_consented_at** | **Time** | The date when e-delivery was consented. | [optional] | -| **box35_formed_on_date** | **Time** | | [optional] | -| **box36_filed_on_date** | **Time** | | [optional] | +| **box35_formed_on_date** | **Date** | | [optional] | +| **box36_filed_on_date** | **Date** | | [optional] | | **employee_first_name** | **String** | The first name of the employee. | [optional] | | **employee_middle_name** | **String** | The middle name of the employee. | [optional] | | **employee_last_name** | **String** | The last name of the employee. | [optional] | @@ -193,9 +193,9 @@ | **certify_box41** | **Boolean** | | [optional] | | **certify_box43** | **Boolean** | | [optional] | | **certify_part29_signature** | **Boolean** | | [optional] | -| **part19_formation_or_resolution_date** | **Time** | | [optional] | -| **part20_filing_date** | **Time** | | [optional] | -| **part21_determination_date** | **Time** | | [optional] | +| **part19_formation_or_resolution_date** | **Date** | | [optional] | +| **part20_filing_date** | **Date** | | [optional] | +| **part21_determination_date** | **Date** | | [optional] | | **substantial_us_owners** | [**Array<W8BenESubstantialUsOwnerDataModel>**](W8BenESubstantialUsOwnerDataModel.md) | | [optional] | | **birthday** | **String** | The birthday of the individual associated with the form. | [optional] | | **foreign_tin_not_required** | **Boolean** | Indicates whether a foreign TIN is not required. | [optional] | diff --git a/docs/A1099/V2/W8ImyFormRequest.md b/docs/A1099/V2/W8ImyFormRequest.md new file mode 100644 index 0000000..42bbf5e --- /dev/null +++ b/docs/A1099/V2/W8ImyFormRequest.md @@ -0,0 +1,250 @@ +# AvalaraSdk::A1099::V2::W8ImyFormRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **type** | **String** | The form type (always \"w8imy\" for this model). | [optional][readonly] | +| **name** | **String** | The name of the individual or entity associated with the form. | [optional] | +| **citizenship_country** | **String** | The country of citizenship. | [optional] | +| **disregarded_entity** | **String** | The name of the disregarded entity receiving the payment (if applicable). | [optional] | +| **entity_type** | **String** | The entity type. | [optional] | +| **fatca_status** | **String** | The FATCA status. | [optional] | +| **residence_address** | **String** | The residential address of the individual or entity. | [optional] | +| **residence_city** | **String** | The city of residence. | [optional] | +| **residence_state** | **String** | The state of residence. | [optional] | +| **residence_zip** | **String** | The ZIP code of the residence. | [optional] | +| **residence_country** | **String** | The country of residence. | [optional] | +| **residence_is_mailing** | **Boolean** | Indicates whether the residence address is also the mailing address. | [optional] | +| **mailing_address** | **String** | The mailing address. | [optional] | +| **mailing_city** | **String** | The city of the mailing address. | [optional] | +| **mailing_state** | **String** | The state of the mailing address. | [optional] | +| **mailing_zip** | **String** | The ZIP code of the mailing address. | [optional] | +| **mailing_country** | **String** | The country of the mailing address. | [optional] | +| **tin_type** | **String** | The type of TIN provided. | [optional] | +| **tin** | **String** | The taxpayer identification number (TIN). | [optional] | +| **giin** | **String** | The global intermediary identification number (GIIN). | [optional] | +| **foreign_tin** | **String** | The foreign taxpayer identification number (TIN). | [optional] | +| **reference_number** | **String** | A reference number for the form. | [optional] | +| **disregarded_entity_fatca_status** | **String** | The FATCA status of disregarded entity or branch receiving payment. | [optional] | +| **disregarded_address** | **String** | The address for disregarded entities. | [optional] | +| **disregarded_city** | **String** | The city for disregarded entities. | [optional] | +| **disregarded_state** | **String** | The state for disregarded entities. | [optional] | +| **disregarded_zip** | **String** | The ZIP code for disregarded entities. | [optional] | +| **disregarded_country** | **String** | The country for disregarded entities. | [optional] | +| **disregarded_entity_giin** | **String** | The GIIN for disregarded entities. | [optional] | +| **qualified_intermediary_certification** | **Boolean** | Certifies that the entity is a Qualified Intermediary (QI) acting in accordance with its QI Agreement, providing required withholding statements and documentation for relevant tax withholding purposes. | [optional] | +| **qi_primary_withholding_responsibility_certification** | **Boolean** | Certifies that the Qualified Intermediary assumes primary withholding responsibility under chapters 3 and 4 for the specified accounts. | [optional] | +| **qi_withholding_responsibility_for_ptp_sales_certification** | **Boolean** | Certifies that the Qualified Intermediary assumes primary withholding and reporting responsibility under section 1446(f) for amounts realized from sales of interests in publicly traded partnerships. | [optional] | +| **qi_nominee_withholding_responsibility_for_ptp_distributions_certification** | **Boolean** | Certifies that the Qualified Intermediary assumes primary withholding responsibility as a nominee under Regulations section 1.1446-4(b)(3) for publicly traded partnership distributions. | [optional] | +| **qi_securities_lender_substitute_dividend_withholding_certification** | **Boolean** | Certifies that the Qualified Intermediary is acting as a qualified securities lender and assumes primary withholding and reporting responsibilities for U.S. source substitute dividend payments. | [optional] | +| **qi_withholding_and1099_reporting_responsibility_certification** | **Boolean** | Certifies that the Qualified Intermediary assumes primary withholding under chapters 3 and 4, and primary Form 1099 reporting and backup withholding responsibility for U.S. source interest and substitute interest payments. | [optional] | +| **qi_form1099_or_fatca_reporting_responsibility_certification** | **Boolean** | Certifies that the Qualified Intermediary assumes Form 1099 reporting and backup withholding responsibility, or FATCA reporting responsibility as a participating or registered deemed-compliant FFI, for accounts held by specified U.S. persons. | [optional] | +| **qi_opt_out_of_form1099_reporting_certification** | **Boolean** | Certifies that the Qualified Intermediary does not assume primary Form 1099 reporting and backup withholding responsibility for the accounts associated with this form. | [optional] | +| **qi_withholding_rate_pool_certification** | **Boolean** | Certifies that the Qualified Intermediary meets the requirements for allocating payments to a chapter 4 withholding rate pool of U.S. payees under Regulations section 1.6049-4(c)(4)(iii). | [optional] | +| **qi_intermediary_or_flow_through_entity_documentation_certification** | **Boolean** | Certifies that the Qualified Intermediary has obtained or will obtain documentation confirming the status of any intermediary or flow-through entity as a participating FFI, registered deemed-compliant FFI, or QI for U.S. payees in a chapter 4 withholding rate pool. | [optional] | +| **qualified_derivatives_dealer_certification** | **Boolean** | Certifies that the Qualified Derivatives Dealer (QDD) is approved by the IRS and assumes primary withholding and reporting responsibilities for payments related to potential section 871(m) transactions. | [optional] | +| **qdd_corporation** | **Boolean** | Indicates QDD classification is Corporation. | [optional] | +| **qdd_partnership** | **Boolean** | Indicates QDD classification is Partnership. | [optional] | +| **qdd_disregarded_entity** | **Boolean** | Indicates QDD classification is Disregarded Entity. | [optional] | +| **nonqualified_intermediary_certification** | **Boolean** | Certifies that the entity is not acting as a Qualified Intermediary and is not acting for its own account for the accounts covered by this form. | [optional] | +| **nqi_withholding_statement_transmission_certification** | **Boolean** | Certifies that the nonqualified intermediary is submitting this form to transmit withholding certificates and/or other required documentation along with a withholding statement. | [optional] | +| **nqi_withholding_rate_pool_compliance_certification** | **Boolean** | Certifies that the nonqualified intermediary meets the requirements of Regulations section 1.6049-4(c)(4)(iii) for U.S. payees included in a withholding rate pool, excluding publicly traded partnership distributions. | [optional] | +| **nqi_qualified_securities_lender_certification** | **Boolean** | Certifies that the nonqualified intermediary is acting as a qualified securities lender (not as a QI) and assumes primary withholding and reporting responsibilities for U.S. source substitute dividend payments. | [optional] | +| **nqi_alternative_withholding_statement_verification_certification** | **Boolean** | Certifies that the nonqualified intermediary has verified, or will verify, all information on alternative withholding statements for consistency with account data to determine the correct withholding rate, as required under sections 1441 or 1471. | [optional] | +| **territory_financial_institution_certification** | **Boolean** | Certifies that the entity is a financial institution (other than an investment entity) that is incorporated or organized under the laws of a possession of the United States. | [optional] | +| **tfi_treated_as_us_person_certification** | **Boolean** | Certifies that the territory financial institution agrees to be treated as a U.S. person for chapters 3 and 4 purposes concerning reportable amounts and withholdable payments. | [optional] | +| **tfi_withholding_statement_transmission_certification** | **Boolean** | Certifies that the territory financial institution is transmitting withholding certificates or other required documentation and has provided or will provide a withholding statement for reportable or withholdable payments. | [optional] | +| **tfi_treated_as_us_person_for_ptp_sales_certification** | **Boolean** | Certifies that the territory financial institution agrees to be treated as a U.S. person under Regulations section 1.1446(f)-4(a)(2)(i)(B) for amounts realized from sales of publicly traded partnership interests. | [optional] | +| **tfi_nominee_us_person_for_ptp_distributions_certification** | **Boolean** | Certifies that the territory financial institution agrees to be treated as a U.S. person and as a nominee for purposes of publicly traded partnership distributions under the applicable regulations. | [optional] | +| **tfi_not_nominee_for_ptp_distributions_certification** | **Boolean** | Certifies that the territory financial institution is not acting as a nominee for publicly traded partnership distributions and is providing withholding statements for those distributions. | [optional] | +| **us_branch_non_effectively_connected_income_certification** | **Boolean** | Certifies that the U.S. branch is receiving reportable or withholdable payments that are not effectively connected income, PTP distributions, or proceeds from PTP sales. | [optional] | +| **us_branch_agreement_to_be_treated_as_us_person_certification** | **Boolean** | Certifies that the U.S. branch of a foreign bank or insurance company agrees to be treated as a U.S. person for reportable amounts or withholdable payments under the applicable regulations. | [optional] | +| **us_branch_withholding_statement_and_compliance_certification** | **Boolean** | Certifies that the U.S. branch is transmitting required documentation and withholding statements for reportable or withholdable payments and is applying the appropriate FATCA regulations. | [optional] | +| **us_branch_acting_as_us_person_for_ptp_sales_certification** | **Boolean** | Certifies that the U.S. branch is acting as a U.S. person for purposes of amounts realized from sales of publicly traded partnership interests under the applicable regulations. | [optional] | +| **us_branch_nominee_for_ptp_distributions_certification** | **Boolean** | Certifies that the U.S. branch is treated as a U.S. person and as a nominee for publicly traded partnership distributions under the applicable regulations. | [optional] | +| **us_branch_not_nominee_for_ptp_distributions_certification** | **Boolean** | Certifies that the U.S. branch is not acting as a nominee for publicly traded partnership distributions and is providing the required withholding statements. | [optional] | +| **withholding_foreign_partnership_or_trust_certification** | **Boolean** | Certifies that the entity is a withholding foreign partnership (WP) or a withholding foreign trust (WT) that is compliant with the terms of its WP or WT agreement. | [optional] | +| **nonwithholding_foreign_entity_withholding_statement_certification** | **Boolean** | Certifies that the entity is a nonwithholding foreign partnership or trust, providing the form for non-effectively connected payments and transmitting required withholding documentation for chapters 3 and 4. | [optional] | +| **foreign_entity_partner_in_lower_tier_partnership_certification** | **Boolean** | Certifies that the entity is a foreign partnership or grantor trust acting as a partner in a lower-tier partnership and is submitting the form for purposes of section 1446(a). | [optional] | +| **foreign_partnership_amount_realized_section1446_f_certification** | **Boolean** | Certifies that the entity is a foreign partnership receiving an amount realized from the transfer of a partnership interest for purposes of section 1446(f). | [optional] | +| **foreign_partnership_modified_amount_realized_certification** | **Boolean** | Certifies that the foreign partnership is providing a withholding statement for a modified amount realized from the transfer of a partnership interest, when applicable. | [optional] | +| **foreign_grantor_trust_amount_realized_allocation_certification** | **Boolean** | Certifies that the foreign grantor trust is submitting the form on behalf of each grantor or owner and providing a withholding statement to allocate the amount realized in accordance with the regulations. | [optional] | +| **alternative_withholding_statement_reliance_certification** | **Boolean** | Certifies that the entity may rely on the information in all associated withholding certificates under the applicable standards of knowledge in sections 1441 or 1471 when providing an alternative withholding statement. | [optional] | +| **np_ffi_with_exempt_beneficial_owners_certification** | **Boolean** | Certifies that the nonparticipating FFI is transmitting withholding documentation and providing a statement allocating payment portions to exempt beneficial owners. | [optional] | +| **ffi_sponsoring_entity** | **String** | The name of the entity that sponsors the foreign financial institution (FFI). | [optional] | +| **investment_entity_certification** | **Boolean** | Certifies that the entity is an investment entity, not a QI, WP, or WT, and has an agreement with a sponsoring entity. | [optional] | +| **controlled_foreign_corporation_certification** | **Boolean** | Certifies that the entity is a controlled foreign corporation sponsored by a U.S. financial institution, not a QI, WP, or WT, and shares a common electronic account system for full transparency. | [optional] | +| **owner_documented_ffi_certification** | **Boolean** | Certifies that the FFI meets all requirements to qualify as an owner-documented FFI, including restrictions on activities, ownership, and account relationships. | [optional] | +| **owner_documented_ffi_reporting_statement_certification** | **Boolean** | Certifies that the FFI will provide a complete owner reporting statement and required documentation for each relevant owner or debt holder. | [optional] | +| **owner_documented_ffi_auditor_letter_certification** | **Boolean** | Certifies that the FFI has provided or will provide an auditor’s letter and required owner documentation, including a reporting statement and Form W-9s, to meet owner-documented FFI requirements under the regulations. | [optional] | +| **compliant_nonregistering_local_bank_certification** | **Boolean** | Certifies that the FFI operates solely as a limited bank or credit union within its country, meets asset thresholds, and has no foreign operations or affiliations outside its country of organization. | [optional] | +| **compliant_ffi_low_value_accounts_certification** | **Boolean** | Certifies that the FFI is not primarily engaged in investment activities, maintains only low-value accounts, and has limited total assets within its group. | [optional] | +| **sponsored_closely_held_entity_sponsoring_entity** | **String** | The name of sponsoring entity for a certified deemed-compliant, closely held investment vehicle. | [optional] | +| **sponsored_closely_held_investment_vehicle_certification** | **Boolean** | Certifies that the entity is a sponsored investment entity with 20 or fewer individual owners, and that all compliance obligations are fulfilled by the sponsoring entity. | [optional] | +| **compliant_limited_life_debt_entity_certification** | **Boolean** | Certifies that the entity qualifies as a limited life debt investment entity based on its formation date, issuance terms, and compliance with regulatory requirements. | [optional] | +| **investment_entity_no_financial_accounts_certification** | **Boolean** | Certifies that the entity is a financial institution solely because it is an investment entity under regulations and the entity does not maintain financial accounts. | [optional] | +| **restricted_distributor_certification** | **Boolean** | Certifies that the entity qualifies as a restricted distributor based on its operations, customer base, regulatory compliance, and financial and geographic limitations. | [optional] | +| **restricted_distributor_agreement_certification** | **Boolean** | Certifies that the entity is, and has been, bound by distribution agreements prohibiting sales of fund interests to specified U.S. persons and certain non-U.S. entities. | [optional] | +| **restricted_distributor_preexisting_sales_compliance_certification** | **Boolean** | Certifies that the entity complies with distribution restrictions for U.S.-linked investors and has addressed any preexisting sales in accordance with FATCA regulations. | [optional] | +| **foreign_central_bank_of_issue_certification** | **Boolean** | Certifies that the entity is treated as the beneficial owner of the payment solely for purposes of chapter 4 under Regulations section 1.1471-6(d)(4). | [optional] | +| **nonreporting_iga_ffi_certification** | **Boolean** | Certifies that the entity meets the requirements to be considered a nonreporting financial institution to an applicable IGA. | [optional] | +| **iga_country** | **String** | The country for the applicable IGA with the United States. | [optional] | +| **iga_model** | **String** | The applicable IGA model. | [optional] | +| **iga_legal_status_treatment** | **String** | Specifies how the applicable IGA is treated under the IGA provisions or Treasury regulations. | [optional] | +| **iga_ffi_trustee_or_sponsor** | **String** | The trustee or sponsor name for the nonreporting IGA FFI. | [optional] | +| **iga_ffi_trustee_is_foreign** | **Boolean** | Indicates whether the trustee for the nonreporting IGA FFI is foreign. | [optional] | +| **treaty_qualified_pension_fund_certification** | **Boolean** | Certifies that the entity is a pension or retirement fund established in a treaty country and is entitled to treaty benefits on U.S. source income. | [optional] | +| **qualified_retirement_fund_certification** | **Boolean** | Certifies that the entity is a government-regulated retirement fund meeting specific requirements for contributions, tax exemption, beneficiary limits, and distribution restrictions. | [optional] | +| **narrow_participation_retirement_fund_certification** | **Boolean** | Certifies that the entity is a government-regulated retirement fund with fewer than 50 participants, limited foreign ownership, and employer sponsorship that is not from investment entities or passive NFFEs. | [optional] | +| **section401_a_equivalent_pension_plan_certification** | **Boolean** | Certifies that the entity is formed under a pension plan meeting section 401(a) requirements, except for being U.S.-trust funded. | [optional] | +| **investment_entity_for_retirement_funds_certification** | **Boolean** | Certifies that the entity is established solely to earn income for the benefit of qualifying retirement funds or accounts under applicable FATCA regulations or IGAs. | [optional] | +| **exempt_beneficial_owner_sponsored_retirement_fund_certification** | **Boolean** | Certifies that the entity is established and sponsored by a qualifying exempt beneficial owner to provide retirement, disability, or death benefits to individuals based on services performed for the sponsor. | [optional] | +| **excepted_nonfinancial_group_entity_certification** | **Boolean** | Certifies that the entity is a holding company, treasury center, or captive finance company operating within a nonfinancial group and not functioning as an investment or financial institution. | [optional] | +| **excepted_nonfinancial_start_up_certification** | **Boolean** | Certifies that the entity is a recently formed startup NFFE investing in a non-financial business and is not operating as or presenting itself as an investment fund. | [optional] | +| **startup_formation_or_resolution_date** | **Date** | The date the start-up company was formed on (or, in case of new line of business, the date of board resolution approving the new line of business). | [optional] | +| **excepted_nonfinancial_entity_in_liquidation_or_bankruptcy_certification** | **Boolean** | Certifies that the entity is in liquidation, reorganization, or bankruptcy and intends to operate as a nonfinancial entity, with supporting documentation available if the process exceeds three years. | [optional] | +| **nonfinancial_entity_filing_date** | **Date** | The filed date for a plan of reorganization, liquidation or bankruptcy. | [optional] | +| **publicly_traded_nffe_certification** | **Boolean** | Certifies that the entity is a foreign corporation that is not a financial institution and whose stock is regularly traded on an established securities market. | [optional] | +| **publicly_traded_nffe_securities_market** | **String** | The name of the securities market where the corporation's stock is regularly traded. | [optional] | +| **nffe_affiliate_of_publicly_traded_entity_certification** | **Boolean** | Certifies that the entity is a foreign corporation that is not a financial institution and is affiliated with a publicly traded entity within the same expanded affiliated group. | [optional] | +| **publicly_traded_entity** | **String** | The name of the affiliated entity whose stock is regularly traded on an established securities market. | [optional] | +| **nffe_affiliate_of_publicly_traded_entity_securities_market** | **String** | The name of the established securities market where the affiliated entity's stock is traded. | [optional] | +| **excepted_territory_nffe_certification** | **Boolean** | Certifies that the entity is organized in a U.S. possession, is not engaged in financial activities, and is entirely owned by bona fide residents of that possession. | [optional] | +| **active_nffe_certification** | **Boolean** | Certifies that the entity is a foreign non-financial institution with less than 50% passive income and less than 50% of its assets producing or held to produce passive income. | [optional] | +| **passive_nffe_certification** | **Boolean** | Certifies that the entity is a foreign non-financial entity that does not qualify for any other NFFE category and is not a financial institution. | [optional] | +| **sponsored_direct_reporting_nffe_certification** | **Boolean** | Certifies that the entity is a sponsored direct reporting NFFE. | [optional] | +| **direct_reporting_nffe_sponsoring_entity** | **String** | The name of the entity that sponsors the direct reporting NFFE. | [optional] | +| **signer_name** | **String** | The name of the signer. | [optional] | +| **company_id** | **String** | The ID of the associated company. | [optional] | +| **reference_id** | **String** | A reference identifier for the form. | [optional] | +| **email** | **String** | The email address of the individual associated with the form. | [optional] | +| **e_delivery_consented_at** | **Time** | The date when e-delivery was consented. | [optional] | +| **signature** | **String** | The signature of the form. | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::W8ImyFormRequest.new( + type: W4, + name: null, + citizenship_country: null, + disregarded_entity: null, + entity_type: null, + fatca_status: null, + residence_address: null, + residence_city: null, + residence_state: null, + residence_zip: null, + residence_country: null, + residence_is_mailing: null, + mailing_address: null, + mailing_city: null, + mailing_state: null, + mailing_zip: null, + mailing_country: null, + tin_type: null, + tin: null, + giin: null, + foreign_tin: null, + reference_number: null, + disregarded_entity_fatca_status: null, + disregarded_address: null, + disregarded_city: null, + disregarded_state: null, + disregarded_zip: null, + disregarded_country: null, + disregarded_entity_giin: null, + qualified_intermediary_certification: null, + qi_primary_withholding_responsibility_certification: null, + qi_withholding_responsibility_for_ptp_sales_certification: null, + qi_nominee_withholding_responsibility_for_ptp_distributions_certification: null, + qi_securities_lender_substitute_dividend_withholding_certification: null, + qi_withholding_and1099_reporting_responsibility_certification: null, + qi_form1099_or_fatca_reporting_responsibility_certification: null, + qi_opt_out_of_form1099_reporting_certification: null, + qi_withholding_rate_pool_certification: null, + qi_intermediary_or_flow_through_entity_documentation_certification: null, + qualified_derivatives_dealer_certification: null, + qdd_corporation: null, + qdd_partnership: null, + qdd_disregarded_entity: null, + nonqualified_intermediary_certification: null, + nqi_withholding_statement_transmission_certification: null, + nqi_withholding_rate_pool_compliance_certification: null, + nqi_qualified_securities_lender_certification: null, + nqi_alternative_withholding_statement_verification_certification: null, + territory_financial_institution_certification: null, + tfi_treated_as_us_person_certification: null, + tfi_withholding_statement_transmission_certification: null, + tfi_treated_as_us_person_for_ptp_sales_certification: null, + tfi_nominee_us_person_for_ptp_distributions_certification: null, + tfi_not_nominee_for_ptp_distributions_certification: null, + us_branch_non_effectively_connected_income_certification: null, + us_branch_agreement_to_be_treated_as_us_person_certification: null, + us_branch_withholding_statement_and_compliance_certification: null, + us_branch_acting_as_us_person_for_ptp_sales_certification: null, + us_branch_nominee_for_ptp_distributions_certification: null, + us_branch_not_nominee_for_ptp_distributions_certification: null, + withholding_foreign_partnership_or_trust_certification: null, + nonwithholding_foreign_entity_withholding_statement_certification: null, + foreign_entity_partner_in_lower_tier_partnership_certification: null, + foreign_partnership_amount_realized_section1446_f_certification: null, + foreign_partnership_modified_amount_realized_certification: null, + foreign_grantor_trust_amount_realized_allocation_certification: null, + alternative_withholding_statement_reliance_certification: null, + np_ffi_with_exempt_beneficial_owners_certification: null, + ffi_sponsoring_entity: null, + investment_entity_certification: null, + controlled_foreign_corporation_certification: null, + owner_documented_ffi_certification: null, + owner_documented_ffi_reporting_statement_certification: null, + owner_documented_ffi_auditor_letter_certification: null, + compliant_nonregistering_local_bank_certification: null, + compliant_ffi_low_value_accounts_certification: null, + sponsored_closely_held_entity_sponsoring_entity: null, + sponsored_closely_held_investment_vehicle_certification: null, + compliant_limited_life_debt_entity_certification: null, + investment_entity_no_financial_accounts_certification: null, + restricted_distributor_certification: null, + restricted_distributor_agreement_certification: null, + restricted_distributor_preexisting_sales_compliance_certification: null, + foreign_central_bank_of_issue_certification: null, + nonreporting_iga_ffi_certification: null, + iga_country: null, + iga_model: null, + iga_legal_status_treatment: null, + iga_ffi_trustee_or_sponsor: null, + iga_ffi_trustee_is_foreign: null, + treaty_qualified_pension_fund_certification: null, + qualified_retirement_fund_certification: null, + narrow_participation_retirement_fund_certification: null, + section401_a_equivalent_pension_plan_certification: null, + investment_entity_for_retirement_funds_certification: null, + exempt_beneficial_owner_sponsored_retirement_fund_certification: null, + excepted_nonfinancial_group_entity_certification: null, + excepted_nonfinancial_start_up_certification: null, + startup_formation_or_resolution_date: null, + excepted_nonfinancial_entity_in_liquidation_or_bankruptcy_certification: null, + nonfinancial_entity_filing_date: null, + publicly_traded_nffe_certification: null, + publicly_traded_nffe_securities_market: null, + nffe_affiliate_of_publicly_traded_entity_certification: null, + publicly_traded_entity: null, + nffe_affiliate_of_publicly_traded_entity_securities_market: null, + excepted_territory_nffe_certification: null, + active_nffe_certification: null, + passive_nffe_certification: null, + sponsored_direct_reporting_nffe_certification: null, + direct_reporting_nffe_sponsoring_entity: null, + signer_name: null, + company_id: null, + reference_id: null, + email: null, + e_delivery_consented_at: null, + signature: null +) +``` + diff --git a/docs/A1099/V2/W8ImyFormResponse.md b/docs/A1099/V2/W8ImyFormResponse.md index 81cbb51..2a0bfc9 100644 --- a/docs/A1099/V2/W8ImyFormResponse.md +++ b/docs/A1099/V2/W8ImyFormResponse.md @@ -101,9 +101,9 @@ | **exempt_beneficial_owner_sponsored_retirement_fund_certification** | **Boolean** | Certifies that the entity is established and sponsored by a qualifying exempt beneficial owner to provide retirement, disability, or death benefits to individuals based on services performed for the sponsor. | [optional] | | **excepted_nonfinancial_group_entity_certification** | **Boolean** | Certifies that the entity is a holding company, treasury center, or captive finance company operating within a nonfinancial group and not functioning as an investment or financial institution. | [optional] | | **excepted_nonfinancial_start_up_certification** | **Boolean** | Certifies that the entity is a recently formed startup NFFE investing in a non-financial business and is not operating as or presenting itself as an investment fund. | [optional] | -| **startup_formation_or_resolution_date** | **Time** | The date the start-up company was formed on (or, in case of new line of business, the date of board resolution approving the new line of business). | [optional] | +| **startup_formation_or_resolution_date** | **Date** | The date the start-up company was formed on (or, in case of new line of business, the date of board resolution approving the new line of business). | [optional] | | **excepted_nonfinancial_entity_in_liquidation_or_bankruptcy_certification** | **Boolean** | Certifies that the entity is in liquidation, reorganization, or bankruptcy and intends to operate as a nonfinancial entity, with supporting documentation available if the process exceeds three years. | [optional] | -| **nonfinancial_entity_filing_date** | **Time** | The filed date for a plan of reorganization, liquidation or bankruptcy. | [optional] | +| **nonfinancial_entity_filing_date** | **Date** | The filed date for a plan of reorganization, liquidation or bankruptcy. | [optional] | | **publicly_traded_nffe_certification** | **Boolean** | Certifies that the entity is a foreign corporation that is not a financial institution and whose stock is regularly traded on an established securities market. | [optional] | | **publicly_traded_nffe_securities_market** | **String** | The name of the securities market where the corporation's stock is regularly traded. | [optional] | | **nffe_affiliate_of_publicly_traded_entity_certification** | **Boolean** | Certifies that the entity is a foreign corporation that is not a financial institution and is affiliated with a publicly traded entity within the same expanded affiliated group. | [optional] | diff --git a/docs/A1099/V2/W9FormBaseRequest.md b/docs/A1099/V2/W9FormBaseRequest.md new file mode 100644 index 0000000..b89bbc1 --- /dev/null +++ b/docs/A1099/V2/W9FormBaseRequest.md @@ -0,0 +1,28 @@ +# AvalaraSdk::A1099::V2::W9FormBaseRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **type** | **String** | The form type. | [optional][readonly] | +| **company_id** | **String** | The ID of the associated company. | [optional] | +| **reference_id** | **String** | A reference identifier for the form. | [optional] | +| **email** | **String** | The email address of the individual associated with the form. | [optional] | +| **e_delivery_consented_at** | **Time** | The date when e-delivery was consented. | [optional] | +| **signature** | **String** | The signature of the form. | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::W9FormBaseRequest.new( + type: W4, + company_id: null, + reference_id: null, + email: null, + e_delivery_consented_at: null, + signature: null +) +``` + diff --git a/docs/A1099/V2/W9FormDataModel.md b/docs/A1099/V2/W9FormDataModel.md index 7c834eb..c89604b 100644 --- a/docs/A1099/V2/W9FormDataModel.md +++ b/docs/A1099/V2/W9FormDataModel.md @@ -133,9 +133,9 @@ | **certify_box41** | **Boolean** | | [optional] | | **certify_box43** | **Boolean** | | [optional] | | **certify_part29_signature** | **Boolean** | | [optional] | -| **part19_formation_or_resolution_date** | **Time** | | [optional] | -| **part20_filing_date** | **Time** | | [optional] | -| **part21_determination_date** | **Time** | | [optional] | +| **part19_formation_or_resolution_date** | **Date** | | [optional] | +| **part20_filing_date** | **Date** | | [optional] | +| **part21_determination_date** | **Date** | | [optional] | | **substantial_us_owners** | [**Array<W8BenESubstantialUsOwnerDataModel>**](W8BenESubstantialUsOwnerDataModel.md) | | [optional] | | **birthday** | **String** | The birthday of the individual associated with the form. | [optional] | | **foreign_tin_not_required** | **Boolean** | Indicates whether a foreign TIN is not required. | [optional] | @@ -214,8 +214,8 @@ | **certify_box40** | **Boolean** | Indicates certification for box 40. | [optional] | | **box41_sponsoring_entity** | **String** | The sponsoring entity information for box 41. | [optional] | | **certify_box42** | **Boolean** | Indicates certification for box 42. | [optional] | -| **box35_formed_on_date** | **Time** | | [optional] | -| **box36_filed_on_date** | **Time** | | [optional] | +| **box35_formed_on_date** | **Date** | | [optional] | +| **box36_filed_on_date** | **Date** | | [optional] | ## Example diff --git a/docs/A1099/V2/W9FormRequest.md b/docs/A1099/V2/W9FormRequest.md new file mode 100644 index 0000000..fe0dd7b --- /dev/null +++ b/docs/A1099/V2/W9FormRequest.md @@ -0,0 +1,64 @@ +# AvalaraSdk::A1099::V2::W9FormRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **type** | **String** | The form type (always \"w9\" for this model). | [optional][readonly] | +| **name** | **String** | The name of the individual or entity associated with the form. | [optional] | +| **business_name** | **String** | The name of the business associated with the form. | [optional] | +| **business_classification** | **String** | The classification of the business. | [optional] | +| **business_other** | **String** | The classification description when \"businessClassification\" is \"Other\". | [optional] | +| **foreign_partner_owner_or_beneficiary** | **Boolean** | Indicates whether the individual is a foreign partner, owner, or beneficiary. | [optional] | +| **exempt_payee_code** | **String** | The exempt payee code. | [optional] | +| **exempt_fatca_code** | **String** | The exemption from FATCA reporting code. | [optional] | +| **foreign_country_indicator** | **Boolean** | Indicates whether the individual or entity is in a foreign country. | [optional] | +| **address** | **String** | The address of the individual or entity. | [optional] | +| **foreign_address** | **String** | The foreign address of the individual or entity. | [optional] | +| **city** | **String** | The city of the address. | [optional] | +| **state** | **String** | The state of the address. | [optional] | +| **zip** | **String** | The ZIP code of the address. | [optional] | +| **account_number** | **String** | The account number associated with the form. | [optional] | +| **tin_type** | **String** | The type of TIN provided. | [optional] | +| **tin** | **String** | The taxpayer identification number (TIN). | [optional] | +| **backup_withholding** | **Boolean** | Indicates whether backup withholding applies. | [optional] | +| **is1099able** | **Boolean** | Indicates whether the individual or entity should be issued a 1099 form. | [optional] | +| **company_id** | **String** | The ID of the associated company. | [optional] | +| **reference_id** | **String** | A reference identifier for the form. | [optional] | +| **email** | **String** | The email address of the individual associated with the form. | [optional] | +| **e_delivery_consented_at** | **Time** | The date when e-delivery was consented. | [optional] | +| **signature** | **String** | The signature of the form. | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::A1099::V2::W9FormRequest.new( + type: W4, + name: null, + business_name: null, + business_classification: null, + business_other: null, + foreign_partner_owner_or_beneficiary: null, + exempt_payee_code: null, + exempt_fatca_code: null, + foreign_country_indicator: null, + address: null, + foreign_address: null, + city: null, + state: null, + zip: null, + account_number: null, + tin_type: null, + tin: null, + backup_withholding: null, + is1099able: null, + company_id: null, + reference_id: null, + email: null, + e_delivery_consented_at: null, + signature: null +) +``` + diff --git a/docs/EInvoicing/V1/Address.md b/docs/EInvoicing/V1/Address.md new file mode 100644 index 0000000..e75d035 --- /dev/null +++ b/docs/EInvoicing/V1/Address.md @@ -0,0 +1,28 @@ +# AvalaraSdk::EInvoicing::V1::Address + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **line1** | **String** | Address line 1 | [optional] | +| **line2** | **String** | Address line 2 | [optional] | +| **city** | **String** | City | [optional] | +| **state** | **String** | State | [optional] | +| **country** | **String** | Country (ISO 3166) | | +| **postal_code** | **String** | Postal code | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::EInvoicing::V1::Address.new( + line1: null, + line2: null, + city: null, + state: null, + country: null, + postal_code: null +) +``` + diff --git a/docs/EInvoicing/V1/BatchErrorDetail.md b/docs/EInvoicing/V1/BatchErrorDetail.md new file mode 100644 index 0000000..9152d9b --- /dev/null +++ b/docs/EInvoicing/V1/BatchErrorDetail.md @@ -0,0 +1,20 @@ +# AvalaraSdk::EInvoicing::V1::BatchErrorDetail + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **index** | **Integer** | The index of the request that caused the error in the batch. | [optional] | +| **validation_errors** | [**Array<ValidationError>**](ValidationError.md) | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::EInvoicing::V1::BatchErrorDetail.new( + index: null, + validation_errors: null +) +``` + diff --git a/docs/EInvoicing/V1/BatchSearchListResponse.md b/docs/EInvoicing/V1/BatchSearchListResponse.md index 84bd2c0..bed31e2 100644 --- a/docs/EInvoicing/V1/BatchSearchListResponse.md +++ b/docs/EInvoicing/V1/BatchSearchListResponse.md @@ -4,9 +4,9 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **record_set_count** | **Integer** | The count of records in the result set | [optional] | +| **record_set_count** | **Integer** | The count of records in the result set. | [optional] | | **next_link** | **String** | Next Link | [optional] | -| **value** | [**Array<BatchSearch>**](BatchSearch.md) | | [optional] | +| **value** | [**Array<BatchSearch>**](BatchSearch.md) | List of batch search records. | [optional] | ## Example diff --git a/docs/EInvoicing/V1/Consents.md b/docs/EInvoicing/V1/Consents.md new file mode 100644 index 0000000..b69af4f --- /dev/null +++ b/docs/EInvoicing/V1/Consents.md @@ -0,0 +1,18 @@ +# AvalaraSdk::EInvoicing::V1::Consents + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **list_in_avalara_directory** | **Boolean** | Indicates whether the trading partner consents to being listed in the directory. If not provided in the payload, its value will default to true. | [optional][default to true] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::EInvoicing::V1::Consents.new( + list_in_avalara_directory: null +) +``` + diff --git a/docs/EInvoicing/V1/CreateTradingPartner201Response.md b/docs/EInvoicing/V1/CreateTradingPartner201Response.md new file mode 100644 index 0000000..e51cf10 --- /dev/null +++ b/docs/EInvoicing/V1/CreateTradingPartner201Response.md @@ -0,0 +1,22 @@ +# AvalaraSdk::EInvoicing::V1::CreateTradingPartner201Response + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Avalara unique ID of the participant in the directory. | [optional] | +| **status** | **String** | The status of the create operation. | [optional] | +| **message** | **String** | A human-readable message providing additional context or feedback about the outcome of the operation. | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::EInvoicing::V1::CreateTradingPartner201Response.new( + id: ec0c06dffe6166c47fccbb3e6d391920e68c333d84f2510d4df2, + status: Complete, + message: Trading partner created successfully. +) +``` + diff --git a/docs/EInvoicing/V1/CreateTradingPartnersBatch200Response.md b/docs/EInvoicing/V1/CreateTradingPartnersBatch200Response.md new file mode 100644 index 0000000..eea4ecc --- /dev/null +++ b/docs/EInvoicing/V1/CreateTradingPartnersBatch200Response.md @@ -0,0 +1,22 @@ +# AvalaraSdk::EInvoicing::V1::CreateTradingPartnersBatch200Response + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **status** | **String** | | [optional] | +| **message** | **String** | A message indicating the result of the batch operation. | [optional] | +| **value** | [**Array<CreateTradingPartnersBatch200ResponseValueInner>**](CreateTradingPartnersBatch200ResponseValueInner.md) | A list of trading partners successfully created. | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::EInvoicing::V1::CreateTradingPartnersBatch200Response.new( + status: Complete, + message: Batch created successfully., + value: null +) +``` + diff --git a/docs/EInvoicing/V1/CreateTradingPartnersBatch200ResponseValueInner.md b/docs/EInvoicing/V1/CreateTradingPartnersBatch200ResponseValueInner.md new file mode 100644 index 0000000..b07d667 --- /dev/null +++ b/docs/EInvoicing/V1/CreateTradingPartnersBatch200ResponseValueInner.md @@ -0,0 +1,22 @@ +# AvalaraSdk::EInvoicing::V1::CreateTradingPartnersBatch200ResponseValueInner + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | The unique identifier of the created trading partner. | [optional] | +| **index** | **Integer** | Index number of the trading partner. | [optional] | +| **message** | **String** | A success message for the specific created record. | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::EInvoicing::V1::CreateTradingPartnersBatch200ResponseValueInner.new( + id: ec0c06dffe6166c47fccbb3e6d391920e68c333d84f2510d4df2, + index: 0, + message: Trading partner 'Pineapple Labs ltd' created successfully. +) +``` + diff --git a/docs/EInvoicing/V1/CreateTradingPartnersBatchRequest.md b/docs/EInvoicing/V1/CreateTradingPartnersBatchRequest.md new file mode 100644 index 0000000..02e1505 --- /dev/null +++ b/docs/EInvoicing/V1/CreateTradingPartnersBatchRequest.md @@ -0,0 +1,18 @@ +# AvalaraSdk::EInvoicing::V1::CreateTradingPartnersBatchRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **value** | [**Array<TradingPartner>**](TradingPartner.md) | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::EInvoicing::V1::CreateTradingPartnersBatchRequest.new( + value: null +) +``` + diff --git a/docs/EInvoicing/V1/DataInputFieldsApi.md b/docs/EInvoicing/V1/DataInputFieldsApi.md index 615e846..e99edff 100644 --- a/docs/EInvoicing/V1/DataInputFieldsApi.md +++ b/docs/EInvoicing/V1/DataInputFieldsApi.md @@ -33,12 +33,12 @@ end api_client = AvalaraSdk::ApiClient.new config api_instance = AvalaraSdk::EInvoicing::V1::DataInputFieldsApi.new api_client -avalara_version = '1.2' # String | The HTTP Header meant to specify the version of the API intended to be used +avalara_version = '1.4' # String | The HTTP Header meant to specify the version of the API intended to be used opts = { x_avalara_client: 'John's E-Invoicing-API Client', # String | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. filter: 'requiredFor/countryMandate eq AU-B2G-PEPPOL', # String | Filter by field name and value. This filter only supports eq and contains. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. - top: 8.14, # Float | The number of items to include in the result. - skip: 'skip_example', # String | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. + top: 56, # Integer | The number of items to include in the result. + skip: 56, # Integer | The number of items to skip in the result. count: 'true', # Boolean | When set to true, the count of the collection is also returned in the response body count_only: 'true' # Boolean | When set to true, only the count of the collection is returned } @@ -77,8 +77,8 @@ end | **avalara_version** | **String** | The HTTP Header meant to specify the version of the API intended to be used | | | **x_avalara_client** | **String** | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. | [optional] | | **filter** | **String** | Filter by field name and value. This filter only supports <code>eq</code> and <code>contains</code>. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. | [optional] | -| **top** | **Float** | The number of items to include in the result. | [optional] | -| **skip** | **String** | If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. | [optional] | +| **top** | **Integer** | The number of items to include in the result. | [optional] | +| **skip** | **Integer** | The number of items to skip in the result. | [optional] | | **count** | **Boolean** | When set to true, the count of the collection is also returned in the response body | [optional] | | **count_only** | **Boolean** | When set to true, only the count of the collection is returned | [optional] | diff --git a/docs/EInvoicing/V1/DocumentsApi.md b/docs/EInvoicing/V1/DocumentsApi.md index 80d7848..94ac0ad 100644 --- a/docs/EInvoicing/V1/DocumentsApi.md +++ b/docs/EInvoicing/V1/DocumentsApi.md @@ -37,7 +37,7 @@ end api_client = AvalaraSdk::ApiClient.new config api_instance = AvalaraSdk::EInvoicing::V1::DocumentsApi.new api_client -avalara_version = '1.2' # String | The HTTP Header meant to specify the version of the API intended to be used +avalara_version = '1.4' # String | The HTTP Header meant to specify the version of the API intended to be used accept = 'application/pdf' # String | This header indicates the MIME type of the document document_id = 'document_id_example' # String | The unique ID for this document that was returned in the POST /einvoicing/document response body opts = { @@ -120,7 +120,7 @@ end api_client = AvalaraSdk::ApiClient.new config api_instance = AvalaraSdk::EInvoicing::V1::DocumentsApi.new api_client -avalara_version = '1.2' # String | The HTTP Header meant to specify the version of the API intended to be used +avalara_version = '1.4' # String | The HTTP Header meant to specify the version of the API intended to be used fetch_documents_request = AvalaraSdk::EInvoicing::V1::FetchDocumentsRequest.new # FetchDocumentsRequest | opts = { x_avalara_client: 'John's E-Invoicing-API Client' # String | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. @@ -201,7 +201,7 @@ end api_client = AvalaraSdk::ApiClient.new config api_instance = AvalaraSdk::EInvoicing::V1::DocumentsApi.new api_client -avalara_version = '1.2' # String | The HTTP Header meant to specify the version of the API intended to be used +avalara_version = '1.4' # String | The HTTP Header meant to specify the version of the API intended to be used opts = { x_avalara_client: 'John's E-Invoicing-API Client', # String | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. start_date: Time.parse('2013-10-20T19:20:30+01:00'), # Time | Start date of documents to return. This defaults to the previous month. @@ -210,8 +210,8 @@ opts = { count: 'true', # String | When set to true, the count of the collection is also returned in the response body count_only: 'false', # String | When set to true, only the count of the collection is returned filter: 'id eq 52f60401-44d0-4667-ad47-4afe519abb53', # String | Filter by field name and value. This filter only supports eq . Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. Filtering will be done over the provided startDate and endDate. If no startDate or endDate is provided, defaults will be assumed. - top: 8.14, # Float | The number of items to include in the result. - skip: '10' # String | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. + top: 56, # Integer | The number of items to include in the result. + skip: 56 # Integer | The number of items to skip in the result. } begin @@ -253,8 +253,8 @@ end | **count** | **String** | When set to true, the count of the collection is also returned in the response body | [optional] | | **count_only** | **String** | When set to true, only the count of the collection is returned | [optional] | | **filter** | **String** | Filter by field name and value. This filter only supports <code>eq</code> . Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. Filtering will be done over the provided startDate and endDate. If no startDate or endDate is provided, defaults will be assumed. | [optional] | -| **top** | **Float** | The number of items to include in the result. | [optional] | -| **skip** | **String** | If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. | [optional] | +| **top** | **Integer** | The number of items to include in the result. | [optional] | +| **skip** | **Integer** | The number of items to skip in the result. | [optional] | ### Return type @@ -296,7 +296,7 @@ end api_client = AvalaraSdk::ApiClient.new config api_instance = AvalaraSdk::EInvoicing::V1::DocumentsApi.new api_client -avalara_version = '1.2' # String | The HTTP Header meant to specify the version of the API intended to be used +avalara_version = '1.4' # String | The HTTP Header meant to specify the version of the API intended to be used document_id = 'document_id_example' # String | The unique ID for this document that was returned in the POST /einvoicing/documents response body opts = { x_avalara_client: 'John's E-Invoicing-API Client' # String | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. @@ -377,7 +377,7 @@ end api_client = AvalaraSdk::ApiClient.new config api_instance = AvalaraSdk::EInvoicing::V1::DocumentsApi.new api_client -avalara_version = '1.2' # String | The HTTP Header meant to specify the version of the API intended to be used +avalara_version = '1.4' # String | The HTTP Header meant to specify the version of the API intended to be used metadata = AvalaraSdk::EInvoicing::V1::SubmitDocumentMetadata.new({workflow_id: 'partner-einvoicing', data_format: 'ubl-invoice', data_format_version: '2.1', country_code: 'SA', country_mandate: 'SA-Phase1-B2B'}) # SubmitDocumentMetadata | data = { ... } # Object | The document to be submitted, as indicated by the metadata fields 'dataFormat' and 'dataFormatVersion' opts = { diff --git a/docs/EInvoicing/V1/Extension.md b/docs/EInvoicing/V1/Extension.md new file mode 100644 index 0000000..9e942da --- /dev/null +++ b/docs/EInvoicing/V1/Extension.md @@ -0,0 +1,20 @@ +# AvalaraSdk::EInvoicing::V1::Extension + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **key** | **String** | Name of the custom attribute. | | +| **values** | **Array<String>** | Array of string values associated with the custom attribute. | | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::EInvoicing::V1::Extension.new( + key: null, + values: null +) +``` + diff --git a/docs/EInvoicing/V1/Identifier.md b/docs/EInvoicing/V1/Identifier.md new file mode 100644 index 0000000..1afdf38 --- /dev/null +++ b/docs/EInvoicing/V1/Identifier.md @@ -0,0 +1,22 @@ +# AvalaraSdk::EInvoicing::V1::Identifier + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | Identifier name (e.g., Peppol Participant ID). | | +| **display_name** | **String** | Display name of the identifier. | [optional] | +| **value** | **String** | Value of the identifier. | | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::EInvoicing::V1::Identifier.new( + name: null, + display_name: null, + value: null +) +``` + diff --git a/docs/EInvoicing/V1/InteropApi.md b/docs/EInvoicing/V1/InteropApi.md index 375e37e..16c94af 100644 --- a/docs/EInvoicing/V1/InteropApi.md +++ b/docs/EInvoicing/V1/InteropApi.md @@ -35,7 +35,7 @@ api_instance = AvalaraSdk::EInvoicing::V1::InteropApi.new api_client document_type = 'ubl-invoice-2.1' # String | Type of the document being uploaded. Partners will be configured in Avalara system to send only certain types of documents. interchange_type = 'FI-B2B-TIEKE' # String | Type of interchange (codes in Avalara system that uniquely identifies a type of interchange). Partners will be configured in Avalara system to send documents belonging to certain types of interchanges. -avalara_version = '1.2' # String | The HTTP Header meant to specify the version of the API intended to be used +avalara_version = '1.4' # String | The HTTP Header meant to specify the version of the API intended to be used opts = { x_avalara_client: 'John's E-Invoicing-API Client', # String | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" x_correlation_id: 'f3f0d19a-01a1-4748-8a58-f000d0424f43', # String | The caller can use this as an identifier to use as a correlation id to trace the call. diff --git a/docs/EInvoicing/V1/MandatesApi.md b/docs/EInvoicing/V1/MandatesApi.md index 54abbce..6872534 100644 --- a/docs/EInvoicing/V1/MandatesApi.md +++ b/docs/EInvoicing/V1/MandatesApi.md @@ -34,7 +34,7 @@ end api_client = AvalaraSdk::ApiClient.new config api_instance = AvalaraSdk::EInvoicing::V1::MandatesApi.new api_client -avalara_version = '1.2' # String | The HTTP Header meant to specify the version of the API intended to be used +avalara_version = '1.4' # String | The HTTP Header meant to specify the version of the API intended to be used mandate_id = 'AD-B2G-PEPPOL' # String | The unique ID for the mandate that was returned in the GET /einvoicing/mandates response body document_type = 'ubl-invoice' # String | Select the documentType for which you wish to view the data-input-fields (You may obtain the supported documentTypes from the GET /mandates endpoint) document_version = '2.1' # String | Select the document version of the documentType (You may obtain the supported documentVersion from the GET /mandates endpoint) @@ -119,12 +119,12 @@ end api_client = AvalaraSdk::ApiClient.new config api_instance = AvalaraSdk::EInvoicing::V1::MandatesApi.new api_client -avalara_version = '1.2' # String | The HTTP Header meant to specify the version of the API intended to be used +avalara_version = '1.4' # String | The HTTP Header meant to specify the version of the API intended to be used opts = { x_avalara_client: 'John's E-Invoicing-API Client', # String | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. filter: 'countryMandate eq DE-B2G-PEPPOL', # String | Filter by field name and value. This filter only supports eq and contains. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. - top: 8.14, # Float | The number of items to include in the result. - skip: 'skip_example', # String | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. + top: 56, # Integer | The number of items to include in the result. + skip: 56, # Integer | The number of items to skip in the result. count: 'true', # Boolean | When set to true, the count of the collection is also returned in the response body. count_only: 'true' # Boolean | When set to true, only the count of the collection is returned } @@ -163,8 +163,8 @@ end | **avalara_version** | **String** | The HTTP Header meant to specify the version of the API intended to be used | | | **x_avalara_client** | **String** | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. | [optional] | | **filter** | **String** | Filter by field name and value. This filter only supports <code>eq</code> and <code>contains</code>. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. | [optional] | -| **top** | **Float** | The number of items to include in the result. | [optional] | -| **skip** | **String** | If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. | [optional] | +| **top** | **Integer** | The number of items to include in the result. | [optional] | +| **skip** | **Integer** | The number of items to skip in the result. | [optional] | | **count** | **Boolean** | When set to true, the count of the collection is also returned in the response body. | [optional] | | **count_only** | **Boolean** | When set to true, only the count of the collection is returned | [optional] | diff --git a/docs/EInvoicing/V1/SearchParticipants200Response.md b/docs/EInvoicing/V1/SearchParticipants200Response.md new file mode 100644 index 0000000..bb02b2d --- /dev/null +++ b/docs/EInvoicing/V1/SearchParticipants200Response.md @@ -0,0 +1,22 @@ +# AvalaraSdk::EInvoicing::V1::SearchParticipants200Response + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **record_set_count** | **Integer** | The count of records in the result set. | [optional] | +| **next_link** | **String** | The next page link to get the next set of results. | [optional] | +| **value** | [**Array<TradingPartner>**](TradingPartner.md) | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::EInvoicing::V1::SearchParticipants200Response.new( + record_set_count: null, + next_link: null, + value: null +) +``` + diff --git a/docs/EInvoicing/V1/SubscriptionsApi.md b/docs/EInvoicing/V1/SubscriptionsApi.md index 58fa9ee..f8e4aa4 100644 --- a/docs/EInvoicing/V1/SubscriptionsApi.md +++ b/docs/EInvoicing/V1/SubscriptionsApi.md @@ -36,7 +36,7 @@ end api_client = AvalaraSdk::ApiClient.new config api_instance = AvalaraSdk::EInvoicing::V1::SubscriptionsApi.new api_client -avalara_version = 'avalara_version_example' # String | The version of the API to use, e.g., \"1.3\". +avalara_version = 'avalara_version_example' # String | The version of the API to use, e.g., \"1.4\". subscription_registration = AvalaraSdk::EInvoicing::V1::SubscriptionRegistration.new({notification_url: 'https://webhook.example.com/notifications', signature: AvalaraSdk::EInvoicing::V1::SignatureSignature.new({type: 'none', key: 'key_example', algorithm: 'sha256'}), events: [AvalaraSdk::EInvoicing::V1::EventSubscription.new({event_name: 'document.complete'})]}) # SubscriptionRegistration | opts = { x_correlation_id: 'x_correlation_id_example', # String | A unique identifier for tracking the request and its response @@ -74,7 +74,7 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **avalara_version** | **String** | The version of the API to use, e.g., \"1.3\". | | +| **avalara_version** | **String** | The version of the API to use, e.g., \"1.4\". | | | **subscription_registration** | [**SubscriptionRegistration**](SubscriptionRegistration.md) | | | | **x_correlation_id** | **String** | A unique identifier for tracking the request and its response | [optional] | | **x_avalara_client** | **String** | Client application identification | [optional] | @@ -120,7 +120,7 @@ api_client = AvalaraSdk::ApiClient.new config api_instance = AvalaraSdk::EInvoicing::V1::SubscriptionsApi.new api_client subscription_id = 'subscription_id_example' # String | -avalara_version = 'avalara_version_example' # String | The version of the API to use, e.g., \"1.3\". +avalara_version = 'avalara_version_example' # String | The version of the API to use, e.g., \"1.4\". opts = { x_correlation_id: 'x_correlation_id_example', # String | A unique identifier for tracking the request and its response x_avalara_client: 'x_avalara_client_example' # String | Client application identification @@ -157,7 +157,7 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **subscription_id** | **String** | | | -| **avalara_version** | **String** | The version of the API to use, e.g., \"1.3\". | | +| **avalara_version** | **String** | The version of the API to use, e.g., \"1.4\". | | | **x_correlation_id** | **String** | A unique identifier for tracking the request and its response | [optional] | | **x_avalara_client** | **String** | Client application identification | [optional] | @@ -202,7 +202,7 @@ api_client = AvalaraSdk::ApiClient.new config api_instance = AvalaraSdk::EInvoicing::V1::SubscriptionsApi.new api_client subscription_id = 'subscription_id_example' # String | -avalara_version = 'avalara_version_example' # String | The version of the API to use, e.g., \"1.3\". +avalara_version = 'avalara_version_example' # String | The version of the API to use, e.g., \"1.4\". opts = { x_correlation_id: 'x_correlation_id_example', # String | A unique identifier for tracking the request and its response x_avalara_client: 'x_avalara_client_example' # String | Client application identification @@ -240,7 +240,7 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **subscription_id** | **String** | | | -| **avalara_version** | **String** | The version of the API to use, e.g., \"1.3\". | | +| **avalara_version** | **String** | The version of the API to use, e.g., \"1.4\". | | | **x_correlation_id** | **String** | A unique identifier for tracking the request and its response | [optional] | | **x_avalara_client** | **String** | Client application identification | [optional] | @@ -284,12 +284,12 @@ end api_client = AvalaraSdk::ApiClient.new config api_instance = AvalaraSdk::EInvoicing::V1::SubscriptionsApi.new api_client -avalara_version = 'avalara_version_example' # String | The version of the API to use, e.g., \"1.3\". +avalara_version = 'avalara_version_example' # String | The version of the API to use, e.g., \"1.4\". opts = { x_correlation_id: 'x_correlation_id_example', # String | A unique identifier for tracking the request and its response x_avalara_client: 'x_avalara_client_example', # String | Client application identification - top: 8.14, # Float | The number of items to include in the result. - skip: 8.14, # Float | The number of items to skip in the result. + top: 56, # Integer | The number of items to include in the result. + skip: 56, # Integer | The number of items to skip in the result. count: true, # Boolean | Whether to include the total count of records in the result. count_only: true # Boolean | Whether to return only the count of records, without the list of records. } @@ -325,11 +325,11 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **avalara_version** | **String** | The version of the API to use, e.g., \"1.3\". | | +| **avalara_version** | **String** | The version of the API to use, e.g., \"1.4\". | | | **x_correlation_id** | **String** | A unique identifier for tracking the request and its response | [optional] | | **x_avalara_client** | **String** | Client application identification | [optional] | -| **top** | **Float** | The number of items to include in the result. | [optional] | -| **skip** | **Float** | The number of items to skip in the result. | [optional] | +| **top** | **Integer** | The number of items to include in the result. | [optional] | +| **skip** | **Integer** | The number of items to skip in the result. | [optional] | | **count** | **Boolean** | Whether to include the total count of records in the result. | [optional] | | **count_only** | **Boolean** | Whether to return only the count of records, without the list of records. | [optional] | diff --git a/docs/EInvoicing/V1/SupportedDocumentTypes.md b/docs/EInvoicing/V1/SupportedDocumentTypes.md new file mode 100644 index 0000000..68ecbb8 --- /dev/null +++ b/docs/EInvoicing/V1/SupportedDocumentTypes.md @@ -0,0 +1,26 @@ +# AvalaraSdk::EInvoicing::V1::SupportedDocumentTypes + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | Document type name. | [optional] | +| **value** | **String** | Document type value. | | +| **supported_by_trading_partner** | **Boolean** | Does trading partner support receiving this document type. | | +| **supported_by_avalara** | **Boolean** | Does avalara support exchanging this document type. | [optional] | +| **extensions** | [**Array<Extension>**](Extension.md) | Optional array used to carry additional metadata or configuration values that may be required by specific document types. When creating or updating a trading partner, the keys provided in the 'extensions' attribute must be selected from a predefined list of supported extensions. Using any unsupported keys will result in a validation error. | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::EInvoicing::V1::SupportedDocumentTypes.new( + name: null, + value: null, + supported_by_trading_partner: null, + supported_by_avalara: null, + extensions: null +) +``` + diff --git a/docs/EInvoicing/V1/TaxIdentifierRequest.md b/docs/EInvoicing/V1/TaxIdentifierRequest.md new file mode 100644 index 0000000..2a83398 --- /dev/null +++ b/docs/EInvoicing/V1/TaxIdentifierRequest.md @@ -0,0 +1,24 @@ +# AvalaraSdk::EInvoicing::V1::TaxIdentifierRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **country_code** | **String** | The two-letter ISO-3166 country code of the tax identifier. | | +| **identifier_type** | **String** | Type of the identifier. | | +| **identifier** | **String** | The tax identifier of the company. | | +| **extensions** | **Object** | Optional field for adding additional details required by specific tax authorities. Refer to the GET /tax-identifiers/schema API endpoint for the full request structure for a given country. | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::EInvoicing::V1::TaxIdentifierRequest.new( + country_code: null, + identifier_type: null, + identifier: null, + extensions: null +) +``` + diff --git a/docs/EInvoicing/V1/TaxIdentifierResponse.md b/docs/EInvoicing/V1/TaxIdentifierResponse.md new file mode 100644 index 0000000..4ab3761 --- /dev/null +++ b/docs/EInvoicing/V1/TaxIdentifierResponse.md @@ -0,0 +1,20 @@ +# AvalaraSdk::EInvoicing::V1::TaxIdentifierResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **country_code** | **String** | The two-letter ISO-3166 country code of the tax identifier. | | +| **value** | [**TaxIdentifierResponseValue**](TaxIdentifierResponseValue.md) | | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::EInvoicing::V1::TaxIdentifierResponse.new( + country_code: null, + value: null +) +``` + diff --git a/docs/EInvoicing/V1/TaxIdentifierResponseValue.md b/docs/EInvoicing/V1/TaxIdentifierResponseValue.md new file mode 100644 index 0000000..65f51d3 --- /dev/null +++ b/docs/EInvoicing/V1/TaxIdentifierResponseValue.md @@ -0,0 +1,22 @@ +# AvalaraSdk::EInvoicing::V1::TaxIdentifierResponseValue + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **identifier_type** | **String** | Type of the identifier. | [optional] | +| **identifier** | **String** | The tax identifier of the company. | [optional] | +| **extensions** | **Object** | Optional field containing additional company-related information such as companyName, companyAddress, blockListed, tradeName, and taxPayerType. It may also include other details specific to the given tax authority. Refer to the GET /tax-identifiers/schema API endpoint for the full response structure for a given country. | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::EInvoicing::V1::TaxIdentifierResponseValue.new( + identifier_type: null, + identifier: null, + extensions: null +) +``` + diff --git a/docs/EInvoicing/V1/TaxIdentifierSchemaByCountry200Response.md b/docs/EInvoicing/V1/TaxIdentifierSchemaByCountry200Response.md new file mode 100644 index 0000000..ef3fc1e --- /dev/null +++ b/docs/EInvoicing/V1/TaxIdentifierSchemaByCountry200Response.md @@ -0,0 +1,20 @@ +# AvalaraSdk::EInvoicing::V1::TaxIdentifierSchemaByCountry200Response + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **country_code** | **String** | The two-letter ISO-3166 country code of the tax identifier. | | +| **schema** | **Object** | The JSON Schema definition, following Draft-07 specification, used to validate tax identifier data. | | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::EInvoicing::V1::TaxIdentifierSchemaByCountry200Response.new( + country_code: null, + schema: null +) +``` + diff --git a/docs/EInvoicing/V1/TaxIdentifiersApi.md b/docs/EInvoicing/V1/TaxIdentifiersApi.md new file mode 100644 index 0000000..d1bd70d --- /dev/null +++ b/docs/EInvoicing/V1/TaxIdentifiersApi.md @@ -0,0 +1,177 @@ +# AvalaraSdk::EInvoicing::V1::TaxIdentifiersApi + +All URIs are relative to *https://api.sbx.avalara.com/einvoicing* + +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**tax_identifier_schema_by_country**](TaxIdentifiersApi.md#tax_identifier_schema_by_country) | **GET** /tax-identifiers/schema | Returns the tax identifier request & response schema for a specific country. | +| [**validate_tax_identifier**](TaxIdentifiersApi.md#validate_tax_identifier) | **POST** /tax-identifiers/validate | Validates a tax identifier. | + + +## tax_identifier_schema_by_country + +> tax_identifier_schema_by_country(avalara_version, country_code, opts) + +Returns the tax identifier request & response schema for a specific country. + +This endpoint retrieves the request and response schema required to validate tax identifiers based on a specific country's requirements. This can include both standard fields and any additional parameters required by the respective country's tax authority. + +### Examples + +```ruby +require 'time' +require 'avalara_sdk' +# setup authorization +AvalaraSdk::EInvoicing::V1.configure do |config| + # See Documentation for Authorization section in main README.md for more auth examples. + config.bearer_token='' + config.environment='sandbox' + config.app_name='testApp' + config.app_version='1.2.3' + config.machine_name='testMachine' +end + +api_client = AvalaraSdk::ApiClient.new config +api_instance = AvalaraSdk::EInvoicing::V1::TaxIdentifiersApi.new api_client + +avalara_version = '1.4' # String | The HTTP Header meant to specify the version of the API intended to be used. +country_code = 'DE' # String | The two-letter ISO-3166 country code for which the schema should be retrieved. +opts = { + x_avalara_client: 'John's E-Invoicing-API Client', # String | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". + x_correlation_id: 'f3f0d19a-01a1-4748-8a58-f000d0424f43', # String | The caller can use this as an identifier to use as a correlation id to trace the call. + type: 'request' # String | Specifies whether to return the request or response schema. +} + +begin + # Returns the tax identifier request & response schema for a specific country. + result = api_instance.tax_identifier_schema_by_country(avalara_version, country_code, opts) + p result +rescue AvalaraSdk::ApiError => e + puts "Error when calling TaxIdentifiersApi->tax_identifier_schema_by_country: #{e}" +end +``` + +#### Using the tax_identifier_schema_by_country_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> tax_identifier_schema_by_country_with_http_info(avalara_version, country_code, opts) + +```ruby +begin + # Returns the tax identifier request & response schema for a specific country. + data, status_code, headers = api_instance.tax_identifier_schema_by_country_with_http_info(avalara_version, country_code, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue AvalaraSdk::EInvoicing::V1::ApiError => e + puts "Error when calling TaxIdentifiersApi->tax_identifier_schema_by_country_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **avalara_version** | **String** | The HTTP Header meant to specify the version of the API intended to be used. | | +| **country_code** | **String** | The two-letter ISO-3166 country code for which the schema should be retrieved. | | +| **x_avalara_client** | **String** | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". | [optional] | +| **x_correlation_id** | **String** | The caller can use this as an identifier to use as a correlation id to trace the call. | [optional] | +| **type** | **String** | Specifies whether to return the request or response schema. | [optional] | + +### Return type + +[**TaxIdentifierSchemaByCountry200Response**](TaxIdentifierSchemaByCountry200Response.md) + +### Authorization + +[Bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## validate_tax_identifier + +> validate_tax_identifier(avalara_version, tax_identifier_request, opts) + +Validates a tax identifier. + +This endpoint verifies whether a given tax identifier is valid and properly formatted according to the rules of the applicable country or tax system. + +### Examples + +```ruby +require 'time' +require 'avalara_sdk' +# setup authorization +AvalaraSdk::EInvoicing::V1.configure do |config| + # See Documentation for Authorization section in main README.md for more auth examples. + config.bearer_token='' + config.environment='sandbox' + config.app_name='testApp' + config.app_version='1.2.3' + config.machine_name='testMachine' +end + +api_client = AvalaraSdk::ApiClient.new config +api_instance = AvalaraSdk::EInvoicing::V1::TaxIdentifiersApi.new api_client + +avalara_version = '1.4' # String | The HTTP Header meant to specify the version of the API intended to be used. +tax_identifier_request = AvalaraSdk::EInvoicing::V1::TaxIdentifierRequest.new({country_code: 'country_code_example', identifier_type: 'identifier_type_example', identifier: 'identifier_example'}) # TaxIdentifierRequest | +opts = { + x_avalara_client: 'John's E-Invoicing-API Client', # String | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". + x_correlation_id: 'f3f0d19a-01a1-4748-8a58-f000d0424f43' # String | The caller can use this as an identifier to use as a correlation id to trace the call. +} + +begin + # Validates a tax identifier. + result = api_instance.validate_tax_identifier(avalara_version, tax_identifier_request, opts) + p result +rescue AvalaraSdk::ApiError => e + puts "Error when calling TaxIdentifiersApi->validate_tax_identifier: #{e}" +end +``` + +#### Using the validate_tax_identifier_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> validate_tax_identifier_with_http_info(avalara_version, tax_identifier_request, opts) + +```ruby +begin + # Validates a tax identifier. + data, status_code, headers = api_instance.validate_tax_identifier_with_http_info(avalara_version, tax_identifier_request, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue AvalaraSdk::EInvoicing::V1::ApiError => e + puts "Error when calling TaxIdentifiersApi->validate_tax_identifier_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **avalara_version** | **String** | The HTTP Header meant to specify the version of the API intended to be used. | | +| **tax_identifier_request** | [**TaxIdentifierRequest**](TaxIdentifierRequest.md) | | | +| **x_avalara_client** | **String** | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". | [optional] | +| **x_correlation_id** | **String** | The caller can use this as an identifier to use as a correlation id to trace the call. | [optional] | + +### Return type + +[**TaxIdentifierResponse**](TaxIdentifierResponse.md) + +### Authorization + +[Bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + diff --git a/docs/EInvoicing/V1/TradingPartner.md b/docs/EInvoicing/V1/TradingPartner.md new file mode 100644 index 0000000..705c449 --- /dev/null +++ b/docs/EInvoicing/V1/TradingPartner.md @@ -0,0 +1,34 @@ +# AvalaraSdk::EInvoicing::V1::TradingPartner + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Avalara unique ID of the participant in the directory. | [optional][readonly] | +| **name** | **String** | Name of the participant (typically, the name of the business entity). | | +| **network** | **String** | The network where the participant is present. When creating or updating a trading partner, the value provided for the attribute 'network' will be ignored. | [optional][readonly] | +| **registration_date** | **String** | Registration date of the participant if available. | [optional] | +| **identifiers** | [**Array<Identifier>**](Identifier.md) | A list of identifiers associated with the trading partner. Each identifier should consistently include the fields name, and value to maintain clarity and ensure consistent structure across entries. When creating or updating a trading partner, the attribute 'name' must be agreed upon with Avalara to ensure consistency. Failing to adhere to the agreed values will result in a validation error. Further, when creating or updating a trading partner, the value provided for the attribute 'displayName' will be ignored and instead retrieved from the standard set of display names maintained. | | +| **addresses** | [**Array<Address>**](Address.md) | | | +| **supported_document_types** | [**Array<SupportedDocumentTypes>**](SupportedDocumentTypes.md) | A list of document types supported by the trading partner for exchange. Each document type identifier value must match the standard list maintained by Avalara, which includes Peppol and other public network document type identifier schemes and values, as well as any approved partner-specific identifiers. The 'value' field must exactly match an entry from the provided document identifier list. Any attempt to submit unsupported document types will result in a validation error. Further, when creating or updating a trading partner, the value provided for the attributes 'name' and 'supportedByAvalara' will be ignored. | | +| **consents** | [**Consents**](Consents.md) | | [optional] | +| **extensions** | [**Array<Extension>**](Extension.md) | Optional array used to carry additional metadata or configuration values that may be required by specific networks. When creating or updating a trading partner, the keys provided in the 'extensions' attribute must be selected from a predefined list of supported extensions. Using any unsupported keys will result in a validation error. | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::EInvoicing::V1::TradingPartner.new( + id: null, + name: null, + network: null, + registration_date: null, + identifiers: null, + addresses: null, + supported_document_types: null, + consents: null, + extensions: null +) +``` + diff --git a/docs/EInvoicing/V1/TradingPartnersApi.md b/docs/EInvoicing/V1/TradingPartnersApi.md index d37780a..f23bf25 100644 --- a/docs/EInvoicing/V1/TradingPartnersApi.md +++ b/docs/EInvoicing/V1/TradingPartnersApi.md @@ -4,21 +4,25 @@ All URIs are relative to *https://api.sbx.avalara.com/einvoicing* | Method | HTTP request | Description | | ------ | ------------ | ----------- | -| [**batch_search_participants**](TradingPartnersApi.md#batch_search_participants) | **POST** /trading-partners/batch-searches | Creates a batch search and performs a batch search in the directory for participants in the background. | -| [**download_batch_search_report**](TradingPartnersApi.md#download_batch_search_report) | **GET** /trading-partners/batch-searches/{id}/$download-results | Download batch search results in a csv file. | -| [**get_batch_search_detail**](TradingPartnersApi.md#get_batch_search_detail) | **GET** /trading-partners/batch-searches/{id} | Get the batch search details for a given id. | -| [**list_batch_searches**](TradingPartnersApi.md#list_batch_searches) | **GET** /trading-partners/batch-searches | List all batch searches that were previously submitted. | +| [**batch_search_participants**](TradingPartnersApi.md#batch_search_participants) | **POST** /trading-partners/batch-searches | Handles batch search requests by uploading a file containing search parameters. | +| [**create_trading_partner**](TradingPartnersApi.md#create_trading_partner) | **POST** /trading-partners | Creates a new trading partner. | +| [**create_trading_partners_batch**](TradingPartnersApi.md#create_trading_partners_batch) | **POST** /trading-partners/batch | Creates a batch of multiple trading partners. | +| [**delete_trading_partner**](TradingPartnersApi.md#delete_trading_partner) | **DELETE** /trading-partners/{id} | Deletes a trading partner using ID. | +| [**download_batch_search_report**](TradingPartnersApi.md#download_batch_search_report) | **GET** /trading-partners/batch-searches/{id}/$download-results | Downloads batch search results in a csv file. | +| [**get_batch_search_detail**](TradingPartnersApi.md#get_batch_search_detail) | **GET** /trading-partners/batch-searches/{id} | Returns the batch search details using ID. | +| [**list_batch_searches**](TradingPartnersApi.md#list_batch_searches) | **GET** /trading-partners/batch-searches | Lists all batch searches that were previously submitted. | | [**search_participants**](TradingPartnersApi.md#search_participants) | **GET** /trading-partners | Returns a list of participants matching the input query. | +| [**update_trading_partner**](TradingPartnersApi.md#update_trading_partner) | **PUT** /trading-partners/{id} | Updates a trading partner using ID. | ## batch_search_participants > batch_search_participants(avalara_version, name, notification_email, file, opts) -Creates a batch search and performs a batch search in the directory for participants in the background. - Handles batch search requests by uploading a file containing search parameters. +This endpoint creates a batch search and performs a batch search in the directory for participants in the background. + ### Examples ```ruby @@ -37,17 +41,17 @@ end api_client = AvalaraSdk::ApiClient.new config api_instance = AvalaraSdk::EInvoicing::V1::TradingPartnersApi.new api_client -avalara_version = '1.2' # String | The HTTP Header meant to specify the version of the API intended to be used -name = 'Automotive Companies in London Search' # String | The human readable name given to this batch search. -notification_email = 'user@example.com' # String | The email address of the user to whom the batch search completion notification must go to. -file = File.new('/path/to/some/file') # File | CSV file containing search parameters. +avalara_version = '1.4' # String | The HTTP Header meant to specify the version of the API intended to be used. +name = 'Automotive Companies in London Search' # String | A human-readable name for the batch search. +notification_email = 'user@example.com' # String | The email address to which a notification will be sent once the batch search is complete. +file = File.new('/path/to/some/file') # File | CSV file containing search parameters. Input Constraints: - Maximum file size: 1 MB - File Header: Must be less than 500 KB - Total number of lines (including header): Must be 101 or fewer opts = { - x_avalara_client: 'John's E-Invoicing-API Client', # String | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" + x_avalara_client: 'John's E-Invoicing-API Client', # String | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". x_correlation_id: 'f3f0d19a-01a1-4748-8a58-f000d0424f43' # String | The caller can use this as an identifier to use as a correlation id to trace the call. } begin - # Creates a batch search and performs a batch search in the directory for participants in the background. + # Handles batch search requests by uploading a file containing search parameters. result = api_instance.batch_search_participants(avalara_version, name, notification_email, file, opts) p result rescue AvalaraSdk::ApiError => e @@ -63,7 +67,7 @@ This returns an Array which contains the response data, status code and headers. ```ruby begin - # Creates a batch search and performs a batch search in the directory for participants in the background. + # Handles batch search requests by uploading a file containing search parameters. data, status_code, headers = api_instance.batch_search_participants_with_http_info(avalara_version, name, notification_email, file, opts) p status_code # => 2xx p headers # => { ... } @@ -77,11 +81,11 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **avalara_version** | **String** | The HTTP Header meant to specify the version of the API intended to be used | | -| **name** | **String** | The human readable name given to this batch search. | | -| **notification_email** | **String** | The email address of the user to whom the batch search completion notification must go to. | | -| **file** | **File** | CSV file containing search parameters. | | -| **x_avalara_client** | **String** | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" | [optional] | +| **avalara_version** | **String** | The HTTP Header meant to specify the version of the API intended to be used. | | +| **name** | **String** | A <b>human-readable</b> name for the batch search. | | +| **notification_email** | **String** | The email address to which a notification will be sent once the batch search is complete. | | +| **file** | **File** | CSV file containing search parameters. Input Constraints: - Maximum file size: 1 MB - File Header: Must be less than 500 KB - Total number of lines (including header): Must be 101 or fewer | | +| **x_avalara_client** | **String** | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". | [optional] | | **x_correlation_id** | **String** | The caller can use this as an identifier to use as a correlation id to trace the call. | [optional] | ### Return type @@ -98,13 +102,261 @@ end - **Accept**: application/json +## create_trading_partner + +> create_trading_partner(avalara_version, trading_partner, opts) + +Creates a new trading partner. + +This endpoint creates a new trading partner with the provided details. The request body must include the necessary information as defined in the `TradingPartner` schema. + +### Examples + +```ruby +require 'time' +require 'avalara_sdk' +# setup authorization +AvalaraSdk::EInvoicing::V1.configure do |config| + # See Documentation for Authorization section in main README.md for more auth examples. + config.bearer_token='' + config.environment='sandbox' + config.app_name='testApp' + config.app_version='1.2.3' + config.machine_name='testMachine' +end + +api_client = AvalaraSdk::ApiClient.new config +api_instance = AvalaraSdk::EInvoicing::V1::TradingPartnersApi.new api_client + +avalara_version = '1.4' # String | The HTTP Header meant to specify the version of the API intended to be used. +trading_partner = AvalaraSdk::EInvoicing::V1::TradingPartner.new({name: 'name_example', identifiers: [AvalaraSdk::EInvoicing::V1::Identifier.new({name: 'name_example', value: 'value_example'})], addresses: [AvalaraSdk::EInvoicing::V1::Address.new({country: 'country_example'})], supported_document_types: [AvalaraSdk::EInvoicing::V1::SupportedDocumentTypes.new({value: 'value_example', supported_by_trading_partner: false})]}) # TradingPartner | +opts = { + x_avalara_client: 'John's E-Invoicing-API Client', # String | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". + x_correlation_id: 'f3f0d19a-01a1-4748-8a58-f000d0424f43' # String | The caller can use this as an identifier to use as a correlation id to trace the call. +} + +begin + # Creates a new trading partner. + result = api_instance.create_trading_partner(avalara_version, trading_partner, opts) + p result +rescue AvalaraSdk::ApiError => e + puts "Error when calling TradingPartnersApi->create_trading_partner: #{e}" +end +``` + +#### Using the create_trading_partner_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_trading_partner_with_http_info(avalara_version, trading_partner, opts) + +```ruby +begin + # Creates a new trading partner. + data, status_code, headers = api_instance.create_trading_partner_with_http_info(avalara_version, trading_partner, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue AvalaraSdk::EInvoicing::V1::ApiError => e + puts "Error when calling TradingPartnersApi->create_trading_partner_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **avalara_version** | **String** | The HTTP Header meant to specify the version of the API intended to be used. | | +| **trading_partner** | [**TradingPartner**](TradingPartner.md) | | | +| **x_avalara_client** | **String** | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". | [optional] | +| **x_correlation_id** | **String** | The caller can use this as an identifier to use as a correlation id to trace the call. | [optional] | + +### Return type + +[**CreateTradingPartner201Response**](CreateTradingPartner201Response.md) + +### Authorization + +[Bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_trading_partners_batch + +> create_trading_partners_batch(avalara_version, create_trading_partners_batch_request, opts) + +Creates a batch of multiple trading partners. + +This endpoint creates multiple trading partners in a single batch request. It accepts an array of trading partners and processes them synchronously. Supports a maximum of 100 records or 1 MB request payload. The batch is processed atomically and partial success is not allowed. + +### Examples + +```ruby +require 'time' +require 'avalara_sdk' +# setup authorization +AvalaraSdk::EInvoicing::V1.configure do |config| + # See Documentation for Authorization section in main README.md for more auth examples. + config.bearer_token='' + config.environment='sandbox' + config.app_name='testApp' + config.app_version='1.2.3' + config.machine_name='testMachine' +end + +api_client = AvalaraSdk::ApiClient.new config +api_instance = AvalaraSdk::EInvoicing::V1::TradingPartnersApi.new api_client + +avalara_version = '1.4' # String | The HTTP Header meant to specify the version of the API intended to be used. +create_trading_partners_batch_request = AvalaraSdk::EInvoicing::V1::CreateTradingPartnersBatchRequest.new # CreateTradingPartnersBatchRequest | +opts = { + x_avalara_client: 'John's E-Invoicing-API Client', # String | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". + x_correlation_id: 'f3f0d19a-01a1-4748-8a58-f000d0424f43' # String | The caller can use this as an identifier to use as a correlation id to trace the call. +} + +begin + # Creates a batch of multiple trading partners. + result = api_instance.create_trading_partners_batch(avalara_version, create_trading_partners_batch_request, opts) + p result +rescue AvalaraSdk::ApiError => e + puts "Error when calling TradingPartnersApi->create_trading_partners_batch: #{e}" +end +``` + +#### Using the create_trading_partners_batch_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_trading_partners_batch_with_http_info(avalara_version, create_trading_partners_batch_request, opts) + +```ruby +begin + # Creates a batch of multiple trading partners. + data, status_code, headers = api_instance.create_trading_partners_batch_with_http_info(avalara_version, create_trading_partners_batch_request, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue AvalaraSdk::EInvoicing::V1::ApiError => e + puts "Error when calling TradingPartnersApi->create_trading_partners_batch_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **avalara_version** | **String** | The HTTP Header meant to specify the version of the API intended to be used. | | +| **create_trading_partners_batch_request** | [**CreateTradingPartnersBatchRequest**](CreateTradingPartnersBatchRequest.md) | | | +| **x_avalara_client** | **String** | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". | [optional] | +| **x_correlation_id** | **String** | The caller can use this as an identifier to use as a correlation id to trace the call. | [optional] | + +### Return type + +[**CreateTradingPartnersBatch200Response**](CreateTradingPartnersBatch200Response.md) + +### Authorization + +[Bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## delete_trading_partner + +> delete_trading_partner(avalara_version, id, opts) + +Deletes a trading partner using ID. + +This endpoint deletes an existing trading partner identified by the provided ID. + +### Examples + +```ruby +require 'time' +require 'avalara_sdk' +# setup authorization +AvalaraSdk::EInvoicing::V1.configure do |config| + # See Documentation for Authorization section in main README.md for more auth examples. + config.bearer_token='' + config.environment='sandbox' + config.app_name='testApp' + config.app_version='1.2.3' + config.machine_name='testMachine' +end + +api_client = AvalaraSdk::ApiClient.new config +api_instance = AvalaraSdk::EInvoicing::V1::TradingPartnersApi.new api_client + +avalara_version = '1.4' # String | The HTTP Header meant to specify the version of the API intended to be used. +id = 'id_example' # String | The ID of the trading partner which is being deleted. +opts = { + x_avalara_client: 'John's E-Invoicing-API Client', # String | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". + x_correlation_id: 'f3f0d19a-01a1-4748-8a58-f000d0424f43' # String | The caller can use this as an identifier to use as a correlation id to trace the call. +} + +begin + # Deletes a trading partner using ID. + api_instance.delete_trading_partner(avalara_version, id, opts) +rescue AvalaraSdk::ApiError => e + puts "Error when calling TradingPartnersApi->delete_trading_partner: #{e}" +end +``` + +#### Using the delete_trading_partner_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> delete_trading_partner_with_http_info(avalara_version, id, opts) + +```ruby +begin + # Deletes a trading partner using ID. + data, status_code, headers = api_instance.delete_trading_partner_with_http_info(avalara_version, id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue AvalaraSdk::EInvoicing::V1::ApiError => e + puts "Error when calling TradingPartnersApi->delete_trading_partner_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **avalara_version** | **String** | The HTTP Header meant to specify the version of the API intended to be used. | | +| **id** | **String** | The ID of the trading partner which is being deleted. | | +| **x_avalara_client** | **String** | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". | [optional] | +| **x_correlation_id** | **String** | The caller can use this as an identifier to use as a correlation id to trace the call. | [optional] | + +### Return type + +nil (empty response body) + +### Authorization + +[Bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + ## download_batch_search_report > File download_batch_search_report(avalara_version, id, opts) -Download batch search results in a csv file. +Downloads batch search results in a csv file. -Downloads the report for a specific batch search using the batch search ID. +This endpoint downloads the report for a specific batch search using the batch search ID. It returns a CSV file containing up to 1,000 query results. ### Examples @@ -124,15 +376,15 @@ end api_client = AvalaraSdk::ApiClient.new config api_instance = AvalaraSdk::EInvoicing::V1::TradingPartnersApi.new api_client -avalara_version = '1.2' # String | The HTTP Header meant to specify the version of the API intended to be used -id = '2f5ea4b5-4dae-445a-b3e4-9f65a61eaa99' # String | The ID of the batch search whose report is to be downloaded. +avalara_version = '1.4' # String | The HTTP Header meant to specify the version of the API intended to be used. +id = '2f5ea4b5-4dae-445a-b3e4-9f65a61eaa99' # String | The ID of the batch search for which the report should be downloaded. opts = { - x_avalara_client: 'John's E-Invoicing-API Client', # String | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" + x_avalara_client: 'John's E-Invoicing-API Client', # String | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". x_correlation_id: 'f3f0d19a-01a1-4748-8a58-f000d0424f43' # String | The caller can use this as an identifier to use as a correlation id to trace the call. } begin - # Download batch search results in a csv file. + # Downloads batch search results in a csv file. result = api_instance.download_batch_search_report(avalara_version, id, opts) p result rescue AvalaraSdk::ApiError => e @@ -148,7 +400,7 @@ This returns an Array which contains the response data, status code and headers. ```ruby begin - # Download batch search results in a csv file. + # Downloads batch search results in a csv file. data, status_code, headers = api_instance.download_batch_search_report_with_http_info(avalara_version, id, opts) p status_code # => 2xx p headers # => { ... } @@ -162,9 +414,9 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **avalara_version** | **String** | The HTTP Header meant to specify the version of the API intended to be used | | -| **id** | **String** | The ID of the batch search whose report is to be downloaded. | | -| **x_avalara_client** | **String** | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" | [optional] | +| **avalara_version** | **String** | The HTTP Header meant to specify the version of the API intended to be used. | | +| **id** | **String** | The ID of the batch search for which the report should be downloaded. | | +| **x_avalara_client** | **String** | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". | [optional] | | **x_correlation_id** | **String** | The caller can use this as an identifier to use as a correlation id to trace the call. | [optional] | ### Return type @@ -185,9 +437,9 @@ end > get_batch_search_detail(avalara_version, id, opts) -Get the batch search details for a given id. +Returns the batch search details using ID. -This endpoint provides a detailed information for a specific batch search based on a given ID. It is ideal for tracking the progress of a previously initiated batch search operation. +This endpoint returns detailed information for a specific batch search using the provided ID. It is useful for tracking the status and progress of a previously initiated batch search operation. ### Examples @@ -207,15 +459,15 @@ end api_client = AvalaraSdk::ApiClient.new config api_instance = AvalaraSdk::EInvoicing::V1::TradingPartnersApi.new api_client -avalara_version = '1.2' # String | The HTTP Header meant to specify the version of the API intended to be used +avalara_version = '1.4' # String | The HTTP Header meant to specify the version of the API intended to be used. id = '2f5ea4b5-4dae-445a-b3e4-9f65a61eaa99' # String | The ID of the batch search that was submitted earlier. opts = { - x_avalara_client: 'John's E-Invoicing-API Client', # String | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" + x_avalara_client: 'John's E-Invoicing-API Client', # String | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". x_correlation_id: 'f3f0d19a-01a1-4748-8a58-f000d0424f43' # String | The caller can use this as an identifier to use as a correlation id to trace the call. } begin - # Get the batch search details for a given id. + # Returns the batch search details using ID. result = api_instance.get_batch_search_detail(avalara_version, id, opts) p result rescue AvalaraSdk::ApiError => e @@ -231,7 +483,7 @@ This returns an Array which contains the response data, status code and headers. ```ruby begin - # Get the batch search details for a given id. + # Returns the batch search details using ID. data, status_code, headers = api_instance.get_batch_search_detail_with_http_info(avalara_version, id, opts) p status_code # => 2xx p headers # => { ... } @@ -245,9 +497,9 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **avalara_version** | **String** | The HTTP Header meant to specify the version of the API intended to be used | | +| **avalara_version** | **String** | The HTTP Header meant to specify the version of the API intended to be used. | | | **id** | **String** | The ID of the batch search that was submitted earlier. | | -| **x_avalara_client** | **String** | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" | [optional] | +| **x_avalara_client** | **String** | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". | [optional] | | **x_correlation_id** | **String** | The caller can use this as an identifier to use as a correlation id to trace the call. | [optional] | ### Return type @@ -268,9 +520,9 @@ end > list_batch_searches(avalara_version, opts) -List all batch searches that were previously submitted. +Lists all batch searches that were previously submitted. -This endpoint provides a way to retrieve a comprehensive list of all batch search operations that have been previously submitted. This endpoint returns details about each batch search, such as their id, status, created date and associated metadata, allowing users to easily view past batch search requests. It's particularly useful for tracking the progress of a previously initiated batch search operations. +This endpoint retrieves a list of all batch search operations that have been previously submitted. It returns details such as the batch search ID, status, creation date, and associated metadata. It is useful for tracking the progress of a previously initiated batch search operations. ### Examples @@ -290,19 +542,19 @@ end api_client = AvalaraSdk::ApiClient.new config api_instance = AvalaraSdk::EInvoicing::V1::TradingPartnersApi.new api_client -avalara_version = '1.2' # String | The HTTP Header meant to specify the version of the API intended to be used +avalara_version = '1.4' # String | The HTTP Header meant to specify the version of the API intended to be used. opts = { - x_avalara_client: 'John's E-Invoicing-API Client', # String | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" - filter: 'name eq 'Batch_Search_Import_V4'', # String | Filter by field name and value. This filter only supports eq .The parameters supported is name. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. Filtering will be done over the provided parameters. - count: true, # Boolean | When set to true, the count of the collection is included as @recordSetCount in the response body. - top: 8.14, # Float | The number of items to include in the result. - skip: '10', # String | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. - order_by: 'name desc', # String | The $orderBy query parameter specifies the field and sorting direction for ordering the result set. The value is a string that combines a field name and a sorting direction (asc for ascending or desc for descending), separated by a space. + x_avalara_client: 'John's E-Invoicing-API Client', # String | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". + filter: 'name eq 'Batch_Search_Import_V4'', # String | Filters the results by field name. Only the eq operator and the name field is supported. For more information, refer to [AvaTax filtering guide](https://developer.avalara.com/avatax/filtering-in-rest/). + count: true, # Boolean | When set to true, returns the total count of matching records included as @recordSetCount in the response body. + top: 56, # Integer | The number of items to include in the result. + skip: 56, # Integer | The number of items to skip in the result. + order_by: 'name desc', # String | The $orderBy query parameter specifies the field and sorting direction for ordering the result set. The value is a string that combines a field name and a sorting direction (asc for ascending or desc for descending), separated by a space. x_correlation_id: 'f3f0d19a-01a1-4748-8a58-f000d0424f43' # String | The caller can use this as an identifier to use as a correlation id to trace the call. } begin - # List all batch searches that were previously submitted. + # Lists all batch searches that were previously submitted. result = api_instance.list_batch_searches(avalara_version, opts) p result rescue AvalaraSdk::ApiError => e @@ -318,7 +570,7 @@ This returns an Array which contains the response data, status code and headers. ```ruby begin - # List all batch searches that were previously submitted. + # Lists all batch searches that were previously submitted. data, status_code, headers = api_instance.list_batch_searches_with_http_info(avalara_version, opts) p status_code # => 2xx p headers # => { ... } @@ -332,13 +584,13 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **avalara_version** | **String** | The HTTP Header meant to specify the version of the API intended to be used | | -| **x_avalara_client** | **String** | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" | [optional] | -| **filter** | **String** | Filter by field name and value. This filter only supports <code>eq</code> .The parameters supported is <code>name</code>. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. Filtering will be done over the provided parameters. | [optional] | -| **count** | **Boolean** | When set to true, the count of the collection is included as @recordSetCount in the response body. | [optional] | -| **top** | **Float** | The number of items to include in the result. | [optional] | -| **skip** | **String** | If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. | [optional] | -| **order_by** | **String** | The $orderBy query parameter specifies the field and sorting direction for ordering the result set. The value is a string that combines a field name and a sorting direction (asc for ascending or desc for descending), separated by a space. | [optional] | +| **avalara_version** | **String** | The HTTP Header meant to specify the version of the API intended to be used. | | +| **x_avalara_client** | **String** | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". | [optional] | +| **filter** | **String** | Filters the results by field name. Only the <code>eq</code> operator and the name field is supported. For more information, refer to [AvaTax filtering guide](https://developer.avalara.com/avatax/filtering-in-rest/). | [optional] | +| **count** | **Boolean** | When set to <code>true</code>, returns the total count of matching records included as <code>@recordSetCount</code> in the response body. | [optional] | +| **top** | **Integer** | The number of items to include in the result. | [optional] | +| **skip** | **Integer** | The number of items to skip in the result. | [optional] | +| **order_by** | **String** | The <code>$orderBy</code> query parameter specifies the field and sorting direction for ordering the result set. The value is a string that combines a field name and a sorting direction (asc for ascending or desc for descending), separated by a space. | [optional] | | **x_correlation_id** | **String** | The caller can use this as an identifier to use as a correlation id to trace the call. | [optional] | ### Return type @@ -357,11 +609,11 @@ end ## search_participants -> search_participants(avalara_version, search, opts) +> search_participants(avalara_version, search, opts) Returns a list of participants matching the input query. -This endpoint provides a list of trading partners that match a specified input query. The search is performed based on various filters, search text, and other relevant parameters. +This endpoint retrieves a list of trading partners that match the specified search criteria. It supports filtering, search text, and other relevant query parameters to narrow down the results. ### Examples @@ -381,15 +633,15 @@ end api_client = AvalaraSdk::ApiClient.new config api_instance = AvalaraSdk::EInvoicing::V1::TradingPartnersApi.new api_client -avalara_version = '1.2' # String | The HTTP Header meant to specify the version of the API intended to be used -search = 'Acme and 7726627177 or BMW' # String | Search by value supports logical AND and OR. Refer to [https://learn.microsoft.com/en-us/odata/concepts/queryoptions-overview#search](https://learn.microsoft.com/en-us/odata/concepts/queryoptions-overview#search) for more information on search. Search will be done over name and identifier parameters only. +avalara_version = '1.4' # String | The HTTP Header meant to specify the version of the API intended to be used. +search = 'Acme and 7726627177 or BMW' # String | Search by value supports logical AND / OR operators. Search is performed only over the name and identifier value fields. For more information, refer to [Query options overview - OData.](https://learn.microsoft.com/en-us/odata/concepts/queryoptions-overview#search). opts = { - x_avalara_client: 'John's E-Invoicing-API Client', # String | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" - count: true, # Boolean | When set to true, the count of the collection is included as @recordSetCount in the response body. - filter: 'network eq 'Peppol' and country eq 'Australia'', # String | Filter by field name and value. This filter only supports eq .The parameters supported are network, country, documentType, idType. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. Filtering will be done over the provided parameters. - top: 8.14, # Float | The number of items to include in the result. - skip: '10', # String | If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets. - order_by: 'name desc', # String | The $orderBy query parameter specifies the field and sorting direction for ordering the result set. The value is a string that combines a field name and a sorting direction (asc for ascending or desc for descending), separated by a space. + x_avalara_client: 'John's E-Invoicing-API Client', # String | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". + count: true, # Boolean | When set to true, returns the total count of matching records included as @recordSetCount in the response body. + filter: 'network eq 'Peppol' and country eq 'Australia'', # String | Filters the results using the eq operator. Supported fields: network, country, documentType, idType. For more information, refer to [AvaTax filtering guide](https://developer.avalara.com/avatax/filtering-in-rest/). + top: 56, # Integer | The number of items to include in the result. + skip: 56, # Integer | The number of items to skip in the result. + order_by: 'name desc', # String | The $orderBy query parameter specifies the field and sorting direction for ordering the result set. The value is a string that combines a field name and a sorting direction (asc for ascending or desc for descending), separated by a space. x_correlation_id: 'f3f0d19a-01a1-4748-8a58-f000d0424f43' # String | The caller can use this as an identifier to use as a correlation id to trace the call. } @@ -406,7 +658,7 @@ end This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> search_participants_with_http_info(avalara_version, search, opts) +> , Integer, Hash)> search_participants_with_http_info(avalara_version, search, opts) ```ruby begin @@ -414,7 +666,7 @@ begin data, status_code, headers = api_instance.search_participants_with_http_info(avalara_version, search, opts) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => rescue AvalaraSdk::EInvoicing::V1::ApiError => e puts "Error when calling TradingPartnersApi->search_participants_with_http_info: #{e}" end @@ -424,19 +676,19 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **avalara_version** | **String** | The HTTP Header meant to specify the version of the API intended to be used | | -| **search** | **String** | Search by value supports logical AND and OR. Refer to [https://learn.microsoft.com/en-us/odata/concepts/queryoptions-overview#search](https://learn.microsoft.com/en-us/odata/concepts/queryoptions-overview#search) for more information on search. Search will be done over <code>name</code> and <code>identifier</code> parameters only. | | -| **x_avalara_client** | **String** | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" | [optional] | -| **count** | **Boolean** | When set to true, the count of the collection is included as @recordSetCount in the response body. | [optional] | -| **filter** | **String** | Filter by field name and value. This filter only supports <code>eq</code> .The parameters supported are <code>network</code>, <code>country</code>, <code>documentType</code>, <code>idType</code>. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. Filtering will be done over the provided parameters. | [optional] | -| **top** | **Float** | The number of items to include in the result. | [optional] | -| **skip** | **String** | If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. | [optional] | -| **order_by** | **String** | The $orderBy query parameter specifies the field and sorting direction for ordering the result set. The value is a string that combines a field name and a sorting direction (asc for ascending or desc for descending), separated by a space. | [optional] | +| **avalara_version** | **String** | The HTTP Header meant to specify the version of the API intended to be used. | | +| **search** | **String** | Search by value supports logical <code>AND</code> / <code>OR</code> operators. Search is performed only over the name and identifier value fields. For more information, refer to [Query options overview - OData.](https://learn.microsoft.com/en-us/odata/concepts/queryoptions-overview#search). | | +| **x_avalara_client** | **String** | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". | [optional] | +| **count** | **Boolean** | When set to <code>true</code>, returns the total count of matching records included as <code>@recordSetCount</code> in the response body. | [optional] | +| **filter** | **String** | Filters the results using the <code>eq</code> operator. Supported fields: <code>network</code>, <code>country</code>, <code>documentType</code>, <code>idType</code>. For more information, refer to [AvaTax filtering guide](https://developer.avalara.com/avatax/filtering-in-rest/). | [optional] | +| **top** | **Integer** | The number of items to include in the result. | [optional] | +| **skip** | **Integer** | The number of items to skip in the result. | [optional] | +| **order_by** | **String** | The <code>$orderBy</code> query parameter specifies the field and sorting direction for ordering the result set. The value is a string that combines a field name and a sorting direction (asc for ascending or desc for descending), separated by a space. | [optional] | | **x_correlation_id** | **String** | The caller can use this as an identifier to use as a correlation id to trace the call. | [optional] | ### Return type -[**DirectorySearchResponse**](DirectorySearchResponse.md) +[**SearchParticipants200Response**](SearchParticipants200Response.md) ### Authorization @@ -447,3 +699,88 @@ end - **Content-Type**: Not defined - **Accept**: application/json + +## update_trading_partner + +> update_trading_partner(avalara_version, id, trading_partner, opts) + +Updates a trading partner using ID. + +This endpoint updates the details of an existing trading partner specified by the provided ID. It performs a full update, and the request body must include all required fields. + +### Examples + +```ruby +require 'time' +require 'avalara_sdk' +# setup authorization +AvalaraSdk::EInvoicing::V1.configure do |config| + # See Documentation for Authorization section in main README.md for more auth examples. + config.bearer_token='' + config.environment='sandbox' + config.app_name='testApp' + config.app_version='1.2.3' + config.machine_name='testMachine' +end + +api_client = AvalaraSdk::ApiClient.new config +api_instance = AvalaraSdk::EInvoicing::V1::TradingPartnersApi.new api_client + +avalara_version = '1.4' # String | The HTTP Header meant to specify the version of the API intended to be used. +id = 'id_example' # String | The ID of the trading partner which is being updated. +trading_partner = AvalaraSdk::EInvoicing::V1::TradingPartner.new({name: 'name_example', identifiers: [AvalaraSdk::EInvoicing::V1::Identifier.new({name: 'name_example', value: 'value_example'})], addresses: [AvalaraSdk::EInvoicing::V1::Address.new({country: 'country_example'})], supported_document_types: [AvalaraSdk::EInvoicing::V1::SupportedDocumentTypes.new({value: 'value_example', supported_by_trading_partner: false})]}) # TradingPartner | +opts = { + x_avalara_client: 'John's E-Invoicing-API Client', # String | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". + x_correlation_id: 'f3f0d19a-01a1-4748-8a58-f000d0424f43' # String | The caller can use this as an identifier to use as a correlation id to trace the call. +} + +begin + # Updates a trading partner using ID. + result = api_instance.update_trading_partner(avalara_version, id, trading_partner, opts) + p result +rescue AvalaraSdk::ApiError => e + puts "Error when calling TradingPartnersApi->update_trading_partner: #{e}" +end +``` + +#### Using the update_trading_partner_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> update_trading_partner_with_http_info(avalara_version, id, trading_partner, opts) + +```ruby +begin + # Updates a trading partner using ID. + data, status_code, headers = api_instance.update_trading_partner_with_http_info(avalara_version, id, trading_partner, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue AvalaraSdk::EInvoicing::V1::ApiError => e + puts "Error when calling TradingPartnersApi->update_trading_partner_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **avalara_version** | **String** | The HTTP Header meant to specify the version of the API intended to be used. | | +| **id** | **String** | The ID of the trading partner which is being updated. | | +| **trading_partner** | [**TradingPartner**](TradingPartner.md) | | | +| **x_avalara_client** | **String** | You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". | [optional] | +| **x_correlation_id** | **String** | The caller can use this as an identifier to use as a correlation id to trace the call. | [optional] | + +### Return type + +[**UpdateTradingPartner200Response**](UpdateTradingPartner200Response.md) + +### Authorization + +[Bearer](../../../README.md#documentation-for-authorization) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + diff --git a/docs/EInvoicing/V1/UpdateTradingPartner200Response.md b/docs/EInvoicing/V1/UpdateTradingPartner200Response.md new file mode 100644 index 0000000..30e237e --- /dev/null +++ b/docs/EInvoicing/V1/UpdateTradingPartner200Response.md @@ -0,0 +1,22 @@ +# AvalaraSdk::EInvoicing::V1::UpdateTradingPartner200Response + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | Avalara unique ID of the participant in the directory. | [optional] | +| **status** | **String** | The status of the create operation. | [optional] | +| **message** | **String** | A human-readable message providing additional context or feedback about the outcome of the operation. | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::EInvoicing::V1::UpdateTradingPartner200Response.new( + id: ec0c06dffe6166c47fccbb3e6d391920e68c333d84f2510d4df2, + status: Complete, + message: Trading partner updated successfully. +) +``` + diff --git a/docs/EInvoicing/V1/ValidationError.md b/docs/EInvoicing/V1/ValidationError.md new file mode 100644 index 0000000..77824d2 --- /dev/null +++ b/docs/EInvoicing/V1/ValidationError.md @@ -0,0 +1,20 @@ +# AvalaraSdk::EInvoicing::V1::ValidationError + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **field** | **String** | The name of the field that failed validation. | [optional] | +| **message** | **String** | A human-readable explanation of the error for the specific field. | [optional] | + +## Example + +```ruby +require 'avalara_sdk' + +instance = AvalaraSdk::EInvoicing::V1::ValidationError.new( + field: null, + message: null +) +``` + diff --git a/lib/avalara_sdk.rb b/lib/avalara_sdk.rb index a3a7dec..87432bb 100644 --- a/lib/avalara_sdk.rb +++ b/lib/avalara_sdk.rb @@ -17,6 +17,7 @@ require File.expand_path( '../avalara_sdk/api/EInvoicing/V1/interop_api.rb', __FILE__) require File.expand_path( '../avalara_sdk/api/EInvoicing/V1/mandates_api.rb', __FILE__) require File.expand_path( '../avalara_sdk/api/EInvoicing/V1/subscriptions_api.rb', __FILE__) +require File.expand_path( '../avalara_sdk/api/EInvoicing/V1/tax_identifiers_api.rb', __FILE__) require File.expand_path( '../avalara_sdk/api/EInvoicing/V1/trading_partners_api.rb', __FILE__) require File.expand_path( '../avalara_sdk/auth/device_authorization_response.rb', __FILE__) require File.expand_path( '../avalara_sdk/auth/oauth_helper.rb', __FILE__) @@ -32,53 +33,75 @@ require File.expand_path( '../avalara_sdk/models/A1099/V2/company_model.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/company_response_model.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/company_response.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/A1099/V2/covered_individual_reference_response.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/covered_individual_reference.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/covered_individual_request.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/A1099/V2/create_w9_form_request.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/A1099/V2/create_w9_form201_response.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/A1099/V2/create1099_form201_response.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/data.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/error_model.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/error_response_errors_inner.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/error_response.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/form_request_base.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/form_request_csv_base.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/A1099/V2/form_request_list_item_base.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/form_request_model.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/form_response_base.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/form_single_request_base.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/A1099/V2/form1042_s_list_item_response.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/A1099/V2/form1042_s_list_item.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/A1099/V2/form1042_s_list.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/A1099/V2/form1042_s_request.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/A1099/V2/form1042_s_response.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/A1099/V2/form1095_b_list_item_response.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/form1095_b_list_item.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/form1095_b_list.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/form1095_b_request.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/form1095_b.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/A1099/V2/form1099_base_response.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/form1099_base.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/form1099_div_list_item.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/form1099_div_list.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/form1099_div_request.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/form1099_div_response.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/A1099/V2/form1099_k_list_item_response.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/form1099_k_list_item.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/form1099_k_list.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/form1099_k_request.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/form1099_k.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/form1099_list_data_inner.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/A1099/V2/form1099_list_response_value_inner.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/A1099/V2/form1099_list_response.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/form1099_list.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/A1099/V2/form1099_misc_list_item_response.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/form1099_misc_list_item.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/form1099_misc_list.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/form1099_misc_request.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/form1099_misc_response.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/form1099_misc.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/A1099/V2/form1099_nec_list_item_response.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/form1099_nec_list_item.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/form1099_nec_list.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/form1099_nec_request.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/form1099_nec_response.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/form1099_nec.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/form1099_proccess_result.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/A1099/V2/form1099_r_list_item_response.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/form1099_r_list_item.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/form1099_r_list.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/form1099_r_request.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/form1099_r.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/A1099/V2/form1099_status_detail_response.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/form1099_status_detail.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/get1099_form200_response.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/http_validation_problem_details.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/i_create_form1099_request.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/i_update_form1099_request.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/included_base.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/A1099/V2/intermediary_or_flow_through_request.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/A1099/V2/intermediary_or_flow_through_response.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/A1099/V2/intermediary_or_flow_through.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/issuer_command.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/issuer_response.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/iw9_form_data_models_one_of.rb', __FILE__) @@ -88,35 +111,54 @@ require File.expand_path( '../avalara_sdk/models/A1099/V2/paginated_query_result_model_issuer_response.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/paginated_query_result_model.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/paginated_w9_forms_model.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/A1099/V2/primary_withholding_agent_request.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/A1099/V2/primary_withholding_agent_response.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/A1099/V2/primary_withholding_agent.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/problem_details.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/state_and_local_withholding_request.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/state_and_local_withholding_response.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/state_and_local_withholding.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/state_efile_status_detail_app.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/A1099/V2/state_efile_status_detail_response.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/state_efile_status_detail.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/status_detail.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/A1099/V2/substantial_us_owner_request.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/substantial_us_owner_response.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/update1099_form200_response.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/validation_error_app.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/A1099/V2/validation_error_response.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/validation_error.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/w4_form_data_model.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/A1099/V2/w4_form_request.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/w4_form_response.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/A1099/V2/w8_ben_e_form_request.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/w8_ben_e_form_response.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/w8_ben_e_substantial_us_owner_data_model.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/w8_ben_form_data_model.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/A1099/V2/w8_ben_form_request.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/w8_ben_form_response.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/w8_bene_form_data_model.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/w8_imy_form_data_model.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/A1099/V2/w8_imy_form_request.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/w8_imy_form_response.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/A1099/V2/w9_form_base_request.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/w9_form_base_response.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/w9_form_data_model.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/A1099/V2/w9_form_request.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/A1099/V2/w9_form_response.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/address.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/bad_download_request.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/bad_request.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/batch_error_detail.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/batch_search_list_response.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/batch_search_participants202_response.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/batch_search.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/conditional_for_field.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/consents.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/create_trading_partner201_response.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/create_trading_partners_batch_request.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/create_trading_partners_batch200_response_value_inner.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/create_trading_partners_batch200_response.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/data_input_field_not_used_for.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/data_input_field_optional_for.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/data_input_field_required_for.rb', __FILE__) @@ -141,6 +183,7 @@ require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/event_message.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/event_payload.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/event_subscription.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/extension.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/fetch_documents_request_data_inner.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/fetch_documents_request_metadata.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/fetch_documents_request.rb', __FILE__) @@ -148,6 +191,7 @@ require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/hmac_signature_value.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/hmac_signature.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/id.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/identifier.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/input_data_formats.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/internal_server_error.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/mandate_data_input_field_namespace.rb', __FILE__) @@ -159,6 +203,7 @@ require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/output_data_formats.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/pagination.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/required_when_field.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/search_participants200_response.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/signature_signature.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/signature_value_signature.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/signature_value.rb', __FILE__) @@ -172,6 +217,14 @@ require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/subscription_list_response.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/subscription_registration.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/success_response.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/supported_document_types.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/tax_identifier_request.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/tax_identifier_response_value.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/tax_identifier_response.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/tax_identifier_schema_by_country200_response.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/trading_partner.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/update_trading_partner200_response.rb', __FILE__) +require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/validation_error.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/webhook_invocation.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/webhooks_error_info.rb', __FILE__) require File.expand_path( '../avalara_sdk/models/EInvoicing/V1/webhooks_error_response.rb', __FILE__) diff --git a/lib/avalara_sdk/api/A1099/V2/companies_w9_api.rb b/lib/avalara_sdk/api/A1099/V2/companies_w9_api.rb index 5ee543a..40a643a 100644 --- a/lib/avalara_sdk/api/A1099/V2/companies_w9_api.rb +++ b/lib/avalara_sdk/api/A1099/V2/companies_w9_api.rb @@ -1,7 +1,7 @@ =begin #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) =end @@ -17,7 +17,7 @@ def initialize(api_client) if (api_client.nil?) fail ArgumentError,'api_client is nil' end - api_client.set_sdk_version("25.7.2") + api_client.set_sdk_version("25.8.0") @api_client = api_client end @@ -225,8 +225,8 @@ def build_collection_param(param, collection_format) end end - # Creates a new company - # Creates a new company + # Create a company + # Create a company. # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param x_avalara_client [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/) . # @param company_create_update_request_model [CompanyCreateUpdateRequestModel] The company to create # @return [CompanyResponseModel] def create_company(request_parameters) @@ -234,8 +234,8 @@ def create_company(request_parameters) data end - # Creates a new company - # Creates a new company + # Create a company + # Create a company. # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format @@ -312,8 +312,8 @@ def create_company_with_http_info(request_parameters) return data, response.code, response.headers end - # Deletes a company - # Deletes a company + # Delete a company + # Delete a company. # @param id [String] The company to delete # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param x_avalara_client [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/) . # @return [nil] def delete_company(request_parameters) @@ -321,8 +321,8 @@ def delete_company(request_parameters) nil end - # Deletes a company - # Deletes a company + # Delete a company + # Delete a company. # @param id [String] The company to delete # @param avalara_version [String] API version @@ -509,7 +509,7 @@ def get_companies_with_http_info(request_parameters) end # Retrieve a company - # Retrieve an existing company + # Retrieve a company. # @param id [String] Id of the company # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param x_avalara_client [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/) . # @return [CompanyResponse] def get_company(request_parameters) @@ -518,7 +518,7 @@ def get_company(request_parameters) end # Retrieve a company - # Retrieve an existing company + # Retrieve a company. # @param id [String] Id of the company # @param avalara_version [String] API version @@ -595,7 +595,7 @@ def get_company_with_http_info(request_parameters) end # Update a company - # Update a company + # Update a company. # @param id [String] The ID of the company to update # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param x_avalara_client [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/) . # @param company_create_update_request_model [CompanyCreateUpdateRequestModel] The updated company data # @return [CompanyResponseModel] def update_company(request_parameters) @@ -604,7 +604,7 @@ def update_company(request_parameters) end # Update a company - # Update a company + # Update a company. # @param id [String] The ID of the company to update # @param avalara_version [String] API version diff --git a/lib/avalara_sdk/api/A1099/V2/forms1099_api.rb b/lib/avalara_sdk/api/A1099/V2/forms1099_api.rb index f9c6087..b7acfaf 100644 --- a/lib/avalara_sdk/api/A1099/V2/forms1099_api.rb +++ b/lib/avalara_sdk/api/A1099/V2/forms1099_api.rb @@ -1,7 +1,7 @@ =begin #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) =end @@ -17,7 +17,7 @@ def initialize(api_client) if (api_client.nil?) fail ArgumentError,'api_client is nil' end - api_client.set_sdk_version("25.7.2") + api_client.set_sdk_version("25.8.0") @api_client = api_client end @@ -225,8 +225,8 @@ def build_collection_param(param, collection_format) end end - # Creates or updates multiple 1099 forms. - # This endpoint allows you to create or update multiple 1099 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\": \"987-65-4321\", \"TinType\": \"IEN\", \"RecipientSecondName\": \"Jane Doe\", \"Address\": \"123 Main Street\", \"Address2\": \"Apt 4B\", \"City\": \"New York\", \"State\": \"NY\", \"Zip\": \"10001\", \"RecipientEmail\": \"john.doe@email.com\", \"AccountNumber\": \"ACC123456\", \"OfficeCode\": \"NYC01\", \"SecondTinNotice\": false, \"RecipientNonUsProvince\": \"\", \"CountryCode\": \"US\", \"Rents\": 12000.00, \"Royalties\": 5000.00, \"OtherIncome\": 3000.00, \"FishingBoatProceeds\": 0.00, \"MedicalHealthCarePayments\": 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, \"PayerMadeDirectSales\": 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\": \"987-65-4321\", \"tinType\": \"IEN\", \"address\": \"123 Center St\", \"address2\": \"\", \"city\": \"Santa Monica\", \"state\": \"CA\", \"zip\": \"90401\", \"countryCode\": \"US\", \"recipientNonUsProvince\": \"\", \"recipientEmail\": \"\", \"accountNumber\": \"\", \"officeCode\": \"\", \"secondTinNotice\": false, \"nonemployeeCompensation\": 123.45, \"payerMadeDirectSales\": 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. + # 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\", \"RecipientEmail\": \"john.doe@email.com\", \"AccountNumber\": \"ACC123456\", \"OfficeCode\": \"NYC01\", \"SecondTinNotice\": false, \"RecipientNonUsProvince\": \"\", \"CountryCode\": \"US\", \"Rents\": 12000.00, \"Royalties\": 5000.00, \"OtherIncome\": 3000.00, \"FishingBoatProceeds\": 0.00, \"MedicalHealthCarePayments\": 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\", \"recipientNonUsProvince\": \"\", \"recipientEmail\": \"\", \"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. # @param avalara_version [String] API version # @param dry_run [Boolean] # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param x_avalara_client [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/) . # @param bulk_upsert1099_forms_request [BulkUpsert1099FormsRequest] # @return [Form1099ProccessResult] def bulk_upsert1099_forms(request_parameters) @@ -234,8 +234,8 @@ def bulk_upsert1099_forms(request_parameters) data end - # Creates or updates multiple 1099 forms. - # This endpoint allows you to create or update multiple 1099 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\": \"987-65-4321\", \"TinType\": \"IEN\", \"RecipientSecondName\": \"Jane Doe\", \"Address\": \"123 Main Street\", \"Address2\": \"Apt 4B\", \"City\": \"New York\", \"State\": \"NY\", \"Zip\": \"10001\", \"RecipientEmail\": \"john.doe@email.com\", \"AccountNumber\": \"ACC123456\", \"OfficeCode\": \"NYC01\", \"SecondTinNotice\": false, \"RecipientNonUsProvince\": \"\", \"CountryCode\": \"US\", \"Rents\": 12000.00, \"Royalties\": 5000.00, \"OtherIncome\": 3000.00, \"FishingBoatProceeds\": 0.00, \"MedicalHealthCarePayments\": 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, \"PayerMadeDirectSales\": 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\": \"987-65-4321\", \"tinType\": \"IEN\", \"address\": \"123 Center St\", \"address2\": \"\", \"city\": \"Santa Monica\", \"state\": \"CA\", \"zip\": \"90401\", \"countryCode\": \"US\", \"recipientNonUsProvince\": \"\", \"recipientEmail\": \"\", \"accountNumber\": \"\", \"officeCode\": \"\", \"secondTinNotice\": false, \"nonemployeeCompensation\": 123.45, \"payerMadeDirectSales\": 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. + # 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\", \"RecipientEmail\": \"john.doe@email.com\", \"AccountNumber\": \"ACC123456\", \"OfficeCode\": \"NYC01\", \"SecondTinNotice\": false, \"RecipientNonUsProvince\": \"\", \"CountryCode\": \"US\", \"Rents\": 12000.00, \"Royalties\": 5000.00, \"OtherIncome\": 3000.00, \"FishingBoatProceeds\": 0.00, \"MedicalHealthCarePayments\": 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\", \"recipientNonUsProvince\": \"\", \"recipientEmail\": \"\", \"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. # @param avalara_version [String] API version # @param dry_run [Boolean] @@ -317,21 +317,23 @@ def bulk_upsert1099_forms_with_http_info(request_parameters) return data, response.code, response.headers end - # Creates a 1099 form. + # Create a 1099/1095/W2/1042S form + # Create a 1099/1095/W2/1042S form. # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param x_avalara_client [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/) . # @param i_create_form1099_request [ICreateForm1099Request] - # @return [Get1099Form200Response] + # @return [Create1099Form201Response] def create1099_form(request_parameters) data, _status_code, _headers = create1099_form_with_http_info(request_parameters) data end - # Creates a 1099 form. - + # Create a 1099/1095/W2/1042S form + # Create a 1099/1095/W2/1042S form. + # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param x_avalara_client [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/) . # @param i_create_form1099_request [ICreateForm1099Request] - # @return [Array<(Get1099Form200Response, Integer, Hash)>] Get1099Form200Response data, response status code and response headers + # @return [Array<(Create1099Form201Response, Integer, Hash)>] Create1099Form201Response data, response status code and response headers def create1099_form_with_http_info(request_parameters) # OAuth2 Scopes required_scopes = '' @@ -376,7 +378,7 @@ def create1099_form_with_http_info(request_parameters) post_body = @api_client.object_to_http_body(i_create_form1099_request) || {} # return_type - return_type = 'Get1099Form200Response' + return_type = 'Create1099Form201Response' # auth_names auth_names = ['bearer'] @@ -402,7 +404,8 @@ def create1099_form_with_http_info(request_parameters) return data, response.code, response.headers end - # Deletes a 1099 form. + # Delete a 1099/1095/W2/1042S form + # Delete a 1099/1095/W2/1042S form. # @param id [String] The unique identifier of the desired form to delete. # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param x_avalara_client [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/) . # @return [nil] def delete1099_form(request_parameters) @@ -410,8 +413,9 @@ def delete1099_form(request_parameters) nil end - # Deletes a 1099 form. - + # Delete a 1099/1095/W2/1042S form + # Delete a 1099/1095/W2/1042S form. + # @param id [String] The unique identifier of the desired form to delete. # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format @@ -486,7 +490,8 @@ def delete1099_form_with_http_info(request_parameters) return data, response.code, response.headers end - # Retrieves a 1099 form. + # Retrieve a 1099/1095/W2/1042S form + # Retrieve a 1099/1095/W2/1042S form. # @param id [String] # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param x_avalara_client [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/) . # @return [Get1099Form200Response] def get1099_form(request_parameters) @@ -494,8 +499,9 @@ def get1099_form(request_parameters) data end - # Retrieves a 1099 form. - + # Retrieve a 1099/1095/W2/1042S form + # Retrieve a 1099/1095/W2/1042S form. + # @param id [String] # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format @@ -570,22 +576,24 @@ def get1099_form_with_http_info(request_parameters) return data, response.code, response.headers end - # Retrieves the PDF file for a single 1099 by form id. - # @param id [String] # @param avalara_version [String] API version # @param mark_edelivered [Boolean] The parameter for marked e-delivered # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param x_avalara_client [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/) . - # @return [Update1099Form200Response] + # Retrieve the PDF file for a 1099/1095/W2/1042S form + # Retrieve the PDF file for a 1099/1095/W2/1042S form. + # @param id [String] The ID of the form # @param avalara_version [String] API version # @param mark_edelivered [Boolean] Optional boolean that if set indicates that the form should be marked as having been successfully edelivered # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param x_avalara_client [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/) . + # @return [File] def get1099_form_pdf(request_parameters) data, _status_code, _headers = get1099_form_pdf_with_http_info(request_parameters) data end - # Retrieves the PDF file for a single 1099 by form id. - - # @param id [String] + # Retrieve the PDF file for a 1099/1095/W2/1042S form + # Retrieve the PDF file for a 1099/1095/W2/1042S form. + + # @param id [String] The ID of the form # @param avalara_version [String] API version - # @param mark_edelivered [Boolean] The parameter for marked e-delivered + # @param mark_edelivered [Boolean] Optional boolean that if set indicates that the form should be marked as having been successfully edelivered # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param x_avalara_client [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/) . - # @return [Array<(Update1099Form200Response, Integer, Hash)>] Update1099Form200Response data, response status code and response headers + # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers def get1099_form_pdf_with_http_info(request_parameters) # OAuth2 Scopes required_scopes = '' @@ -615,7 +623,7 @@ def get1099_form_pdf_with_http_info(request_parameters) # header parameters header_params = {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/pdf', 'application/json']) if !avalara_version.nil? header_params[:'avalara-version'] = avalara_version end @@ -633,7 +641,7 @@ def get1099_form_pdf_with_http_info(request_parameters) post_body = {} # return_type - return_type = 'Update1099Form200Response' + return_type = 'File' # auth_names auth_names = ['bearer'] @@ -659,16 +667,18 @@ def get1099_form_pdf_with_http_info(request_parameters) return data, response.code, response.headers end - # Retrieves a list of 1099 forms based on query parameters. + # List 1099/1095/W2/1042S forms + # List 1099/1095/W2/1042S forms. Filterable fields are name, referenceId and taxYear. # @param avalara_version [String] API version # @param 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 # @param 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. # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with top to provide pagination for large datasets. # @param order_by [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 # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param x_avalara_client [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/) . - # @return [Form1099List] + # @return [Form1099ListResponse] def list1099_forms(request_parameters) data, _status_code, _headers = list1099_forms_with_http_info(request_parameters) data end - # Retrieves a list of 1099 forms based on query parameters. - + # List 1099/1095/W2/1042S forms + # List 1099/1095/W2/1042S forms. Filterable fields are name, referenceId and taxYear. + # @param avalara_version [String] API version # @param 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 # @param 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. @@ -676,7 +686,7 @@ def list1099_forms(request_parameters) # @param order_by [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 # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param x_avalara_client [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/) . - # @return [Array<(Form1099List, Integer, Hash)>] Form1099List data, response status code and response headers + # @return [Array<(Form1099ListResponse, Integer, Hash)>] Form1099ListResponse data, response status code and response headers def list1099_forms_with_http_info(request_parameters) # OAuth2 Scopes required_scopes = '' @@ -731,7 +741,7 @@ def list1099_forms_with_http_info(request_parameters) post_body = {} # return_type - return_type = 'Form1099List' + return_type = 'Form1099ListResponse' # auth_names auth_names = ['bearer'] @@ -757,7 +767,8 @@ def list1099_forms_with_http_info(request_parameters) return data, response.code, response.headers end - # Updates a 1099 form. + # Update a 1099/1095/W2/1042S form + # Update a 1099/1095/W2/1042S form. # @param id [String] # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param x_avalara_client [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/) . # @param i_update_form1099_request [IUpdateForm1099Request] # @return [Update1099Form200Response] def update1099_form(request_parameters) @@ -765,8 +776,9 @@ def update1099_form(request_parameters) data end - # Updates a 1099 form. - + # Update a 1099/1095/W2/1042S form + # Update a 1099/1095/W2/1042S form. + # @param id [String] # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format @@ -1065,9 +1077,9 @@ def set_x_avalara_client(x_avalara_client) end # Represents the Request object for the Get1099FormPdf API # - # @param String $id (required) + # @param String $id The ID of the form (required) # @param String $avalara_version API version (required) - # @param Boolean $mark_edelivered The parameter for marked e-delivered (optional) + # @param Boolean $mark_edelivered Optional boolean that if set indicates that the form should be marked as having been successfully edelivered (optional) # @param String $x_correlation_id Unique correlation Id in a GUID format (optional) # @param String $x_avalara_client 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) # diff --git a/lib/avalara_sdk/api/A1099/V2/forms_w9_api.rb b/lib/avalara_sdk/api/A1099/V2/forms_w9_api.rb index 9e9205f..7b1f15c 100644 --- a/lib/avalara_sdk/api/A1099/V2/forms_w9_api.rb +++ b/lib/avalara_sdk/api/A1099/V2/forms_w9_api.rb @@ -1,7 +1,7 @@ =begin #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) =end @@ -17,7 +17,7 @@ def initialize(api_client) if (api_client.nil?) fail ArgumentError,'api_client is nil' end - api_client.set_sdk_version("25.7.2") + api_client.set_sdk_version("25.8.0") @api_client = api_client end @@ -226,20 +226,22 @@ def build_collection_param(param, collection_format) end # Create a W9/W4/W8 form - # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param x_avalara_client [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/) . # @param iw9_form_data_models_one_of [IW9FormDataModelsOneOf] Form to be created - # @return [IW9FormDataModelsOneOf] + # Create a W9/W4/W8 form. + # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param x_avalara_client [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/) . # @param create_w9_form_request [CreateW9FormRequest] Form to be created + # @return [CreateW9Form201Response] def create_w9_form(request_parameters) data, _status_code, _headers = create_w9_form_with_http_info(request_parameters) data end # Create a W9/W4/W8 form - + # Create a W9/W4/W8 form. + # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param x_avalara_client [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/) . - # @param iw9_form_data_models_one_of [IW9FormDataModelsOneOf] Form to be created - # @return [Array<(IW9FormDataModelsOneOf, Integer, Hash)>] IW9FormDataModelsOneOf data, response status code and response headers + # @param create_w9_form_request [CreateW9FormRequest] Form to be created + # @return [Array<(CreateW9Form201Response, Integer, Hash)>] CreateW9Form201Response data, response status code and response headers def create_w9_form_with_http_info(request_parameters) # OAuth2 Scopes required_scopes = '' @@ -247,7 +249,7 @@ def create_w9_form_with_http_info(request_parameters) avalara_version = request_parameters.get_avalara_version() x_correlation_id = request_parameters.get_x_correlation_id() x_avalara_client = request_parameters.get_x_avalara_client() - iw9_form_data_models_one_of = request_parameters.get_iw9_form_data_models_one_of() + create_w9_form_request = request_parameters.get_create_w9_form_request() # verify the required parameter 'avalara_version' is set if @api_client.config.client_side_validation && avalara_version.nil? fail ArgumentError, "Missing the required parameter 'avalara_version' when calling FormsW9Api.create_w9_form" @@ -281,10 +283,10 @@ def create_w9_form_with_http_info(request_parameters) form_params = {} # http body (model) - post_body = @api_client.object_to_http_body(iw9_form_data_models_one_of) || {} + post_body = @api_client.object_to_http_body(create_w9_form_request) || {} # return_type - return_type = 'IW9FormDataModelsOneOf' + return_type = 'CreateW9Form201Response' # auth_names auth_names = ['bearer'] @@ -310,19 +312,19 @@ def create_w9_form_with_http_info(request_parameters) return data, response.code, response.headers end - # Delete a form - # Delete a form - # @param id [String] Id of the form to delete # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param x_avalara_client [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/) . + # Delete a W9/W4/W8 form + # Delete a W9/W4/W8 form. + # @param id [String] ID of the form to delete # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param x_avalara_client [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/) . # @return [nil] def delete_w9_form(request_parameters) delete_w9_form_with_http_info(request_parameters) nil end - # Delete a form - # Delete a form + # Delete a W9/W4/W8 form + # Delete a W9/W4/W8 form. - # @param id [String] Id of the form to delete + # @param id [String] ID of the form to delete # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param x_avalara_client [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/) . @@ -397,22 +399,22 @@ def delete_w9_form_with_http_info(request_parameters) end # Retrieve a W9/W4/W8 form - # Retrieve a W9/W4/W8 form - # @param id [String] Id of the form # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param x_avalara_client [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/) . - # @return [IW9FormDataModelsOneOf] + # Retrieve a W9/W4/W8 form. + # @param id [String] ID of the form # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param x_avalara_client [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/) . + # @return [CreateW9Form201Response] def get_w9_form(request_parameters) data, _status_code, _headers = get_w9_form_with_http_info(request_parameters) data end # Retrieve a W9/W4/W8 form - # Retrieve a W9/W4/W8 form + # Retrieve a W9/W4/W8 form. - # @param id [String] Id of the form + # @param id [String] ID of the form # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param x_avalara_client [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/) . - # @return [Array<(IW9FormDataModelsOneOf, Integer, Hash)>] IW9FormDataModelsOneOf data, response status code and response headers + # @return [Array<(CreateW9Form201Response, Integer, Hash)>] CreateW9Form201Response data, response status code and response headers def get_w9_form_with_http_info(request_parameters) # OAuth2 Scopes required_scopes = '' @@ -456,7 +458,7 @@ def get_w9_form_with_http_info(request_parameters) post_body = {} # return_type - return_type = 'IW9FormDataModelsOneOf' + return_type = 'CreateW9Form201Response' # auth_names auth_names = ['bearer'] @@ -482,7 +484,7 @@ def get_w9_form_with_http_info(request_parameters) return data, response.code, response.headers end - # List W9/W4/W8 forms. + # List W9/W4/W8 forms # List W9/W4/W8 forms. # @param avalara_version [String] API version # @param 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>. # @param 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. # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with top to provide pagination for large datasets. # @param order_by [String] A comma separated list of sort statements in the format (fieldname) [ASC|DESC], for example id ASC. # @param count [Boolean] When true, returns a @recordSetCount in the result set # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param x_avalara_client [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/) . # @return [PaginatedW9FormsModel] @@ -491,7 +493,7 @@ def list_w9_forms(request_parameters) data end - # List W9/W4/W8 forms. + # List W9/W4/W8 forms # List W9/W4/W8 forms. # @param avalara_version [String] API version @@ -587,7 +589,8 @@ def list_w9_forms_with_http_info(request_parameters) return data, response.code, response.headers end - # Sends a W9 email request to a vendor/payee + # 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. # @param id [String] The ID of the W9/W4/W8 form. # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param x_avalara_client [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/) . # @return [IW9FormDataModelsOneOf] def send_w9_form_email(request_parameters) @@ -595,8 +598,9 @@ def send_w9_form_email(request_parameters) data end - # Sends a W9 email request to a vendor/payee - + # 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. + # @param id [String] The ID of the W9/W4/W8 form. # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format @@ -672,7 +676,8 @@ def send_w9_form_email_with_http_info(request_parameters) end # Update a W9/W4/W8 form - # @param id [String] Id of the form to update # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param x_avalara_client [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/) . # @param iw9_form_data_models_one_of [IW9FormDataModelsOneOf] Form to be updated + # Update a W9/W4/W8 form. + # @param id [String] ID of the form to update # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param x_avalara_client [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/) . # @param iw9_form_data_models_one_of [IW9FormDataModelsOneOf] Form to be updated # @return [IW9FormDataModelsOneOf] def update_w9_form(request_parameters) data, _status_code, _headers = update_w9_form_with_http_info(request_parameters) @@ -680,8 +685,9 @@ def update_w9_form(request_parameters) end # Update a W9/W4/W8 form - - # @param id [String] Id of the form to update + # Update a W9/W4/W8 form. + + # @param id [String] ID of the form to update # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param x_avalara_client [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/) . @@ -762,24 +768,24 @@ def update_w9_form_with_http_info(request_parameters) return data, response.code, response.headers end - # Upload files for a W9/W4/W8 form - # Upload files for a W9/W4/W8 form + # Replace the PDF file for a W9/W4/W8 form + # Replaces the PDF file for a W9/W4/W8 form. # @param id [String] Id of the form # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param x_avalara_client [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/) . # @param file [File] - # @return [String] + # @return [nil] def upload_w9_files(request_parameters) - data, _status_code, _headers = upload_w9_files_with_http_info(request_parameters) - data + upload_w9_files_with_http_info(request_parameters) + nil end - # Upload files for a W9/W4/W8 form - # Upload files for a W9/W4/W8 form + # Replace the PDF file for a W9/W4/W8 form + # Replaces the PDF file for a W9/W4/W8 form. # @param id [String] Id of the form # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param x_avalara_client [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/) . # @param file [File] - # @return [Array<(String, Integer, Hash)>] String data, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def upload_w9_files_with_http_info(request_parameters) # OAuth2 Scopes required_scopes = '' @@ -832,7 +838,7 @@ def upload_w9_files_with_http_info(request_parameters) post_body = {} # return_type - return_type = 'String' + return_type = '' # auth_names auth_names = ['bearer'] @@ -849,7 +855,7 @@ def upload_w9_files_with_http_info(request_parameters) :return_type => return_type } - response = @api_client.call_api(:PUT, local_var_path, new_options, required_scopes, false, :A1099) + response = @api_client.call_api(:POST, local_var_path, new_options, required_scopes, false, :A1099) if new_options[:return_type] data = deserialize(response, new_options[:return_type]) else @@ -863,7 +869,7 @@ def upload_w9_files_with_http_info(request_parameters) # @param String $avalara_version API version (required) # @param String $x_correlation_id Unique correlation Id in a GUID format (optional) # @param String $x_avalara_client 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 IW9FormDataModelsOneOf $iw9_form_data_models_one_of Form to be created (optional) + # @param CreateW9FormRequest $create_w9_form_request Form to be created (optional) # class CreateW9FormRequestSdk attr_accessor :avalara_version @@ -872,7 +878,7 @@ class CreateW9FormRequestSdk attr_accessor :x_avalara_client - attr_accessor :iw9_form_data_models_one_of + attr_accessor :create_w9_form_request def initialize() end @@ -901,17 +907,17 @@ def set_x_avalara_client(x_avalara_client) @x_avalara_client = x_avalara_client end - def get_iw9_form_data_models_one_of() - return @iw9_form_data_models_one_of + def get_create_w9_form_request() + return @create_w9_form_request end - def set_iw9_form_data_models_one_of(iw9_form_data_models_one_of) - @iw9_form_data_models_one_of = iw9_form_data_models_one_of + def set_create_w9_form_request(create_w9_form_request) + @create_w9_form_request = create_w9_form_request end end # Represents the Request object for the DeleteW9Form API # - # @param String $id Id of the form to delete (required) + # @param String $id ID of the form to delete (required) # @param String $avalara_version API version (required) # @param String $x_correlation_id Unique correlation Id in a GUID format (optional) # @param String $x_avalara_client 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) @@ -962,7 +968,7 @@ def set_x_avalara_client(x_avalara_client) end # Represents the Request object for the GetW9Form API # - # @param String $id Id of the form (required) + # @param String $id ID of the form (required) # @param String $avalara_version API version (required) # @param String $x_correlation_id Unique correlation Id in a GUID format (optional) # @param String $x_avalara_client 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) @@ -1159,7 +1165,7 @@ def set_x_avalara_client(x_avalara_client) end # Represents the Request object for the UpdateW9Form API # - # @param String $id Id of the form to update (required) + # @param String $id ID of the form to update (required) # @param String $avalara_version API version (required) # @param String $x_correlation_id Unique correlation Id in a GUID format (optional) # @param String $x_avalara_client 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) diff --git a/lib/avalara_sdk/api/A1099/V2/issuers1099_api.rb b/lib/avalara_sdk/api/A1099/V2/issuers1099_api.rb index 822b591..ff75f5b 100644 --- a/lib/avalara_sdk/api/A1099/V2/issuers1099_api.rb +++ b/lib/avalara_sdk/api/A1099/V2/issuers1099_api.rb @@ -1,7 +1,7 @@ =begin #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) =end @@ -17,7 +17,7 @@ def initialize(api_client) if (api_client.nil?) fail ArgumentError,'api_client is nil' end - api_client.set_sdk_version("25.7.2") + api_client.set_sdk_version("25.8.0") @api_client = api_client end @@ -226,7 +226,7 @@ def build_collection_param(param, collection_format) end # Create an issuer - # Create a new issuer + # Create an issuer (also known as a Payer). # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param x_avalara_client [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/) . # @param issuer_command [IssuerCommand] The issuer to create # @return [IssuerResponse] def create_issuer(request_parameters) @@ -235,7 +235,7 @@ def create_issuer(request_parameters) end # Create an issuer - # Create a new issuer + # Create an issuer (also known as a Payer). # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format @@ -313,7 +313,7 @@ def create_issuer_with_http_info(request_parameters) end # Delete an issuer - # Delete an issuer + # Delete an issuer (also known as a Payer). # @param id [String] Id of the issuer to delete # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param x_avalara_client [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/) . # @return [nil] def delete_issuer(request_parameters) @@ -322,7 +322,7 @@ def delete_issuer(request_parameters) end # Delete an issuer - # Delete an issuer + # Delete an issuer (also known as a Payer). # @param id [String] Id of the issuer to delete # @param avalara_version [String] API version @@ -398,19 +398,19 @@ def delete_issuer_with_http_info(request_parameters) return data, response.code, response.headers end - # Get an issuer - # Get an issuer - # @param id [String] # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param x_avalara_client [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/) . + # Retrieve an issuer + # Retrieve an issuer (also known as a Payer). + # @param id [String] Id of the issuer to retrieve # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param x_avalara_client [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/) . # @return [IssuerResponse] def get_issuer(request_parameters) data, _status_code, _headers = get_issuer_with_http_info(request_parameters) data end - # Get an issuer - # Get an issuer + # Retrieve an issuer + # Retrieve an issuer (also known as a Payer). - # @param id [String] + # @param id [String] Id of the issuer to retrieve # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param x_avalara_client [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/) . @@ -485,7 +485,7 @@ def get_issuer_with_http_info(request_parameters) end # List issuers - # List issuers for a given tax year. Filterable fields are name, referenceId and taxYear + # List issuers (also known as Payers). Filterable fields are name, referenceId and taxYear. # @param avalara_version [String] API version # @param 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>. # @param 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. # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with top to provide pagination for large datasets. # @param order_by [String] A comma separated list of sort statements in the format (fieldname) [ASC|DESC], for example id ASC. # @param count [Boolean] If true, return the global count of elements in the collection. # @param count_only [Boolean] If true, return ONLY the global count of elements in the collection. It only applies when count=true. # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param x_avalara_client [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/) . # @return [PaginatedQueryResultModelIssuerResponse] def get_issuers(request_parameters) @@ -494,7 +494,7 @@ def get_issuers(request_parameters) end # List issuers - # List issuers for a given tax year. Filterable fields are name, referenceId and taxYear + # List issuers (also known as Payers). Filterable fields are name, referenceId and taxYear. # @param avalara_version [String] API version # @param 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>. @@ -595,8 +595,8 @@ def get_issuers_with_http_info(request_parameters) end # Update an issuer - # Update an existing issuer - # @param id [String] Id of the issuer to Update # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param x_avalara_client [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/) . # @param issuer_command [IssuerCommand] The issuer to update + # Update an issuer (also known as a Payer). + # @param id [String] Id of the issuer to update # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param x_avalara_client [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/) . # @param issuer_command [IssuerCommand] The issuer to update # @return [nil] def update_issuer(request_parameters) update_issuer_with_http_info(request_parameters) @@ -604,9 +604,9 @@ def update_issuer(request_parameters) end # Update an issuer - # Update an existing issuer + # Update an issuer (also known as a Payer). - # @param id [String] Id of the issuer to Update + # @param id [String] Id of the issuer to update # @param avalara_version [String] API version # @param x_correlation_id [String] Unique correlation Id in a GUID format # @param x_avalara_client [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/) . @@ -791,7 +791,7 @@ def set_x_avalara_client(x_avalara_client) end # Represents the Request object for the GetIssuer API # - # @param String $id id (required) + # @param String $id Id of the issuer to retrieve (required) # @param String $avalara_version API version (required) # @param String $x_correlation_id Unique correlation Id in a GUID format (optional) # @param String $x_avalara_client 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) @@ -948,7 +948,7 @@ def set_x_avalara_client(x_avalara_client) end # Represents the Request object for the UpdateIssuer API # - # @param String $id Id of the issuer to Update (required) + # @param String $id Id of the issuer to update (required) # @param String $avalara_version API version (required) # @param String $x_correlation_id Unique correlation Id in a GUID format (optional) # @param String $x_avalara_client 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) diff --git a/lib/avalara_sdk/api/A1099/V2/jobs1099_api.rb b/lib/avalara_sdk/api/A1099/V2/jobs1099_api.rb index 6d70275..8000fa9 100644 --- a/lib/avalara_sdk/api/A1099/V2/jobs1099_api.rb +++ b/lib/avalara_sdk/api/A1099/V2/jobs1099_api.rb @@ -1,7 +1,7 @@ =begin #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) =end @@ -17,7 +17,7 @@ def initialize(api_client) if (api_client.nil?) fail ArgumentError,'api_client is nil' end - api_client.set_sdk_version("25.7.2") + api_client.set_sdk_version("25.8.0") @api_client = api_client end diff --git a/lib/avalara_sdk/api/EInvoicing/V1/data_input_fields_api.rb b/lib/avalara_sdk/api/EInvoicing/V1/data_input_fields_api.rb index 9f65a86..d30f881 100644 --- a/lib/avalara_sdk/api/EInvoicing/V1/data_input_fields_api.rb +++ b/lib/avalara_sdk/api/EInvoicing/V1/data_input_fields_api.rb @@ -17,7 +17,7 @@ def initialize(api_client) if (api_client.nil?) fail ArgumentError,'api_client is nil' end - api_client.set_sdk_version("25.7.2") + api_client.set_sdk_version("25.8.0") @api_client = api_client end @@ -227,7 +227,7 @@ def build_collection_param(param, collection_format) # Returns the optionality of document fields for different country mandates # This endpoint provides a list of required, conditional, and optional fields for each country mandate. You can use the mandates endpoint to retrieve all available country mandates. You can use the $filter query parameter to retrieve fields for a particular mandate - # @param avalara_version [String] The HTTP Header meant to specify the version of the API intended to be used # @param x_avalara_client [String] You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. # @param filter [String] Filter by field name and value. This filter only supports <code>eq</code> and <code>contains</code>. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. # @param top [Float] The number of items to include in the result. # @param skip [String] If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. # @param count [Boolean] When set to true, the count of the collection is also returned in the response body # @param count_only [Boolean] When set to true, only the count of the collection is returned + # @param avalara_version [String] The HTTP Header meant to specify the version of the API intended to be used # @param x_avalara_client [String] You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. # @param filter [String] Filter by field name and value. This filter only supports <code>eq</code> and <code>contains</code>. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. # @param top [Integer] The number of items to include in the result. # @param skip [Integer] The number of items to skip in the result. # @param count [Boolean] When set to true, the count of the collection is also returned in the response body # @param count_only [Boolean] When set to true, only the count of the collection is returned # @return [DataInputFieldsResponse] def get_data_input_fields(request_parameters) data, _status_code, _headers = get_data_input_fields_with_http_info(request_parameters) @@ -240,8 +240,8 @@ def get_data_input_fields(request_parameters) # @param avalara_version [String] The HTTP Header meant to specify the version of the API intended to be used # @param x_avalara_client [String] You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. # @param filter [String] Filter by field name and value. This filter only supports <code>eq</code> and <code>contains</code>. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. - # @param top [Float] The number of items to include in the result. - # @param skip [String] If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. + # @param top [Integer] The number of items to include in the result. + # @param skip [Integer] The number of items to skip in the result. # @param count [Boolean] When set to true, the count of the collection is also returned in the response body # @param count_only [Boolean] When set to true, only the count of the collection is returned # @return [Array<(DataInputFieldsResponse, Integer, Hash)>] DataInputFieldsResponse data, response status code and response headers @@ -330,8 +330,8 @@ def get_data_input_fields_with_http_info(request_parameters) # @param String $avalara_version The HTTP Header meant to specify the version of the API intended to be used (required) # @param String $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. (optional) # @param String $filter Filter by field name and value. This filter only supports <code>eq</code> and <code>contains</code>. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. (optional) - # @param Float $top The number of items to include in the result. (optional) - # @param String $skip If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. (optional) + # @param Integer $top The number of items to include in the result. (optional) + # @param Integer $skip The number of items to skip in the result. (optional) # @param Boolean $count When set to true, the count of the collection is also returned in the response body (optional) # @param Boolean $count_only When set to true, only the count of the collection is returned (optional) # @@ -354,7 +354,7 @@ def initialize() end def get_avalara_version() - return @avalara_version || '1.3' + return @avalara_version || '1.4' end def set_avalara_version(avalara_version) diff --git a/lib/avalara_sdk/api/EInvoicing/V1/documents_api.rb b/lib/avalara_sdk/api/EInvoicing/V1/documents_api.rb index a067660..2b904d9 100644 --- a/lib/avalara_sdk/api/EInvoicing/V1/documents_api.rb +++ b/lib/avalara_sdk/api/EInvoicing/V1/documents_api.rb @@ -17,7 +17,7 @@ def initialize(api_client) if (api_client.nil?) fail ArgumentError,'api_client is nil' end - api_client.set_sdk_version("25.7.2") + api_client.set_sdk_version("25.8.0") @api_client = api_client end @@ -403,7 +403,7 @@ def fetch_documents_with_http_info(request_parameters) # Returns a summary of documents for a date range # Get a list of documents on the Avalara E-Invoicing platform that have a processing date within the specified date range. - # @param avalara_version [String] The HTTP Header meant to specify the version of the API intended to be used # @param x_avalara_client [String] You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. # @param start_date [Time] Start date of documents to return. This defaults to the previous month. # @param end_date [Time] End date of documents to return. This defaults to the current date. # @param flow [String] Optionally filter by document direction, where issued = `out` and received = `in` # @param count [String] When set to true, the count of the collection is also returned in the response body # @param count_only [String] When set to true, only the count of the collection is returned # @param filter [String] Filter by field name and value. This filter only supports <code>eq</code> . Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. Filtering will be done over the provided startDate and endDate. If no startDate or endDate is provided, defaults will be assumed. # @param top [Float] The number of items to include in the result. # @param skip [String] If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. + # @param avalara_version [String] The HTTP Header meant to specify the version of the API intended to be used # @param x_avalara_client [String] You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. # @param start_date [Time] Start date of documents to return. This defaults to the previous month. # @param end_date [Time] End date of documents to return. This defaults to the current date. # @param flow [String] Optionally filter by document direction, where issued = `out` and received = `in` # @param count [String] When set to true, the count of the collection is also returned in the response body # @param count_only [String] When set to true, only the count of the collection is returned # @param filter [String] Filter by field name and value. This filter only supports <code>eq</code> . Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. Filtering will be done over the provided startDate and endDate. If no startDate or endDate is provided, defaults will be assumed. # @param top [Integer] The number of items to include in the result. # @param skip [Integer] The number of items to skip in the result. # @return [DocumentListResponse] def get_document_list(request_parameters) data, _status_code, _headers = get_document_list_with_http_info(request_parameters) @@ -421,8 +421,8 @@ def get_document_list(request_parameters) # @param count [String] When set to true, the count of the collection is also returned in the response body # @param count_only [String] When set to true, only the count of the collection is returned # @param filter [String] Filter by field name and value. This filter only supports <code>eq</code> . Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. Filtering will be done over the provided startDate and endDate. If no startDate or endDate is provided, defaults will be assumed. - # @param top [Float] The number of items to include in the result. - # @param skip [String] If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. + # @param top [Integer] The number of items to include in the result. + # @param skip [Integer] The number of items to skip in the result. # @return [Array<(DocumentListResponse, Integer, Hash)>] DocumentListResponse data, response status code and response headers def get_document_list_with_http_info(request_parameters) # OAuth2 Scopes @@ -715,7 +715,7 @@ def initialize() end def get_avalara_version() - return @avalara_version || '1.3' + return @avalara_version || '1.4' end def set_avalara_version(avalara_version) @@ -763,7 +763,7 @@ def initialize() end def get_avalara_version() - return @avalara_version || '1.3' + return @avalara_version || '1.4' end def set_avalara_version(avalara_version) @@ -796,8 +796,8 @@ def set_x_avalara_client(x_avalara_client) # @param String $count When set to true, the count of the collection is also returned in the response body (optional) # @param String $count_only When set to true, only the count of the collection is returned (optional) # @param String $filter Filter by field name and value. This filter only supports <code>eq</code> . Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. Filtering will be done over the provided startDate and endDate. If no startDate or endDate is provided, defaults will be assumed. (optional) - # @param Float $top The number of items to include in the result. (optional) - # @param String $skip If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. (optional) + # @param Integer $top The number of items to include in the result. (optional) + # @param Integer $skip The number of items to skip in the result. (optional) # class GetDocumentListRequestSdk attr_accessor :avalara_version @@ -824,7 +824,7 @@ def initialize() end def get_avalara_version() - return @avalara_version || '1.3' + return @avalara_version || '1.4' end def set_avalara_version(avalara_version) @@ -920,7 +920,7 @@ def initialize() end def get_avalara_version() - return @avalara_version || '1.3' + return @avalara_version || '1.4' end def set_avalara_version(avalara_version) @@ -963,7 +963,7 @@ def initialize() end def get_avalara_version() - return @avalara_version || '1.3' + return @avalara_version || '1.4' end def set_avalara_version(avalara_version) diff --git a/lib/avalara_sdk/api/EInvoicing/V1/interop_api.rb b/lib/avalara_sdk/api/EInvoicing/V1/interop_api.rb index 3f1647f..f11dd17 100644 --- a/lib/avalara_sdk/api/EInvoicing/V1/interop_api.rb +++ b/lib/avalara_sdk/api/EInvoicing/V1/interop_api.rb @@ -17,7 +17,7 @@ def initialize(api_client) if (api_client.nil?) fail ArgumentError,'api_client is nil' end - api_client.set_sdk_version("25.7.2") + api_client.set_sdk_version("25.8.0") @api_client = api_client end @@ -385,7 +385,7 @@ def set_interchange_type(interchange_type) end def get_avalara_version() - return @avalara_version || '1.3' + return @avalara_version || '1.4' end def set_avalara_version(avalara_version) diff --git a/lib/avalara_sdk/api/EInvoicing/V1/mandates_api.rb b/lib/avalara_sdk/api/EInvoicing/V1/mandates_api.rb index 25fda69..8dfdc8b 100644 --- a/lib/avalara_sdk/api/EInvoicing/V1/mandates_api.rb +++ b/lib/avalara_sdk/api/EInvoicing/V1/mandates_api.rb @@ -17,7 +17,7 @@ def initialize(api_client) if (api_client.nil?) fail ArgumentError,'api_client is nil' end - api_client.set_sdk_version("25.7.2") + api_client.set_sdk_version("25.8.0") @api_client = api_client end @@ -326,7 +326,7 @@ def get_mandate_data_input_fields_with_http_info(request_parameters) # List country mandates that are supported by the Avalara E-Invoicing platform # This endpoint offers a list of country mandates supported by the Avalara E-Invoicing API. - # @param avalara_version [String] The HTTP Header meant to specify the version of the API intended to be used # @param x_avalara_client [String] You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. # @param filter [String] Filter by field name and value. This filter only supports <code>eq</code> and <code>contains</code>. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. # @param top [Float] The number of items to include in the result. # @param skip [String] If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. # @param count [Boolean] When set to true, the count of the collection is also returned in the response body. # @param count_only [Boolean] When set to true, only the count of the collection is returned + # @param avalara_version [String] The HTTP Header meant to specify the version of the API intended to be used # @param x_avalara_client [String] You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. # @param filter [String] Filter by field name and value. This filter only supports <code>eq</code> and <code>contains</code>. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. # @param top [Integer] The number of items to include in the result. # @param skip [Integer] The number of items to skip in the result. # @param count [Boolean] When set to true, the count of the collection is also returned in the response body. # @param count_only [Boolean] When set to true, only the count of the collection is returned # @return [MandatesResponse] def get_mandates(request_parameters) data, _status_code, _headers = get_mandates_with_http_info(request_parameters) @@ -339,8 +339,8 @@ def get_mandates(request_parameters) # @param avalara_version [String] The HTTP Header meant to specify the version of the API intended to be used # @param x_avalara_client [String] You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. # @param filter [String] Filter by field name and value. This filter only supports <code>eq</code> and <code>contains</code>. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. - # @param top [Float] The number of items to include in the result. - # @param skip [String] If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. + # @param top [Integer] The number of items to include in the result. + # @param skip [Integer] The number of items to skip in the result. # @param count [Boolean] When set to true, the count of the collection is also returned in the response body. # @param count_only [Boolean] When set to true, only the count of the collection is returned # @return [Array<(MandatesResponse, Integer, Hash)>] MandatesResponse data, response status code and response headers @@ -447,7 +447,7 @@ def initialize() end def get_avalara_version() - return @avalara_version || '1.3' + return @avalara_version || '1.4' end def set_avalara_version(avalara_version) @@ -491,8 +491,8 @@ def set_x_avalara_client(x_avalara_client) # @param String $avalara_version The HTTP Header meant to specify the version of the API intended to be used (required) # @param String $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a fingerprint. (optional) # @param String $filter Filter by field name and value. This filter only supports <code>eq</code> and <code>contains</code>. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. (optional) - # @param Float $top The number of items to include in the result. (optional) - # @param String $skip If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. (optional) + # @param Integer $top The number of items to include in the result. (optional) + # @param Integer $skip The number of items to skip in the result. (optional) # @param Boolean $count When set to true, the count of the collection is also returned in the response body. (optional) # @param Boolean $count_only When set to true, only the count of the collection is returned (optional) # @@ -515,7 +515,7 @@ def initialize() end def get_avalara_version() - return @avalara_version || '1.3' + return @avalara_version || '1.4' end def set_avalara_version(avalara_version) diff --git a/lib/avalara_sdk/api/EInvoicing/V1/subscriptions_api.rb b/lib/avalara_sdk/api/EInvoicing/V1/subscriptions_api.rb index e47e1f3..dd5f6fa 100644 --- a/lib/avalara_sdk/api/EInvoicing/V1/subscriptions_api.rb +++ b/lib/avalara_sdk/api/EInvoicing/V1/subscriptions_api.rb @@ -17,7 +17,7 @@ def initialize(api_client) if (api_client.nil?) fail ArgumentError,'api_client is nil' end - api_client.set_sdk_version("25.7.2") + api_client.set_sdk_version("25.8.0") @api_client = api_client end @@ -227,7 +227,7 @@ def build_collection_param(param, collection_format) # Create a subscription to events # Create a subscription to events exposed by registered systems. - # @param avalara_version [String] The version of the API to use, e.g., \"1.3\". # @param subscription_registration [SubscriptionRegistration] # @param x_correlation_id [String] A unique identifier for tracking the request and its response # @param x_avalara_client [String] Client application identification + # @param avalara_version [String] The version of the API to use, e.g., \"1.4\". # @param subscription_registration [SubscriptionRegistration] # @param x_correlation_id [String] A unique identifier for tracking the request and its response # @param x_avalara_client [String] Client application identification # @return [SuccessResponse] def create_webhook_subscription(request_parameters) data, _status_code, _headers = create_webhook_subscription_with_http_info(request_parameters) @@ -237,7 +237,7 @@ def create_webhook_subscription(request_parameters) # Create a subscription to events # Create a subscription to events exposed by registered systems. - # @param avalara_version [String] The version of the API to use, e.g., \"1.3\". + # @param avalara_version [String] The version of the API to use, e.g., \"1.4\". # @param subscription_registration [SubscriptionRegistration] # @param x_correlation_id [String] A unique identifier for tracking the request and its response # @param x_avalara_client [String] Client application identification @@ -318,7 +318,7 @@ def create_webhook_subscription_with_http_info(request_parameters) # Unsubscribe from events # Remove a subscription from the webhooks dispatch service. All events and subscriptions are also deleted. - # @param subscription_id [String] # @param avalara_version [String] The version of the API to use, e.g., \"1.3\". # @param x_correlation_id [String] A unique identifier for tracking the request and its response # @param x_avalara_client [String] Client application identification + # @param subscription_id [String] # @param avalara_version [String] The version of the API to use, e.g., \"1.4\". # @param x_correlation_id [String] A unique identifier for tracking the request and its response # @param x_avalara_client [String] Client application identification # @return [nil] def delete_webhook_subscription(request_parameters) delete_webhook_subscription_with_http_info(request_parameters) @@ -329,7 +329,7 @@ def delete_webhook_subscription(request_parameters) # Remove a subscription from the webhooks dispatch service. All events and subscriptions are also deleted. # @param subscription_id [String] - # @param avalara_version [String] The version of the API to use, e.g., \"1.3\". + # @param avalara_version [String] The version of the API to use, e.g., \"1.4\". # @param x_correlation_id [String] A unique identifier for tracking the request and its response # @param x_avalara_client [String] Client application identification # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers @@ -404,7 +404,7 @@ def delete_webhook_subscription_with_http_info(request_parameters) # Get details of a subscription # Retrieve details of a specific subscription. - # @param subscription_id [String] # @param avalara_version [String] The version of the API to use, e.g., \"1.3\". # @param x_correlation_id [String] A unique identifier for tracking the request and its response # @param x_avalara_client [String] Client application identification + # @param subscription_id [String] # @param avalara_version [String] The version of the API to use, e.g., \"1.4\". # @param x_correlation_id [String] A unique identifier for tracking the request and its response # @param x_avalara_client [String] Client application identification # @return [SubscriptionDetail] def get_webhook_subscription(request_parameters) data, _status_code, _headers = get_webhook_subscription_with_http_info(request_parameters) @@ -415,7 +415,7 @@ def get_webhook_subscription(request_parameters) # Retrieve details of a specific subscription. # @param subscription_id [String] - # @param avalara_version [String] The version of the API to use, e.g., \"1.3\". + # @param avalara_version [String] The version of the API to use, e.g., \"1.4\". # @param x_correlation_id [String] A unique identifier for tracking the request and its response # @param x_avalara_client [String] Client application identification # @return [Array<(SubscriptionDetail, Integer, Hash)>] SubscriptionDetail data, response status code and response headers @@ -490,7 +490,7 @@ def get_webhook_subscription_with_http_info(request_parameters) # List all subscriptions # Retrieve a list of all subscriptions. - # @param avalara_version [String] The version of the API to use, e.g., \"1.3\". # @param x_correlation_id [String] A unique identifier for tracking the request and its response # @param x_avalara_client [String] Client application identification # @param top [Float] The number of items to include in the result. # @param skip [Float] The number of items to skip in the result. # @param count [Boolean] Whether to include the total count of records in the result. # @param count_only [Boolean] Whether to return only the count of records, without the list of records. + # @param avalara_version [String] The version of the API to use, e.g., \"1.4\". # @param x_correlation_id [String] A unique identifier for tracking the request and its response # @param x_avalara_client [String] Client application identification # @param top [Integer] The number of items to include in the result. # @param skip [Integer] The number of items to skip in the result. # @param count [Boolean] Whether to include the total count of records in the result. # @param count_only [Boolean] Whether to return only the count of records, without the list of records. # @return [SubscriptionListResponse] def list_webhook_subscriptions(request_parameters) data, _status_code, _headers = list_webhook_subscriptions_with_http_info(request_parameters) @@ -500,11 +500,11 @@ def list_webhook_subscriptions(request_parameters) # List all subscriptions # Retrieve a list of all subscriptions. - # @param avalara_version [String] The version of the API to use, e.g., \"1.3\". + # @param avalara_version [String] The version of the API to use, e.g., \"1.4\". # @param x_correlation_id [String] A unique identifier for tracking the request and its response # @param x_avalara_client [String] Client application identification - # @param top [Float] The number of items to include in the result. - # @param skip [Float] The number of items to skip in the result. + # @param top [Integer] The number of items to include in the result. + # @param skip [Integer] The number of items to skip in the result. # @param count [Boolean] Whether to include the total count of records in the result. # @param count_only [Boolean] Whether to return only the count of records, without the list of records. # @return [Array<(SubscriptionListResponse, Integer, Hash)>] SubscriptionListResponse data, response status code and response headers @@ -590,7 +590,7 @@ def list_webhook_subscriptions_with_http_info(request_parameters) end # Represents the Request object for the CreateWebhookSubscription API # - # @param String $avalara_version The version of the API to use, e.g., \"1.3\". (required) + # @param String $avalara_version The version of the API to use, e.g., \"1.4\". (required) # @param SubscriptionRegistration $subscription_registration subscription_registration (required) # @param String $x_correlation_id A unique identifier for tracking the request and its response (optional) # @param String $x_avalara_client Client application identification (optional) @@ -608,7 +608,7 @@ def initialize() end def get_avalara_version() - return @avalara_version || '1.3' + return @avalara_version || '1.4' end def set_avalara_version(avalara_version) @@ -642,7 +642,7 @@ def set_x_avalara_client(x_avalara_client) # Represents the Request object for the DeleteWebhookSubscription API # # @param String $subscription_id subscription_id (required) - # @param String $avalara_version The version of the API to use, e.g., \"1.3\". (required) + # @param String $avalara_version The version of the API to use, e.g., \"1.4\". (required) # @param String $x_correlation_id A unique identifier for tracking the request and its response (optional) # @param String $x_avalara_client Client application identification (optional) # @@ -667,7 +667,7 @@ def set_subscription_id(subscription_id) end def get_avalara_version() - return @avalara_version || '1.3' + return @avalara_version || '1.4' end def set_avalara_version(avalara_version) @@ -693,7 +693,7 @@ def set_x_avalara_client(x_avalara_client) # Represents the Request object for the GetWebhookSubscription API # # @param String $subscription_id subscription_id (required) - # @param String $avalara_version The version of the API to use, e.g., \"1.3\". (required) + # @param String $avalara_version The version of the API to use, e.g., \"1.4\". (required) # @param String $x_correlation_id A unique identifier for tracking the request and its response (optional) # @param String $x_avalara_client Client application identification (optional) # @@ -718,7 +718,7 @@ def set_subscription_id(subscription_id) end def get_avalara_version() - return @avalara_version || '1.3' + return @avalara_version || '1.4' end def set_avalara_version(avalara_version) @@ -743,11 +743,11 @@ def set_x_avalara_client(x_avalara_client) end # Represents the Request object for the ListWebhookSubscriptions API # - # @param String $avalara_version The version of the API to use, e.g., \"1.3\". (required) + # @param String $avalara_version The version of the API to use, e.g., \"1.4\". (required) # @param String $x_correlation_id A unique identifier for tracking the request and its response (optional) # @param String $x_avalara_client Client application identification (optional) - # @param Float $top The number of items to include in the result. (optional) - # @param Float $skip The number of items to skip in the result. (optional) + # @param Integer $top The number of items to include in the result. (optional) + # @param Integer $skip The number of items to skip in the result. (optional) # @param Boolean $count Whether to include the total count of records in the result. (optional) # @param Boolean $count_only Whether to return only the count of records, without the list of records. (optional) # @@ -770,7 +770,7 @@ def initialize() end def get_avalara_version() - return @avalara_version || '1.3' + return @avalara_version || '1.4' end def set_avalara_version(avalara_version) diff --git a/lib/avalara_sdk/api/EInvoicing/V1/tax_identifiers_api.rb b/lib/avalara_sdk/api/EInvoicing/V1/tax_identifiers_api.rb new file mode 100644 index 0000000..d0b1e09 --- /dev/null +++ b/lib/avalara_sdk/api/EInvoicing/V1/tax_identifiers_api.rb @@ -0,0 +1,531 @@ +=begin +#Avalara E-Invoicing API + +#An API that supports sending data for an E-Invoicing compliance use-case. + + +=end + +require 'cgi' + +module AvalaraSdk::EInvoicing + module AvalaraSdk::EInvoicing::V1 + class TaxIdentifiersApi + attr_accessor :api_client + + def initialize(api_client) + if (api_client.nil?) + fail ArgumentError,'api_client is nil' + end + api_client.set_sdk_version("25.8.0") + @api_client = api_client + end + + # JSON MIME examples: + # application/json + # application/json; charset=UTF8 + # APPLICATION/JSON + # */* + # @param [String] mime MIME + # @return [Boolean] True if the MIME is application/json + def json_mime?(mime) + (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? + end + + # Deserialize the response to the given return type. + # + # @param [Response] response HTTP response + # @param [String] return_type some examples: "User", "Array", "Hash" + def deserialize(response, return_type) + body = response.body + + # handle file downloading - return the File instance processed in request callbacks + # note that response body is empty when the file is written in chunks in request on_body callback + if return_type == 'File' + content_disposition = response.headers['Content-Disposition'] + if content_disposition && content_disposition =~ /filename=/i + filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] + prefix = sanitize_filename(filename) + else + prefix = 'download-' + end + prefix = prefix + '-' unless prefix.end_with?('-') + encoding = body.encoding + @tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) + @tempfile.write(@stream.join.force_encoding(encoding)) + @tempfile.close + @config.logger.info "Temp file written to #{@tempfile.path}, please copy the file to a proper folder "\ + "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ + "will be deleted automatically with GC. It's also recommended to delete the temp file "\ + "explicitly with `tempfile.delete`" + return @tempfile + end + + return nil if body.nil? || body.empty? + + # return response body directly for String return type + return body if return_type == 'String' + + # ensuring a default content type + content_type = response.headers['Content-Type'] || 'application/json' + + fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) + + begin + data = JSON.parse("[#{body}]", :symbolize_names => true)[0] + rescue JSON::ParserError => e + if %w(String Date Time).include?(return_type) + data = body + else + raise e + end + end + + convert_to_type data, return_type + end + + # Convert data to the given return type. + # @param [Object] data Data to be converted + # @param [String] return_type Return type + # @return [Mixed] Data in a particular type + def convert_to_type(data, return_type) + return nil if data.nil? + case return_type + when 'String' + data.to_s + when 'Integer' + data.to_i + when 'Float' + data.to_f + when 'Boolean' + data == true + when 'Time' + # parse date time (expecting ISO 8601 format) + Time.parse data + when 'Date' + # parse date time (expecting ISO 8601 format) + Date.parse data + when 'Object' + # generic object (usually a Hash), return directly + data + when /\AArray<(.+)>\z/ + # e.g. Array + sub_type = $1 + data.map { |item| convert_to_type(item, sub_type) } + when /\AHash\\z/ + # e.g. Hash + sub_type = $1 + {}.tap do |hash| + data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } + end + else + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::EInvoicing::V1.const_get(return_type) + klass.respond_to?(:openapi_one_of) ? klass.build(data) : klass.build_from_hash(data) + end + end + + # Sanitize filename by removing path. + # e.g. ../../sun.gif becomes sun.gif + # + # @param [String] filename the filename to be sanitized + # @return [String] the sanitized filename + def sanitize_filename(filename) + filename.gsub(/.*[\/\\]/, '') + end + + # Update header and query params based on authentication settings. + # + # @param [Hash] header_params Header parameters + # @param [Hash] query_params Query parameters + # @param [String] auth_names Authentication scheme name + def update_params_for_auth!(header_params, query_params, auth_names) + Array(auth_names).each do |auth_name| + auth_setting = @config.auth_settings[auth_name] + next unless auth_setting + case auth_setting[:in] + when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] + when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] + else fail ArgumentError, 'Authentication token must be in `query` or `header`' + end + end + end + + # Sets user agent in HTTP header + # + # @param [String] user_agent User agent (e.g. openapi-generator/ruby/1.0.0) + def user_agent=(user_agent) + @user_agent = user_agent + @default_headers['User-Agent'] = @user_agent + end + + # Return Accept header based on an array of accepts provided. + # @param [Array] accepts array for Accept + # @return [String] the Accept header (e.g. application/json) + def select_header_accept(accepts) + return nil if accepts.nil? || accepts.empty? + # use JSON when present, otherwise use all of the provided + json_accept = accepts.find { |s| json_mime?(s) } + json_accept || accepts.join(',') + end + + # Return Content-Type header based on an array of content types provided. + # @param [Array] content_types array for Content-Type + # @return [String] the Content-Type header (e.g. application/json) + def select_header_content_type(content_types) + # return nil by default + return if content_types.nil? || content_types.empty? + # use JSON when present, otherwise use the first one + json_content_type = content_types.find { |s| json_mime?(s) } + json_content_type || content_types.first + end + + # Convert object (array, hash, object, etc) to JSON string. + # @param [Object] model object to be converted into JSON string + # @return [String] JSON string representation of the object + def object_to_http_body(model) + return model if model.nil? || model.is_a?(String) + local_body = nil + if model.is_a?(Array) + local_body = model.map { |m| object_to_hash(m) } + else + local_body = object_to_hash(model) + end + local_body.to_json + end + + # Convert object(non-array) to hash. + # @param [Object] obj object to be converted into JSON string + # @return [String] JSON string representation of the object + def object_to_hash(obj) + if obj.respond_to?(:to_hash) + obj.to_hash + else + obj + end + end + + # Build parameter value according to the given collection format. + # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi + def build_collection_param(param, collection_format) + case collection_format + when :csv + param.join(',') + when :ssv + param.join(' ') + when :tsv + param.join("\t") + when :pipes + param.join('|') + when :multi + # return the array directly as typhoeus will handle it as expected + param + else + fail "unknown collection format: #{collection_format.inspect}" + end + end + + # Returns the tax identifier request & response schema for a specific country. + # This endpoint retrieves the request and response schema required to validate tax identifiers based on a specific country's requirements. This can include both standard fields and any additional parameters required by the respective country's tax authority. + # @param avalara_version [String] The HTTP Header meant to specify the version of the API intended to be used. # @param country_code [String] The two-letter ISO-3166 country code for which the schema should be retrieved. # @param x_avalara_client [String] You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". # @param x_correlation_id [String] The caller can use this as an identifier to use as a correlation id to trace the call. # @param type [String] Specifies whether to return the request or response schema. + # @return [TaxIdentifierSchemaByCountry200Response] + def tax_identifier_schema_by_country(request_parameters) + data, _status_code, _headers = tax_identifier_schema_by_country_with_http_info(request_parameters) + data + end + + # Returns the tax identifier request & response schema for a specific country. + # This endpoint retrieves the request and response schema required to validate tax identifiers based on a specific country's requirements. This can include both standard fields and any additional parameters required by the respective country's tax authority. + + # @param avalara_version [String] The HTTP Header meant to specify the version of the API intended to be used. + # @param country_code [String] The two-letter ISO-3166 country code for which the schema should be retrieved. + # @param x_avalara_client [String] You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". + # @param x_correlation_id [String] The caller can use this as an identifier to use as a correlation id to trace the call. + # @param type [String] Specifies whether to return the request or response schema. + # @return [Array<(TaxIdentifierSchemaByCountry200Response, Integer, Hash)>] TaxIdentifierSchemaByCountry200Response data, response status code and response headers + def tax_identifier_schema_by_country_with_http_info(request_parameters) + # OAuth2 Scopes + required_scopes = '' + # Request Parameters + avalara_version = request_parameters.get_avalara_version() + country_code = request_parameters.get_country_code() + x_avalara_client = request_parameters.get_x_avalara_client() + x_correlation_id = request_parameters.get_x_correlation_id() + type = request_parameters.get_type() + # verify the required parameter 'avalara_version' is set + if @api_client.config.client_side_validation && avalara_version.nil? + fail ArgumentError, "Missing the required parameter 'avalara_version' when calling TaxIdentifiersApi.tax_identifier_schema_by_country" + end + # verify the required parameter 'country_code' is set + if @api_client.config.client_side_validation && country_code.nil? + fail ArgumentError, "Missing the required parameter 'country_code' when calling TaxIdentifiersApi.tax_identifier_schema_by_country" + end + allowable_values = ["request", "response"] + if @api_client.config.client_side_validation && type && !allowable_values.include?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{allowable_values}" + end + # resource path + local_var_path = '/einvoicing/tax-identifiers/schema' + + # query parameters + query_params = {} + if !country_code.nil? + query_params[:'countryCode'] = country_code + end + if !type.nil? + query_params[:'type'] = type + end + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + if !avalara_version.nil? + header_params[:'avalara-version'] = avalara_version + end + if !x_avalara_client.nil? + header_params[:'X-Avalara-Client'] = x_avalara_client + end + if !x_correlation_id.nil? + header_params[:'X-Correlation-ID'] = x_correlation_id + end + + # form parameters + form_params = {} + + # http body (model) + post_body = {} + + # return_type + return_type = 'TaxIdentifierSchemaByCountry200Response' + + # auth_names + auth_names = ['Bearer'] + + @api_client.apply_auth_to_request!(header_params, auth_names, required_scopes) + + new_options = { + :operation => :"TaxIdentifiersApi.tax_identifier_schema_by_country", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + } + + response = @api_client.call_api(:GET, local_var_path, new_options, required_scopes, false, :EInvoicing) + if new_options[:return_type] + data = deserialize(response, new_options[:return_type]) + else + data = nil + end + return data, response.code, response.headers + end + + # Validates a tax identifier. + # This endpoint verifies whether a given tax identifier is valid and properly formatted according to the rules of the applicable country or tax system. + # @param avalara_version [String] The HTTP Header meant to specify the version of the API intended to be used. # @param tax_identifier_request [TaxIdentifierRequest] # @param x_avalara_client [String] You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". # @param x_correlation_id [String] The caller can use this as an identifier to use as a correlation id to trace the call. + # @return [TaxIdentifierResponse] + def validate_tax_identifier(request_parameters) + data, _status_code, _headers = validate_tax_identifier_with_http_info(request_parameters) + data + end + + # Validates a tax identifier. + # This endpoint verifies whether a given tax identifier is valid and properly formatted according to the rules of the applicable country or tax system. + + # @param avalara_version [String] The HTTP Header meant to specify the version of the API intended to be used. + # @param tax_identifier_request [TaxIdentifierRequest] + # @param x_avalara_client [String] You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". + # @param x_correlation_id [String] The caller can use this as an identifier to use as a correlation id to trace the call. + # @return [Array<(TaxIdentifierResponse, Integer, Hash)>] TaxIdentifierResponse data, response status code and response headers + def validate_tax_identifier_with_http_info(request_parameters) + # OAuth2 Scopes + required_scopes = '' + # Request Parameters + avalara_version = request_parameters.get_avalara_version() + tax_identifier_request = request_parameters.get_tax_identifier_request() + x_avalara_client = request_parameters.get_x_avalara_client() + x_correlation_id = request_parameters.get_x_correlation_id() + # verify the required parameter 'avalara_version' is set + if @api_client.config.client_side_validation && avalara_version.nil? + fail ArgumentError, "Missing the required parameter 'avalara_version' when calling TaxIdentifiersApi.validate_tax_identifier" + end + # verify the required parameter 'tax_identifier_request' is set + if @api_client.config.client_side_validation && tax_identifier_request.nil? + fail ArgumentError, "Missing the required parameter 'tax_identifier_request' when calling TaxIdentifiersApi.validate_tax_identifier" + end + # resource path + local_var_path = '/einvoicing/tax-identifiers/validate' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + if !avalara_version.nil? + header_params[:'avalara-version'] = avalara_version + end + if !x_avalara_client.nil? + header_params[:'X-Avalara-Client'] = x_avalara_client + end + if !x_correlation_id.nil? + header_params[:'X-Correlation-ID'] = x_correlation_id + end + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(tax_identifier_request) || {} + + # return_type + return_type = 'TaxIdentifierResponse' + + # auth_names + auth_names = ['Bearer'] + + @api_client.apply_auth_to_request!(header_params, auth_names, required_scopes) + + new_options = { + :operation => :"TaxIdentifiersApi.validate_tax_identifier", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + } + + response = @api_client.call_api(:POST, local_var_path, new_options, required_scopes, false, :EInvoicing) + if new_options[:return_type] + data = deserialize(response, new_options[:return_type]) + else + data = nil + end + return data, response.code, response.headers + end + end + # Represents the Request object for the TaxIdentifierSchemaByCountry API + # + # @param String $avalara_version The HTTP Header meant to specify the version of the API intended to be used. (required) + # @param String $country_code The two-letter ISO-3166 country code for which the schema should be retrieved. (required) + # @param String $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". (optional) + # @param String $x_correlation_id The caller can use this as an identifier to use as a correlation id to trace the call. (optional) + # @param String $type Specifies whether to return the request or response schema. (optional) + # + class TaxIdentifierSchemaByCountryRequestSdk + attr_accessor :avalara_version + + attr_accessor :country_code + + attr_accessor :x_avalara_client + + attr_accessor :x_correlation_id + + attr_accessor :type + + def initialize() + end + + def get_avalara_version() + return @avalara_version || '1.4' + end + + def set_avalara_version(avalara_version) + @avalara_version = avalara_version + end + + def get_country_code() + return @country_code + end + + def set_country_code(country_code) + @country_code = country_code + end + + def get_x_avalara_client() + return @x_avalara_client + end + + def set_x_avalara_client(x_avalara_client) + @x_avalara_client = x_avalara_client + end + + def get_x_correlation_id() + return @x_correlation_id + end + + def set_x_correlation_id(x_correlation_id) + @x_correlation_id = x_correlation_id + end + + def get_type() + return @type + end + + def set_type(type) + @type = type + end + end + # Represents the Request object for the ValidateTaxIdentifier API + # + # @param String $avalara_version The HTTP Header meant to specify the version of the API intended to be used. (required) + # @param TaxIdentifierRequest $tax_identifier_request tax_identifier_request (required) + # @param String $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". (optional) + # @param String $x_correlation_id The caller can use this as an identifier to use as a correlation id to trace the call. (optional) + # + class ValidateTaxIdentifierRequestSdk + attr_accessor :avalara_version + + attr_accessor :tax_identifier_request + + attr_accessor :x_avalara_client + + attr_accessor :x_correlation_id + + def initialize() + end + + def get_avalara_version() + return @avalara_version || '1.4' + end + + def set_avalara_version(avalara_version) + @avalara_version = avalara_version + end + + def get_tax_identifier_request() + return @tax_identifier_request + end + + def set_tax_identifier_request(tax_identifier_request) + @tax_identifier_request = tax_identifier_request + end + + def get_x_avalara_client() + return @x_avalara_client + end + + def set_x_avalara_client(x_avalara_client) + @x_avalara_client = x_avalara_client + end + + def get_x_correlation_id() + return @x_correlation_id + end + + def set_x_correlation_id(x_correlation_id) + @x_correlation_id = x_correlation_id + end + end + end +end \ No newline at end of file diff --git a/lib/avalara_sdk/api/EInvoicing/V1/trading_partners_api.rb b/lib/avalara_sdk/api/EInvoicing/V1/trading_partners_api.rb index 2429e90..1753a12 100644 --- a/lib/avalara_sdk/api/EInvoicing/V1/trading_partners_api.rb +++ b/lib/avalara_sdk/api/EInvoicing/V1/trading_partners_api.rb @@ -17,7 +17,7 @@ def initialize(api_client) if (api_client.nil?) fail ArgumentError,'api_client is nil' end - api_client.set_sdk_version("25.7.2") + api_client.set_sdk_version("25.8.0") @api_client = api_client end @@ -225,23 +225,23 @@ def build_collection_param(param, collection_format) end end - # Creates a batch search and performs a batch search in the directory for participants in the background. # Handles batch search requests by uploading a file containing search parameters. - # @param avalara_version [String] The HTTP Header meant to specify the version of the API intended to be used # @param name [String] The human readable name given to this batch search. # @param notification_email [String] The email address of the user to whom the batch search completion notification must go to. # @param file [File] CSV file containing search parameters. # @param x_avalara_client [String] You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" # @param x_correlation_id [String] The caller can use this as an identifier to use as a correlation id to trace the call. + # This endpoint creates a batch search and performs a batch search in the directory for participants in the background. + # @param avalara_version [String] The HTTP Header meant to specify the version of the API intended to be used. # @param name [String] A <b>human-readable</b> name for the batch search. # @param notification_email [String] The email address to which a notification will be sent once the batch search is complete. # @param file [File] CSV file containing search parameters. Input Constraints: - Maximum file size: 1 MB - File Header: Must be less than 500 KB - Total number of lines (including header): Must be 101 or fewer # @param x_avalara_client [String] You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". # @param x_correlation_id [String] The caller can use this as an identifier to use as a correlation id to trace the call. # @return [BatchSearchParticipants202Response] def batch_search_participants(request_parameters) data, _status_code, _headers = batch_search_participants_with_http_info(request_parameters) data end - # Creates a batch search and performs a batch search in the directory for participants in the background. # Handles batch search requests by uploading a file containing search parameters. + # This endpoint creates a batch search and performs a batch search in the directory for participants in the background. - # @param avalara_version [String] The HTTP Header meant to specify the version of the API intended to be used - # @param name [String] The human readable name given to this batch search. - # @param notification_email [String] The email address of the user to whom the batch search completion notification must go to. - # @param file [File] CSV file containing search parameters. - # @param x_avalara_client [String] You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" + # @param avalara_version [String] The HTTP Header meant to specify the version of the API intended to be used. + # @param name [String] A <b>human-readable</b> name for the batch search. + # @param notification_email [String] The email address to which a notification will be sent once the batch search is complete. + # @param file [File] CSV file containing search parameters. Input Constraints: - Maximum file size: 1 MB - File Header: Must be less than 500 KB - Total number of lines (including header): Must be 101 or fewer + # @param x_avalara_client [String] You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". # @param x_correlation_id [String] The caller can use this as an identifier to use as a correlation id to trace the call. # @return [Array<(BatchSearchParticipants202Response, Integer, Hash)>] BatchSearchParticipants202Response data, response status code and response headers def batch_search_participants_with_http_info(request_parameters) @@ -337,21 +337,289 @@ def batch_search_participants_with_http_info(request_parameters) return data, response.code, response.headers end - # Download batch search results in a csv file. - # Downloads the report for a specific batch search using the batch search ID. - # @param avalara_version [String] The HTTP Header meant to specify the version of the API intended to be used # @param id [String] The ID of the batch search whose report is to be downloaded. # @param x_avalara_client [String] You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" # @param x_correlation_id [String] The caller can use this as an identifier to use as a correlation id to trace the call. + # Creates a new trading partner. + # This endpoint creates a new trading partner with the provided details. The request body must include the necessary information as defined in the `TradingPartner` schema. + # @param avalara_version [String] The HTTP Header meant to specify the version of the API intended to be used. # @param trading_partner [TradingPartner] # @param x_avalara_client [String] You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". # @param x_correlation_id [String] The caller can use this as an identifier to use as a correlation id to trace the call. + # @return [CreateTradingPartner201Response] + def create_trading_partner(request_parameters) + data, _status_code, _headers = create_trading_partner_with_http_info(request_parameters) + data + end + + # Creates a new trading partner. + # This endpoint creates a new trading partner with the provided details. The request body must include the necessary information as defined in the `TradingPartner` schema. + + # @param avalara_version [String] The HTTP Header meant to specify the version of the API intended to be used. + # @param trading_partner [TradingPartner] + # @param x_avalara_client [String] You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". + # @param x_correlation_id [String] The caller can use this as an identifier to use as a correlation id to trace the call. + # @return [Array<(CreateTradingPartner201Response, Integer, Hash)>] CreateTradingPartner201Response data, response status code and response headers + def create_trading_partner_with_http_info(request_parameters) + # OAuth2 Scopes + required_scopes = '' + # Request Parameters + avalara_version = request_parameters.get_avalara_version() + trading_partner = request_parameters.get_trading_partner() + x_avalara_client = request_parameters.get_x_avalara_client() + x_correlation_id = request_parameters.get_x_correlation_id() + # verify the required parameter 'avalara_version' is set + if @api_client.config.client_side_validation && avalara_version.nil? + fail ArgumentError, "Missing the required parameter 'avalara_version' when calling TradingPartnersApi.create_trading_partner" + end + # verify the required parameter 'trading_partner' is set + if @api_client.config.client_side_validation && trading_partner.nil? + fail ArgumentError, "Missing the required parameter 'trading_partner' when calling TradingPartnersApi.create_trading_partner" + end + # resource path + local_var_path = '/einvoicing/trading-partners' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + if !avalara_version.nil? + header_params[:'avalara-version'] = avalara_version + end + if !x_avalara_client.nil? + header_params[:'X-Avalara-Client'] = x_avalara_client + end + if !x_correlation_id.nil? + header_params[:'X-Correlation-ID'] = x_correlation_id + end + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(trading_partner) || {} + + # return_type + return_type = 'CreateTradingPartner201Response' + + # auth_names + auth_names = ['Bearer'] + + @api_client.apply_auth_to_request!(header_params, auth_names, required_scopes) + + new_options = { + :operation => :"TradingPartnersApi.create_trading_partner", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + } + + response = @api_client.call_api(:POST, local_var_path, new_options, required_scopes, false, :EInvoicing) + if new_options[:return_type] + data = deserialize(response, new_options[:return_type]) + else + data = nil + end + return data, response.code, response.headers + end + + # Creates a batch of multiple trading partners. + # This endpoint creates multiple trading partners in a single batch request. It accepts an array of trading partners and processes them synchronously. Supports a maximum of 100 records or 1 MB request payload. The batch is processed atomically and partial success is not allowed. + # @param avalara_version [String] The HTTP Header meant to specify the version of the API intended to be used. # @param create_trading_partners_batch_request [CreateTradingPartnersBatchRequest] # @param x_avalara_client [String] You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". # @param x_correlation_id [String] The caller can use this as an identifier to use as a correlation id to trace the call. + # @return [CreateTradingPartnersBatch200Response] + def create_trading_partners_batch(request_parameters) + data, _status_code, _headers = create_trading_partners_batch_with_http_info(request_parameters) + data + end + + # Creates a batch of multiple trading partners. + # This endpoint creates multiple trading partners in a single batch request. It accepts an array of trading partners and processes them synchronously. Supports a maximum of 100 records or 1 MB request payload. The batch is processed atomically and partial success is not allowed. + + # @param avalara_version [String] The HTTP Header meant to specify the version of the API intended to be used. + # @param create_trading_partners_batch_request [CreateTradingPartnersBatchRequest] + # @param x_avalara_client [String] You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". + # @param x_correlation_id [String] The caller can use this as an identifier to use as a correlation id to trace the call. + # @return [Array<(CreateTradingPartnersBatch200Response, Integer, Hash)>] CreateTradingPartnersBatch200Response data, response status code and response headers + def create_trading_partners_batch_with_http_info(request_parameters) + # OAuth2 Scopes + required_scopes = '' + # Request Parameters + avalara_version = request_parameters.get_avalara_version() + create_trading_partners_batch_request = request_parameters.get_create_trading_partners_batch_request() + x_avalara_client = request_parameters.get_x_avalara_client() + x_correlation_id = request_parameters.get_x_correlation_id() + # verify the required parameter 'avalara_version' is set + if @api_client.config.client_side_validation && avalara_version.nil? + fail ArgumentError, "Missing the required parameter 'avalara_version' when calling TradingPartnersApi.create_trading_partners_batch" + end + # verify the required parameter 'create_trading_partners_batch_request' is set + if @api_client.config.client_side_validation && create_trading_partners_batch_request.nil? + fail ArgumentError, "Missing the required parameter 'create_trading_partners_batch_request' when calling TradingPartnersApi.create_trading_partners_batch" + end + # resource path + local_var_path = '/einvoicing/trading-partners/batch' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + if !avalara_version.nil? + header_params[:'avalara-version'] = avalara_version + end + if !x_avalara_client.nil? + header_params[:'X-Avalara-Client'] = x_avalara_client + end + if !x_correlation_id.nil? + header_params[:'X-Correlation-ID'] = x_correlation_id + end + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(create_trading_partners_batch_request) || {} + + # return_type + return_type = 'CreateTradingPartnersBatch200Response' + + # auth_names + auth_names = ['Bearer'] + + @api_client.apply_auth_to_request!(header_params, auth_names, required_scopes) + + new_options = { + :operation => :"TradingPartnersApi.create_trading_partners_batch", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + } + + response = @api_client.call_api(:POST, local_var_path, new_options, required_scopes, false, :EInvoicing) + if new_options[:return_type] + data = deserialize(response, new_options[:return_type]) + else + data = nil + end + return data, response.code, response.headers + end + + # Deletes a trading partner using ID. + # This endpoint deletes an existing trading partner identified by the provided ID. + # @param avalara_version [String] The HTTP Header meant to specify the version of the API intended to be used. # @param id [String] The ID of the trading partner which is being deleted. # @param x_avalara_client [String] You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". # @param x_correlation_id [String] The caller can use this as an identifier to use as a correlation id to trace the call. + # @return [nil] + def delete_trading_partner(request_parameters) + delete_trading_partner_with_http_info(request_parameters) + nil + end + + # Deletes a trading partner using ID. + # This endpoint deletes an existing trading partner identified by the provided ID. + + # @param avalara_version [String] The HTTP Header meant to specify the version of the API intended to be used. + # @param id [String] The ID of the trading partner which is being deleted. + # @param x_avalara_client [String] You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". + # @param x_correlation_id [String] The caller can use this as an identifier to use as a correlation id to trace the call. + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_trading_partner_with_http_info(request_parameters) + # OAuth2 Scopes + required_scopes = '' + # Request Parameters + avalara_version = request_parameters.get_avalara_version() + id = request_parameters.get_id() + x_avalara_client = request_parameters.get_x_avalara_client() + x_correlation_id = request_parameters.get_x_correlation_id() + # verify the required parameter 'avalara_version' is set + if @api_client.config.client_side_validation && avalara_version.nil? + fail ArgumentError, "Missing the required parameter 'avalara_version' when calling TradingPartnersApi.delete_trading_partner" + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling TradingPartnersApi.delete_trading_partner" + end + # resource path + local_var_path = '/einvoicing/trading-partners/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + if !avalara_version.nil? + header_params[:'avalara-version'] = avalara_version + end + if !x_avalara_client.nil? + header_params[:'X-Avalara-Client'] = x_avalara_client + end + if !x_correlation_id.nil? + header_params[:'X-Correlation-ID'] = x_correlation_id + end + + # form parameters + form_params = {} + + # http body (model) + post_body = {} + + # return_type + return_type = '' + + # auth_names + auth_names = ['Bearer'] + + @api_client.apply_auth_to_request!(header_params, auth_names, required_scopes) + + new_options = { + :operation => :"TradingPartnersApi.delete_trading_partner", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + } + + response = @api_client.call_api(:DELETE, local_var_path, new_options, required_scopes, false, :EInvoicing) + if new_options[:return_type] + data = deserialize(response, new_options[:return_type]) + else + data = nil + end + return data, response.code, response.headers + end + + # Downloads batch search results in a csv file. + # This endpoint downloads the report for a specific batch search using the batch search ID. It returns a CSV file containing up to 1,000 query results. + # @param avalara_version [String] The HTTP Header meant to specify the version of the API intended to be used. # @param id [String] The ID of the batch search for which the report should be downloaded. # @param x_avalara_client [String] You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". # @param x_correlation_id [String] The caller can use this as an identifier to use as a correlation id to trace the call. # @return [File] def download_batch_search_report(request_parameters) data, _status_code, _headers = download_batch_search_report_with_http_info(request_parameters) data end - # Download batch search results in a csv file. - # Downloads the report for a specific batch search using the batch search ID. + # Downloads batch search results in a csv file. + # This endpoint downloads the report for a specific batch search using the batch search ID. It returns a CSV file containing up to 1,000 query results. - # @param avalara_version [String] The HTTP Header meant to specify the version of the API intended to be used - # @param id [String] The ID of the batch search whose report is to be downloaded. - # @param x_avalara_client [String] You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" + # @param avalara_version [String] The HTTP Header meant to specify the version of the API intended to be used. + # @param id [String] The ID of the batch search for which the report should be downloaded. + # @param x_avalara_client [String] You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". # @param x_correlation_id [String] The caller can use this as an identifier to use as a correlation id to trace the call. # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers def download_batch_search_report_with_http_info(request_parameters) @@ -423,21 +691,21 @@ def download_batch_search_report_with_http_info(request_parameters) return data, response.code, response.headers end - # Get the batch search details for a given id. - # This endpoint provides a detailed information for a specific batch search based on a given ID. It is ideal for tracking the progress of a previously initiated batch search operation. - # @param avalara_version [String] The HTTP Header meant to specify the version of the API intended to be used # @param id [String] The ID of the batch search that was submitted earlier. # @param x_avalara_client [String] You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" # @param x_correlation_id [String] The caller can use this as an identifier to use as a correlation id to trace the call. + # Returns the batch search details using ID. + # This endpoint returns detailed information for a specific batch search using the provided ID. It is useful for tracking the status and progress of a previously initiated batch search operation. + # @param avalara_version [String] The HTTP Header meant to specify the version of the API intended to be used. # @param id [String] The ID of the batch search that was submitted earlier. # @param x_avalara_client [String] You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". # @param x_correlation_id [String] The caller can use this as an identifier to use as a correlation id to trace the call. # @return [BatchSearch] def get_batch_search_detail(request_parameters) data, _status_code, _headers = get_batch_search_detail_with_http_info(request_parameters) data end - # Get the batch search details for a given id. - # This endpoint provides a detailed information for a specific batch search based on a given ID. It is ideal for tracking the progress of a previously initiated batch search operation. + # Returns the batch search details using ID. + # This endpoint returns detailed information for a specific batch search using the provided ID. It is useful for tracking the status and progress of a previously initiated batch search operation. - # @param avalara_version [String] The HTTP Header meant to specify the version of the API intended to be used + # @param avalara_version [String] The HTTP Header meant to specify the version of the API intended to be used. # @param id [String] The ID of the batch search that was submitted earlier. - # @param x_avalara_client [String] You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" + # @param x_avalara_client [String] You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". # @param x_correlation_id [String] The caller can use this as an identifier to use as a correlation id to trace the call. # @return [Array<(BatchSearch, Integer, Hash)>] BatchSearch data, response status code and response headers def get_batch_search_detail_with_http_info(request_parameters) @@ -509,25 +777,25 @@ def get_batch_search_detail_with_http_info(request_parameters) return data, response.code, response.headers end - # List all batch searches that were previously submitted. - # This endpoint provides a way to retrieve a comprehensive list of all batch search operations that have been previously submitted. This endpoint returns details about each batch search, such as their id, status, created date and associated metadata, allowing users to easily view past batch search requests. It's particularly useful for tracking the progress of a previously initiated batch search operations. - # @param avalara_version [String] The HTTP Header meant to specify the version of the API intended to be used # @param x_avalara_client [String] You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" # @param filter [String] Filter by field name and value. This filter only supports <code>eq</code> .The parameters supported is <code>name</code>. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. Filtering will be done over the provided parameters. # @param count [Boolean] When set to true, the count of the collection is included as @recordSetCount in the response body. # @param top [Float] The number of items to include in the result. # @param skip [String] If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. # @param order_by [String] The $orderBy query parameter specifies the field and sorting direction for ordering the result set. The value is a string that combines a field name and a sorting direction (asc for ascending or desc for descending), separated by a space. # @param x_correlation_id [String] The caller can use this as an identifier to use as a correlation id to trace the call. + # Lists all batch searches that were previously submitted. + # This endpoint retrieves a list of all batch search operations that have been previously submitted. It returns details such as the batch search ID, status, creation date, and associated metadata. It is useful for tracking the progress of a previously initiated batch search operations. + # @param avalara_version [String] The HTTP Header meant to specify the version of the API intended to be used. # @param x_avalara_client [String] You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". # @param filter [String] Filters the results by field name. Only the <code>eq</code> operator and the name field is supported. For more information, refer to [AvaTax filtering guide](https://developer.avalara.com/avatax/filtering-in-rest/). # @param count [Boolean] When set to <code>true</code>, returns the total count of matching records included as <code>@recordSetCount</code> in the response body. # @param top [Integer] The number of items to include in the result. # @param skip [Integer] The number of items to skip in the result. # @param order_by [String] The <code>$orderBy</code> query parameter specifies the field and sorting direction for ordering the result set. The value is a string that combines a field name and a sorting direction (asc for ascending or desc for descending), separated by a space. # @param x_correlation_id [String] The caller can use this as an identifier to use as a correlation id to trace the call. # @return [BatchSearchListResponse] def list_batch_searches(request_parameters) data, _status_code, _headers = list_batch_searches_with_http_info(request_parameters) data end - # List all batch searches that were previously submitted. - # This endpoint provides a way to retrieve a comprehensive list of all batch search operations that have been previously submitted. This endpoint returns details about each batch search, such as their id, status, created date and associated metadata, allowing users to easily view past batch search requests. It's particularly useful for tracking the progress of a previously initiated batch search operations. + # Lists all batch searches that were previously submitted. + # This endpoint retrieves a list of all batch search operations that have been previously submitted. It returns details such as the batch search ID, status, creation date, and associated metadata. It is useful for tracking the progress of a previously initiated batch search operations. - # @param avalara_version [String] The HTTP Header meant to specify the version of the API intended to be used - # @param x_avalara_client [String] You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" - # @param filter [String] Filter by field name and value. This filter only supports <code>eq</code> .The parameters supported is <code>name</code>. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. Filtering will be done over the provided parameters. - # @param count [Boolean] When set to true, the count of the collection is included as @recordSetCount in the response body. - # @param top [Float] The number of items to include in the result. - # @param skip [String] If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. - # @param order_by [String] The $orderBy query parameter specifies the field and sorting direction for ordering the result set. The value is a string that combines a field name and a sorting direction (asc for ascending or desc for descending), separated by a space. + # @param avalara_version [String] The HTTP Header meant to specify the version of the API intended to be used. + # @param x_avalara_client [String] You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". + # @param filter [String] Filters the results by field name. Only the <code>eq</code> operator and the name field is supported. For more information, refer to [AvaTax filtering guide](https://developer.avalara.com/avatax/filtering-in-rest/). + # @param count [Boolean] When set to <code>true</code>, returns the total count of matching records included as <code>@recordSetCount</code> in the response body. + # @param top [Integer] The number of items to include in the result. + # @param skip [Integer] The number of items to skip in the result. + # @param order_by [String] The <code>$orderBy</code> query parameter specifies the field and sorting direction for ordering the result set. The value is a string that combines a field name and a sorting direction (asc for ascending or desc for descending), separated by a space. # @param x_correlation_id [String] The caller can use this as an identifier to use as a correlation id to trace the call. # @return [Array<(BatchSearchListResponse, Integer, Hash)>] BatchSearchListResponse data, response status code and response headers def list_batch_searches_with_http_info(request_parameters) @@ -615,27 +883,27 @@ def list_batch_searches_with_http_info(request_parameters) end # Returns a list of participants matching the input query. - # This endpoint provides a list of trading partners that match a specified input query. The search is performed based on various filters, search text, and other relevant parameters. - # @param avalara_version [String] The HTTP Header meant to specify the version of the API intended to be used # @param search [String] Search by value supports logical AND and OR. Refer to [https://learn.microsoft.com/en-us/odata/concepts/queryoptions-overview#search](https://learn.microsoft.com/en-us/odata/concepts/queryoptions-overview#search) for more information on search. Search will be done over <code>name</code> and <code>identifier</code> parameters only. # @param x_avalara_client [String] You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" # @param count [Boolean] When set to true, the count of the collection is included as @recordSetCount in the response body. # @param filter [String] Filter by field name and value. This filter only supports <code>eq</code> .The parameters supported are <code>network</code>, <code>country</code>, <code>documentType</code>, <code>idType</code>. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. Filtering will be done over the provided parameters. # @param top [Float] The number of items to include in the result. # @param skip [String] If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. # @param order_by [String] The $orderBy query parameter specifies the field and sorting direction for ordering the result set. The value is a string that combines a field name and a sorting direction (asc for ascending or desc for descending), separated by a space. # @param x_correlation_id [String] The caller can use this as an identifier to use as a correlation id to trace the call. - # @return [DirectorySearchResponse] + # This endpoint retrieves a list of trading partners that match the specified search criteria. It supports filtering, search text, and other relevant query parameters to narrow down the results. + # @param avalara_version [String] The HTTP Header meant to specify the version of the API intended to be used. # @param search [String] Search by value supports logical <code>AND</code> / <code>OR</code> operators. Search is performed only over the name and identifier value fields. For more information, refer to [Query options overview - OData.](https://learn.microsoft.com/en-us/odata/concepts/queryoptions-overview#search). # @param x_avalara_client [String] You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". # @param count [Boolean] When set to <code>true</code>, returns the total count of matching records included as <code>@recordSetCount</code> in the response body. # @param filter [String] Filters the results using the <code>eq</code> operator. Supported fields: <code>network</code>, <code>country</code>, <code>documentType</code>, <code>idType</code>. For more information, refer to [AvaTax filtering guide](https://developer.avalara.com/avatax/filtering-in-rest/). # @param top [Integer] The number of items to include in the result. # @param skip [Integer] The number of items to skip in the result. # @param order_by [String] The <code>$orderBy</code> query parameter specifies the field and sorting direction for ordering the result set. The value is a string that combines a field name and a sorting direction (asc for ascending or desc for descending), separated by a space. # @param x_correlation_id [String] The caller can use this as an identifier to use as a correlation id to trace the call. + # @return [SearchParticipants200Response] def search_participants(request_parameters) data, _status_code, _headers = search_participants_with_http_info(request_parameters) data end # Returns a list of participants matching the input query. - # This endpoint provides a list of trading partners that match a specified input query. The search is performed based on various filters, search text, and other relevant parameters. + # This endpoint retrieves a list of trading partners that match the specified search criteria. It supports filtering, search text, and other relevant query parameters to narrow down the results. - # @param avalara_version [String] The HTTP Header meant to specify the version of the API intended to be used - # @param search [String] Search by value supports logical AND and OR. Refer to [https://learn.microsoft.com/en-us/odata/concepts/queryoptions-overview#search](https://learn.microsoft.com/en-us/odata/concepts/queryoptions-overview#search) for more information on search. Search will be done over <code>name</code> and <code>identifier</code> parameters only. - # @param x_avalara_client [String] You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" - # @param count [Boolean] When set to true, the count of the collection is included as @recordSetCount in the response body. - # @param filter [String] Filter by field name and value. This filter only supports <code>eq</code> .The parameters supported are <code>network</code>, <code>country</code>, <code>documentType</code>, <code>idType</code>. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. Filtering will be done over the provided parameters. - # @param top [Float] The number of items to include in the result. - # @param skip [String] If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. - # @param order_by [String] The $orderBy query parameter specifies the field and sorting direction for ordering the result set. The value is a string that combines a field name and a sorting direction (asc for ascending or desc for descending), separated by a space. + # @param avalara_version [String] The HTTP Header meant to specify the version of the API intended to be used. + # @param search [String] Search by value supports logical <code>AND</code> / <code>OR</code> operators. Search is performed only over the name and identifier value fields. For more information, refer to [Query options overview - OData.](https://learn.microsoft.com/en-us/odata/concepts/queryoptions-overview#search). + # @param x_avalara_client [String] You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". + # @param count [Boolean] When set to <code>true</code>, returns the total count of matching records included as <code>@recordSetCount</code> in the response body. + # @param filter [String] Filters the results using the <code>eq</code> operator. Supported fields: <code>network</code>, <code>country</code>, <code>documentType</code>, <code>idType</code>. For more information, refer to [AvaTax filtering guide](https://developer.avalara.com/avatax/filtering-in-rest/). + # @param top [Integer] The number of items to include in the result. + # @param skip [Integer] The number of items to skip in the result. + # @param order_by [String] The <code>$orderBy</code> query parameter specifies the field and sorting direction for ordering the result set. The value is a string that combines a field name and a sorting direction (asc for ascending or desc for descending), separated by a space. # @param x_correlation_id [String] The caller can use this as an identifier to use as a correlation id to trace the call. - # @return [Array<(DirectorySearchResponse, Integer, Hash)>] DirectorySearchResponse data, response status code and response headers + # @return [Array<(SearchParticipants200Response, Integer, Hash)>] SearchParticipants200Response data, response status code and response headers def search_participants_with_http_info(request_parameters) # OAuth2 Scopes required_scopes = '' @@ -702,7 +970,7 @@ def search_participants_with_http_info(request_parameters) post_body = {} # return_type - return_type = 'DirectorySearchResponse' + return_type = 'SearchParticipants200Response' # auth_names auth_names = ['Bearer'] @@ -727,14 +995,111 @@ def search_participants_with_http_info(request_parameters) end return data, response.code, response.headers end + + # Updates a trading partner using ID. + # This endpoint updates the details of an existing trading partner specified by the provided ID. It performs a full update, and the request body must include all required fields. + # @param avalara_version [String] The HTTP Header meant to specify the version of the API intended to be used. # @param id [String] The ID of the trading partner which is being updated. # @param trading_partner [TradingPartner] # @param x_avalara_client [String] You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". # @param x_correlation_id [String] The caller can use this as an identifier to use as a correlation id to trace the call. + # @return [UpdateTradingPartner200Response] + def update_trading_partner(request_parameters) + data, _status_code, _headers = update_trading_partner_with_http_info(request_parameters) + data + end + + # Updates a trading partner using ID. + # This endpoint updates the details of an existing trading partner specified by the provided ID. It performs a full update, and the request body must include all required fields. + + # @param avalara_version [String] The HTTP Header meant to specify the version of the API intended to be used. + # @param id [String] The ID of the trading partner which is being updated. + # @param trading_partner [TradingPartner] + # @param x_avalara_client [String] You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". + # @param x_correlation_id [String] The caller can use this as an identifier to use as a correlation id to trace the call. + # @return [Array<(UpdateTradingPartner200Response, Integer, Hash)>] UpdateTradingPartner200Response data, response status code and response headers + def update_trading_partner_with_http_info(request_parameters) + # OAuth2 Scopes + required_scopes = '' + # Request Parameters + avalara_version = request_parameters.get_avalara_version() + id = request_parameters.get_id() + trading_partner = request_parameters.get_trading_partner() + x_avalara_client = request_parameters.get_x_avalara_client() + x_correlation_id = request_parameters.get_x_correlation_id() + # verify the required parameter 'avalara_version' is set + if @api_client.config.client_side_validation && avalara_version.nil? + fail ArgumentError, "Missing the required parameter 'avalara_version' when calling TradingPartnersApi.update_trading_partner" + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling TradingPartnersApi.update_trading_partner" + end + # verify the required parameter 'trading_partner' is set + if @api_client.config.client_side_validation && trading_partner.nil? + fail ArgumentError, "Missing the required parameter 'trading_partner' when calling TradingPartnersApi.update_trading_partner" + end + # resource path + local_var_path = '/einvoicing/trading-partners/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + if !avalara_version.nil? + header_params[:'avalara-version'] = avalara_version + end + if !x_avalara_client.nil? + header_params[:'X-Avalara-Client'] = x_avalara_client + end + if !x_correlation_id.nil? + header_params[:'X-Correlation-ID'] = x_correlation_id + end + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(trading_partner) || {} + + # return_type + return_type = 'UpdateTradingPartner200Response' + + # auth_names + auth_names = ['Bearer'] + + @api_client.apply_auth_to_request!(header_params, auth_names, required_scopes) + + new_options = { + :operation => :"TradingPartnersApi.update_trading_partner", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + } + + response = @api_client.call_api(:PUT, local_var_path, new_options, required_scopes, false, :EInvoicing) + if new_options[:return_type] + data = deserialize(response, new_options[:return_type]) + else + data = nil + end + return data, response.code, response.headers + end end # Represents the Request object for the BatchSearchParticipants API # - # @param String $avalara_version The HTTP Header meant to specify the version of the API intended to be used (required) - # @param String $name The human readable name given to this batch search. (required) - # @param String $notification_email The email address of the user to whom the batch search completion notification must go to. (required) - # @param File $file CSV file containing search parameters. (required) - # @param String $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" (optional) + # @param String $avalara_version The HTTP Header meant to specify the version of the API intended to be used. (required) + # @param String $name A <b>human-readable</b> name for the batch search. (required) + # @param String $notification_email The email address to which a notification will be sent once the batch search is complete. (required) + # @param File $file CSV file containing search parameters. Input Constraints: - Maximum file size: 1 MB - File Header: Must be less than 500 KB - Total number of lines (including header): Must be 101 or fewer (required) + # @param String $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". (optional) # @param String $x_correlation_id The caller can use this as an identifier to use as a correlation id to trace the call. (optional) # class BatchSearchParticipantsRequestSdk @@ -754,7 +1119,7 @@ def initialize() end def get_avalara_version() - return @avalara_version || '1.3' + return @avalara_version || '1.4' end def set_avalara_version(avalara_version) @@ -801,11 +1166,164 @@ def set_x_correlation_id(x_correlation_id) @x_correlation_id = x_correlation_id end end + # Represents the Request object for the CreateTradingPartner API + # + # @param String $avalara_version The HTTP Header meant to specify the version of the API intended to be used. (required) + # @param TradingPartner $trading_partner trading_partner (required) + # @param String $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". (optional) + # @param String $x_correlation_id The caller can use this as an identifier to use as a correlation id to trace the call. (optional) + # + class CreateTradingPartnerRequestSdk + attr_accessor :avalara_version + + attr_accessor :trading_partner + + attr_accessor :x_avalara_client + + attr_accessor :x_correlation_id + + def initialize() + end + + def get_avalara_version() + return @avalara_version || '1.4' + end + + def set_avalara_version(avalara_version) + @avalara_version = avalara_version + end + + def get_trading_partner() + return @trading_partner + end + + def set_trading_partner(trading_partner) + @trading_partner = trading_partner + end + + def get_x_avalara_client() + return @x_avalara_client + end + + def set_x_avalara_client(x_avalara_client) + @x_avalara_client = x_avalara_client + end + + def get_x_correlation_id() + return @x_correlation_id + end + + def set_x_correlation_id(x_correlation_id) + @x_correlation_id = x_correlation_id + end + end + # Represents the Request object for the CreateTradingPartnersBatch API + # + # @param String $avalara_version The HTTP Header meant to specify the version of the API intended to be used. (required) + # @param CreateTradingPartnersBatchRequest $create_trading_partners_batch_request create_trading_partners_batch_request (required) + # @param String $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". (optional) + # @param String $x_correlation_id The caller can use this as an identifier to use as a correlation id to trace the call. (optional) + # + class CreateTradingPartnersBatchRequestSdk + attr_accessor :avalara_version + + attr_accessor :create_trading_partners_batch_request + + attr_accessor :x_avalara_client + + attr_accessor :x_correlation_id + + def initialize() + end + + def get_avalara_version() + return @avalara_version || '1.4' + end + + def set_avalara_version(avalara_version) + @avalara_version = avalara_version + end + + def get_create_trading_partners_batch_request() + return @create_trading_partners_batch_request + end + + def set_create_trading_partners_batch_request(create_trading_partners_batch_request) + @create_trading_partners_batch_request = create_trading_partners_batch_request + end + + def get_x_avalara_client() + return @x_avalara_client + end + + def set_x_avalara_client(x_avalara_client) + @x_avalara_client = x_avalara_client + end + + def get_x_correlation_id() + return @x_correlation_id + end + + def set_x_correlation_id(x_correlation_id) + @x_correlation_id = x_correlation_id + end + end + # Represents the Request object for the DeleteTradingPartner API + # + # @param String $avalara_version The HTTP Header meant to specify the version of the API intended to be used. (required) + # @param String $id The ID of the trading partner which is being deleted. (required) + # @param String $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". (optional) + # @param String $x_correlation_id The caller can use this as an identifier to use as a correlation id to trace the call. (optional) + # + class DeleteTradingPartnerRequestSdk + attr_accessor :avalara_version + + attr_accessor :id + + attr_accessor :x_avalara_client + + attr_accessor :x_correlation_id + + def initialize() + end + + def get_avalara_version() + return @avalara_version || '1.4' + end + + def set_avalara_version(avalara_version) + @avalara_version = avalara_version + end + + def get_id() + return @id + end + + def set_id(id) + @id = id + end + + def get_x_avalara_client() + return @x_avalara_client + end + + def set_x_avalara_client(x_avalara_client) + @x_avalara_client = x_avalara_client + end + + def get_x_correlation_id() + return @x_correlation_id + end + + def set_x_correlation_id(x_correlation_id) + @x_correlation_id = x_correlation_id + end + end # Represents the Request object for the DownloadBatchSearchReport API # - # @param String $avalara_version The HTTP Header meant to specify the version of the API intended to be used (required) - # @param String $id The ID of the batch search whose report is to be downloaded. (required) - # @param String $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" (optional) + # @param String $avalara_version The HTTP Header meant to specify the version of the API intended to be used. (required) + # @param String $id The ID of the batch search for which the report should be downloaded. (required) + # @param String $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". (optional) # @param String $x_correlation_id The caller can use this as an identifier to use as a correlation id to trace the call. (optional) # class DownloadBatchSearchReportRequestSdk @@ -821,7 +1339,7 @@ def initialize() end def get_avalara_version() - return @avalara_version || '1.3' + return @avalara_version || '1.4' end def set_avalara_version(avalara_version) @@ -854,9 +1372,9 @@ def set_x_correlation_id(x_correlation_id) end # Represents the Request object for the GetBatchSearchDetail API # - # @param String $avalara_version The HTTP Header meant to specify the version of the API intended to be used (required) + # @param String $avalara_version The HTTP Header meant to specify the version of the API intended to be used. (required) # @param String $id The ID of the batch search that was submitted earlier. (required) - # @param String $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" (optional) + # @param String $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". (optional) # @param String $x_correlation_id The caller can use this as an identifier to use as a correlation id to trace the call. (optional) # class GetBatchSearchDetailRequestSdk @@ -872,7 +1390,7 @@ def initialize() end def get_avalara_version() - return @avalara_version || '1.3' + return @avalara_version || '1.4' end def set_avalara_version(avalara_version) @@ -905,13 +1423,13 @@ def set_x_correlation_id(x_correlation_id) end # Represents the Request object for the ListBatchSearches API # - # @param String $avalara_version The HTTP Header meant to specify the version of the API intended to be used (required) - # @param String $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" (optional) - # @param String $filter Filter by field name and value. This filter only supports <code>eq</code> .The parameters supported is <code>name</code>. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. Filtering will be done over the provided parameters. (optional) - # @param Boolean $count When set to true, the count of the collection is included as @recordSetCount in the response body. (optional) - # @param Float $top The number of items to include in the result. (optional) - # @param String $skip If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. (optional) - # @param String $order_by The $orderBy query parameter specifies the field and sorting direction for ordering the result set. The value is a string that combines a field name and a sorting direction (asc for ascending or desc for descending), separated by a space. (optional) + # @param String $avalara_version The HTTP Header meant to specify the version of the API intended to be used. (required) + # @param String $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". (optional) + # @param String $filter Filters the results by field name. Only the <code>eq</code> operator and the name field is supported. For more information, refer to [AvaTax filtering guide](https://developer.avalara.com/avatax/filtering-in-rest/). (optional) + # @param Boolean $count When set to <code>true</code>, returns the total count of matching records included as <code>@recordSetCount</code> in the response body. (optional) + # @param Integer $top The number of items to include in the result. (optional) + # @param Integer $skip The number of items to skip in the result. (optional) + # @param String $order_by The <code>$orderBy</code> query parameter specifies the field and sorting direction for ordering the result set. The value is a string that combines a field name and a sorting direction (asc for ascending or desc for descending), separated by a space. (optional) # @param String $x_correlation_id The caller can use this as an identifier to use as a correlation id to trace the call. (optional) # class ListBatchSearchesRequestSdk @@ -935,7 +1453,7 @@ def initialize() end def get_avalara_version() - return @avalara_version || '1.3' + return @avalara_version || '1.4' end def set_avalara_version(avalara_version) @@ -1000,14 +1518,14 @@ def set_x_correlation_id(x_correlation_id) end # Represents the Request object for the SearchParticipants API # - # @param String $avalara_version The HTTP Header meant to specify the version of the API intended to be used (required) - # @param String $search Search by value supports logical AND and OR. Refer to [https://learn.microsoft.com/en-us/odata/concepts/queryoptions-overview#search](https://learn.microsoft.com/en-us/odata/concepts/queryoptions-overview#search) for more information on search. Search will be done over <code>name</code> and <code>identifier</code> parameters only. (required) - # @param String $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\" (optional) - # @param Boolean $count When set to true, the count of the collection is included as @recordSetCount in the response body. (optional) - # @param String $filter Filter by field name and value. This filter only supports <code>eq</code> .The parameters supported are <code>network</code>, <code>country</code>, <code>documentType</code>, <code>idType</code>. Refer to [https://developer.avalara.com/avatax/filtering-in-rest/](https://developer.avalara.com/avatax/filtering-in-rest/) for more information on filtering. Filtering will be done over the provided parameters. (optional) - # @param Float $top The number of items to include in the result. (optional) - # @param String $skip If nonzero, skip this number of results before returning data. Used with <code>$top</code> to provide pagination for large datasets. (optional) - # @param String $order_by The $orderBy query parameter specifies the field and sorting direction for ordering the result set. The value is a string that combines a field name and a sorting direction (asc for ascending or desc for descending), separated by a space. (optional) + # @param String $avalara_version The HTTP Header meant to specify the version of the API intended to be used. (required) + # @param String $search Search by value supports logical <code>AND</code> / <code>OR</code> operators. Search is performed only over the name and identifier value fields. For more information, refer to [Query options overview - OData.](https://learn.microsoft.com/en-us/odata/concepts/queryoptions-overview#search). (required) + # @param String $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". (optional) + # @param Boolean $count When set to <code>true</code>, returns the total count of matching records included as <code>@recordSetCount</code> in the response body. (optional) + # @param String $filter Filters the results using the <code>eq</code> operator. Supported fields: <code>network</code>, <code>country</code>, <code>documentType</code>, <code>idType</code>. For more information, refer to [AvaTax filtering guide](https://developer.avalara.com/avatax/filtering-in-rest/). (optional) + # @param Integer $top The number of items to include in the result. (optional) + # @param Integer $skip The number of items to skip in the result. (optional) + # @param String $order_by The <code>$orderBy</code> query parameter specifies the field and sorting direction for ordering the result set. The value is a string that combines a field name and a sorting direction (asc for ascending or desc for descending), separated by a space. (optional) # @param String $x_correlation_id The caller can use this as an identifier to use as a correlation id to trace the call. (optional) # class SearchParticipantsRequestSdk @@ -1033,7 +1551,7 @@ def initialize() end def get_avalara_version() - return @avalara_version || '1.3' + return @avalara_version || '1.4' end def set_avalara_version(avalara_version) @@ -1100,6 +1618,68 @@ def get_x_correlation_id() return @x_correlation_id end + def set_x_correlation_id(x_correlation_id) + @x_correlation_id = x_correlation_id + end + end + # Represents the Request object for the UpdateTradingPartner API + # + # @param String $avalara_version The HTTP Header meant to specify the version of the API intended to be used. (required) + # @param String $id The ID of the trading partner which is being updated. (required) + # @param TradingPartner $trading_partner trading_partner (required) + # @param String $x_avalara_client You can freely use any text you wish for this value. This feature can help you diagnose and solve problems with your software. The header can be treated like a \"Fingerprint\". (optional) + # @param String $x_correlation_id The caller can use this as an identifier to use as a correlation id to trace the call. (optional) + # + class UpdateTradingPartnerRequestSdk + attr_accessor :avalara_version + + attr_accessor :id + + attr_accessor :trading_partner + + attr_accessor :x_avalara_client + + attr_accessor :x_correlation_id + + def initialize() + end + + def get_avalara_version() + return @avalara_version || '1.4' + end + + def set_avalara_version(avalara_version) + @avalara_version = avalara_version + end + + def get_id() + return @id + end + + def set_id(id) + @id = id + end + + def get_trading_partner() + return @trading_partner + end + + def set_trading_partner(trading_partner) + @trading_partner = trading_partner + end + + def get_x_avalara_client() + return @x_avalara_client + end + + def set_x_avalara_client(x_avalara_client) + @x_avalara_client = x_avalara_client + end + + def get_x_correlation_id() + return @x_correlation_id + end + def set_x_correlation_id(x_correlation_id) @x_correlation_id = x_correlation_id end diff --git a/lib/avalara_sdk/models/A1099/V2/attribute.rb b/lib/avalara_sdk/models/A1099/V2/attribute.rb index e247f7e..750cd7b 100644 --- a/lib/avalara_sdk/models/A1099/V2/attribute.rb +++ b/lib/avalara_sdk/models/A1099/V2/attribute.rb @@ -1,7 +1,7 @@ =begin #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) =end diff --git a/lib/avalara_sdk/models/A1099/V2/authorized_api_request_model.rb b/lib/avalara_sdk/models/A1099/V2/authorized_api_request_model.rb index aef2341..6b9485d 100644 --- a/lib/avalara_sdk/models/A1099/V2/authorized_api_request_model.rb +++ b/lib/avalara_sdk/models/A1099/V2/authorized_api_request_model.rb @@ -1,7 +1,7 @@ =begin #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) =end diff --git a/lib/avalara_sdk/models/A1099/V2/authorized_api_request_v2_data_model.rb b/lib/avalara_sdk/models/A1099/V2/authorized_api_request_v2_data_model.rb index 4c00190..cd3fad1 100644 --- a/lib/avalara_sdk/models/A1099/V2/authorized_api_request_v2_data_model.rb +++ b/lib/avalara_sdk/models/A1099/V2/authorized_api_request_v2_data_model.rb @@ -1,7 +1,7 @@ =begin #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) =end diff --git a/lib/avalara_sdk/models/A1099/V2/base_company_model.rb b/lib/avalara_sdk/models/A1099/V2/base_company_model.rb index 6e9cfe5..f893328 100644 --- a/lib/avalara_sdk/models/A1099/V2/base_company_model.rb +++ b/lib/avalara_sdk/models/A1099/V2/base_company_model.rb @@ -1,7 +1,7 @@ =begin #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) =end diff --git a/lib/avalara_sdk/models/A1099/V2/base_form_list_request.rb b/lib/avalara_sdk/models/A1099/V2/base_form_list_request.rb index 7ddd822..e62021e 100644 --- a/lib/avalara_sdk/models/A1099/V2/base_form_list_request.rb +++ b/lib/avalara_sdk/models/A1099/V2/base_form_list_request.rb @@ -1,7 +1,7 @@ =begin #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) =end diff --git a/lib/avalara_sdk/models/A1099/V2/bulk_upsert1099_forms_request.rb b/lib/avalara_sdk/models/A1099/V2/bulk_upsert1099_forms_request.rb index 50f1cb3..3183f7f 100644 --- a/lib/avalara_sdk/models/A1099/V2/bulk_upsert1099_forms_request.rb +++ b/lib/avalara_sdk/models/A1099/V2/bulk_upsert1099_forms_request.rb @@ -1,7 +1,7 @@ =begin #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) =end @@ -15,6 +15,7 @@ class << self # List of class defined in oneOf (OpenAPI v3) def openapi_one_of [ + :'Form1042SList', :'Form1095BList', :'Form1099DivList', :'Form1099KList', diff --git a/lib/avalara_sdk/models/A1099/V2/company_create_update_request_model.rb b/lib/avalara_sdk/models/A1099/V2/company_create_update_request_model.rb index 9bcb81b..d639788 100644 --- a/lib/avalara_sdk/models/A1099/V2/company_create_update_request_model.rb +++ b/lib/avalara_sdk/models/A1099/V2/company_create_update_request_model.rb @@ -1,7 +1,7 @@ =begin #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) =end diff --git a/lib/avalara_sdk/models/A1099/V2/company_model.rb b/lib/avalara_sdk/models/A1099/V2/company_model.rb index d6c0b07..99aa2a7 100644 --- a/lib/avalara_sdk/models/A1099/V2/company_model.rb +++ b/lib/avalara_sdk/models/A1099/V2/company_model.rb @@ -1,7 +1,7 @@ =begin #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) =end diff --git a/lib/avalara_sdk/models/A1099/V2/company_response.rb b/lib/avalara_sdk/models/A1099/V2/company_response.rb index cf0a45c..e4d11c6 100644 --- a/lib/avalara_sdk/models/A1099/V2/company_response.rb +++ b/lib/avalara_sdk/models/A1099/V2/company_response.rb @@ -1,7 +1,7 @@ =begin #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) =end diff --git a/lib/avalara_sdk/models/A1099/V2/company_response_model.rb b/lib/avalara_sdk/models/A1099/V2/company_response_model.rb index b03c386..a0057c1 100644 --- a/lib/avalara_sdk/models/A1099/V2/company_response_model.rb +++ b/lib/avalara_sdk/models/A1099/V2/company_response_model.rb @@ -1,7 +1,7 @@ =begin #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) =end diff --git a/lib/avalara_sdk/models/A1099/V2/covered_individual_reference_response.rb b/lib/avalara_sdk/models/A1099/V2/covered_individual_reference_response.rb new file mode 100644 index 0000000..19381b4 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/covered_individual_reference_response.rb @@ -0,0 +1,407 @@ +=begin +#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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class CoveredIndividualReferenceResponse + # Covered individual ID + attr_accessor :id + + # Covered individual's first name + attr_accessor :first_name + + # Covered individual's middle name + attr_accessor :middle_name + + # Covered individual's last name + attr_accessor :last_name + + # Covered individual's name suffix + attr_accessor :name_suffix + + # Covered individual's TIN (SSN or ITIN) + attr_accessor :tin + + # Covered individual's date of birth + attr_accessor :birth_date + + # Coverage indicator for all 12 months + attr_accessor :covered_month0 + + # Coverage indicator for January + attr_accessor :covered_month1 + + # Coverage indicator for February + attr_accessor :covered_month2 + + # Coverage indicator for March + attr_accessor :covered_month3 + + # Coverage indicator for April + attr_accessor :covered_month4 + + # Coverage indicator for May + attr_accessor :covered_month5 + + # Coverage indicator for June + attr_accessor :covered_month6 + + # Coverage indicator for July + attr_accessor :covered_month7 + + # Coverage indicator for August + attr_accessor :covered_month8 + + # Coverage indicator for September + attr_accessor :covered_month9 + + # Coverage indicator for October + attr_accessor :covered_month10 + + # Coverage indicator for November + attr_accessor :covered_month11 + + # Coverage indicator for December + attr_accessor :covered_month12 + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'first_name' => :'firstName', + :'middle_name' => :'middleName', + :'last_name' => :'lastName', + :'name_suffix' => :'nameSuffix', + :'tin' => :'tin', + :'birth_date' => :'birthDate', + :'covered_month0' => :'coveredMonth0', + :'covered_month1' => :'coveredMonth1', + :'covered_month2' => :'coveredMonth2', + :'covered_month3' => :'coveredMonth3', + :'covered_month4' => :'coveredMonth4', + :'covered_month5' => :'coveredMonth5', + :'covered_month6' => :'coveredMonth6', + :'covered_month7' => :'coveredMonth7', + :'covered_month8' => :'coveredMonth8', + :'covered_month9' => :'coveredMonth9', + :'covered_month10' => :'coveredMonth10', + :'covered_month11' => :'coveredMonth11', + :'covered_month12' => :'coveredMonth12' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'first_name' => :'String', + :'middle_name' => :'String', + :'last_name' => :'String', + :'name_suffix' => :'String', + :'tin' => :'String', + :'birth_date' => :'Time', + :'covered_month0' => :'Boolean', + :'covered_month1' => :'Boolean', + :'covered_month2' => :'Boolean', + :'covered_month3' => :'Boolean', + :'covered_month4' => :'Boolean', + :'covered_month5' => :'Boolean', + :'covered_month6' => :'Boolean', + :'covered_month7' => :'Boolean', + :'covered_month8' => :'Boolean', + :'covered_month9' => :'Boolean', + :'covered_month10' => :'Boolean', + :'covered_month11' => :'Boolean', + :'covered_month12' => :'Boolean' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'first_name', + :'middle_name', + :'last_name', + :'name_suffix', + :'tin', + :'birth_date', + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::A1099::V2::CoveredIndividualReferenceResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::A1099::V2::CoveredIndividualReferenceResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'first_name') + self.first_name = attributes[:'first_name'] + end + + if attributes.key?(:'middle_name') + self.middle_name = attributes[:'middle_name'] + end + + if attributes.key?(:'last_name') + self.last_name = attributes[:'last_name'] + end + + if attributes.key?(:'name_suffix') + self.name_suffix = attributes[:'name_suffix'] + end + + if attributes.key?(:'tin') + self.tin = attributes[:'tin'] + end + + if attributes.key?(:'birth_date') + self.birth_date = attributes[:'birth_date'] + end + + if attributes.key?(:'covered_month0') + self.covered_month0 = attributes[:'covered_month0'] + end + + if attributes.key?(:'covered_month1') + self.covered_month1 = attributes[:'covered_month1'] + end + + if attributes.key?(:'covered_month2') + self.covered_month2 = attributes[:'covered_month2'] + end + + if attributes.key?(:'covered_month3') + self.covered_month3 = attributes[:'covered_month3'] + end + + if attributes.key?(:'covered_month4') + self.covered_month4 = attributes[:'covered_month4'] + end + + if attributes.key?(:'covered_month5') + self.covered_month5 = attributes[:'covered_month5'] + end + + if attributes.key?(:'covered_month6') + self.covered_month6 = attributes[:'covered_month6'] + end + + if attributes.key?(:'covered_month7') + self.covered_month7 = attributes[:'covered_month7'] + end + + if attributes.key?(:'covered_month8') + self.covered_month8 = attributes[:'covered_month8'] + end + + if attributes.key?(:'covered_month9') + self.covered_month9 = attributes[:'covered_month9'] + end + + if attributes.key?(:'covered_month10') + self.covered_month10 = attributes[:'covered_month10'] + end + + if attributes.key?(:'covered_month11') + self.covered_month11 = attributes[:'covered_month11'] + end + + if attributes.key?(:'covered_month12') + self.covered_month12 = attributes[:'covered_month12'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + first_name == o.first_name && + middle_name == o.middle_name && + last_name == o.last_name && + name_suffix == o.name_suffix && + tin == o.tin && + birth_date == o.birth_date && + covered_month0 == o.covered_month0 && + covered_month1 == o.covered_month1 && + covered_month2 == o.covered_month2 && + covered_month3 == o.covered_month3 && + covered_month4 == o.covered_month4 && + covered_month5 == o.covered_month5 && + covered_month6 == o.covered_month6 && + covered_month7 == o.covered_month7 && + covered_month8 == o.covered_month8 && + covered_month9 == o.covered_month9 && + covered_month10 == o.covered_month10 && + covered_month11 == o.covered_month11 && + covered_month12 == o.covered_month12 + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, first_name, middle_name, last_name, name_suffix, tin, birth_date, covered_month0, covered_month1, covered_month2, covered_month3, covered_month4, covered_month5, covered_month6, covered_month7, covered_month8, covered_month9, covered_month10, covered_month11, covered_month12].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::A1099::V2.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/A1099/V2/covered_individual_request.rb b/lib/avalara_sdk/models/A1099/V2/covered_individual_request.rb index 06a33b8..ef4caaf 100644 --- a/lib/avalara_sdk/models/A1099/V2/covered_individual_request.rb +++ b/lib/avalara_sdk/models/A1099/V2/covered_individual_request.rb @@ -1,7 +1,7 @@ =begin #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) =end @@ -11,42 +11,61 @@ module AvalaraSdk::A1099::V2 class CoveredIndividualRequest + # Covered individual's first name attr_accessor :first_name + # Covered individual's middle name attr_accessor :middle_name + # Covered individual's last name attr_accessor :last_name + # Covered individual's name suffix attr_accessor :name_suffix + # Covered individual's TIN (SSN or ITIN) attr_accessor :tin + # Covered individual's date of birth attr_accessor :birth_date + # Coverage indicator for all 12 months attr_accessor :covered_month_indicator0 + # Coverage indicator for January attr_accessor :covered_month_indicator1 + # Coverage indicator for February attr_accessor :covered_month_indicator2 + # Coverage indicator for March attr_accessor :covered_month_indicator3 + # Coverage indicator for April attr_accessor :covered_month_indicator4 + # Coverage indicator for May attr_accessor :covered_month_indicator5 + # Coverage indicator for June attr_accessor :covered_month_indicator6 + # Coverage indicator for July attr_accessor :covered_month_indicator7 + # Coverage indicator for August attr_accessor :covered_month_indicator8 + # Coverage indicator for September attr_accessor :covered_month_indicator9 + # Coverage indicator for October attr_accessor :covered_month_indicator10 + # Coverage indicator for November attr_accessor :covered_month_indicator11 + # Coverage indicator for December attr_accessor :covered_month_indicator12 # Attribute mapping from ruby-style variable name to JSON key. diff --git a/lib/avalara_sdk/models/A1099/V2/create1099_form201_response.rb b/lib/avalara_sdk/models/A1099/V2/create1099_form201_response.rb new file mode 100644 index 0000000..9f2859f --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/create1099_form201_response.rb @@ -0,0 +1,106 @@ +=begin +#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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + module Create1099Form201Response + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Form1042SListItemResponse', + :'Form1095BListItemResponse', + :'Form1099BaseResponse', + :'Form1099KListItemResponse', + :'Form1099MiscListItemResponse', + :'Form1099NecListItemResponse', + :'Form1099RListItemResponse' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass, data) + return if data.nil? + + case klass.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type, item) } + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) } + end + else # model + const = AvalaraSdk::A1099::V2.const_get(klass) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue + raise SchemaMismatchError, "#{data} doesn't match the #{klass} type" + end + end + end + +end diff --git a/lib/avalara_sdk/models/A1099/V2/create_w9_form201_response.rb b/lib/avalara_sdk/models/A1099/V2/create_w9_form201_response.rb new file mode 100644 index 0000000..315a4f0 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/create_w9_form201_response.rb @@ -0,0 +1,104 @@ +=begin +#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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + module CreateW9Form201Response + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'W4FormResponse', + :'W8BenEFormResponse', + :'W8BenFormResponse', + :'W8ImyFormResponse', + :'W9FormResponse' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass, data) + return if data.nil? + + case klass.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type, item) } + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) } + end + else # model + const = AvalaraSdk::A1099::V2.const_get(klass) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue + raise SchemaMismatchError, "#{data} doesn't match the #{klass} type" + end + end + end + +end diff --git a/lib/avalara_sdk/models/A1099/V2/create_w9_form_request.rb b/lib/avalara_sdk/models/A1099/V2/create_w9_form_request.rb new file mode 100644 index 0000000..d3b56b4 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/create_w9_form_request.rb @@ -0,0 +1,104 @@ +=begin +#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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + module CreateW9FormRequest + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'W4FormRequest', + :'W8BenEFormRequest', + :'W8BenFormRequest', + :'W8ImyFormRequest', + :'W9FormRequest' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass, data) + return if data.nil? + + case klass.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type, item) } + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) } + end + else # model + const = AvalaraSdk::A1099::V2.const_get(klass) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue + raise SchemaMismatchError, "#{data} doesn't match the #{klass} type" + end + end + end + +end diff --git a/lib/avalara_sdk/models/A1099/V2/data.rb b/lib/avalara_sdk/models/A1099/V2/data.rb index 1d40890..52f4cb8 100644 --- a/lib/avalara_sdk/models/A1099/V2/data.rb +++ b/lib/avalara_sdk/models/A1099/V2/data.rb @@ -1,7 +1,7 @@ =begin #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) =end diff --git a/lib/avalara_sdk/models/A1099/V2/error_model.rb b/lib/avalara_sdk/models/A1099/V2/error_model.rb index 17974d4..81525a7 100644 --- a/lib/avalara_sdk/models/A1099/V2/error_model.rb +++ b/lib/avalara_sdk/models/A1099/V2/error_model.rb @@ -1,7 +1,7 @@ =begin #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) =end diff --git a/lib/avalara_sdk/models/A1099/V2/error_response.rb b/lib/avalara_sdk/models/A1099/V2/error_response.rb index 6cd17ae..cfebdeb 100644 --- a/lib/avalara_sdk/models/A1099/V2/error_response.rb +++ b/lib/avalara_sdk/models/A1099/V2/error_response.rb @@ -1,7 +1,7 @@ =begin #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) =end diff --git a/lib/avalara_sdk/models/A1099/V2/error_response_errors_inner.rb b/lib/avalara_sdk/models/A1099/V2/error_response_errors_inner.rb index 8003cfd..b1f48f9 100644 --- a/lib/avalara_sdk/models/A1099/V2/error_response_errors_inner.rb +++ b/lib/avalara_sdk/models/A1099/V2/error_response_errors_inner.rb @@ -1,7 +1,7 @@ =begin #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) =end diff --git a/lib/avalara_sdk/models/A1099/V2/form1042_s_list.rb b/lib/avalara_sdk/models/A1099/V2/form1042_s_list.rb new file mode 100644 index 0000000..e978e31 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/form1042_s_list.rb @@ -0,0 +1,238 @@ +=begin +#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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class Form1042SList + attr_accessor :forms + + attr_accessor :form_type + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'forms' => :'forms', + :'form_type' => :'formType' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'forms' => :'Array', + :'form_type' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'BaseFormListRequest' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::A1099::V2::Form1042SList` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::A1099::V2::Form1042SList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'forms') + if (value = attributes[:'forms']).is_a?(Array) + self.forms = value + end + end + + if attributes.key?(:'form_type') + self.form_type = attributes[:'form_type'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Custom attribute writer method with validation + # @param [Object] forms Value to be assigned + def forms=(forms) + if forms.nil? + fail ArgumentError, 'forms cannot be nil' + end + + @forms = forms + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + forms == o.forms && + form_type == o.form_type + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [forms, form_type].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::A1099::V2.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/A1099/V2/form1042_s_list_item.rb b/lib/avalara_sdk/models/A1099/V2/form1042_s_list_item.rb new file mode 100644 index 0000000..698ba17 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/form1042_s_list_item.rb @@ -0,0 +1,891 @@ +=begin +#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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class Form1042SListItem + # Unique form identifier + attr_accessor :unique_form_id + + # No TIN indicator + attr_accessor :no_tin + + # Recipient's date of birth + attr_accessor :recipient_date_of_birth + + # Recipient's GIIN (Global Intermediary Identification Number) + attr_accessor :recipient_giin + + # Recipient's foreign TIN + attr_accessor :recipient_foreign_tin + + # Limitation on benefits code + attr_accessor :lob_code + + # Income code + attr_accessor :income_code + + # Gross income + attr_accessor :gross_income + + # Withholding indicator + attr_accessor :withholding_indicator + + # Country code + attr_accessor :tax_country_code + + # Exemption code (Chapter 3) + attr_accessor :exemption_code_chap3 + + # Exemption code (Chapter 4) + attr_accessor :exemption_code_chap4 + + # Tax rate (Chapter 3) + attr_accessor :tax_rate_chap3 + + # Withholding allowance + attr_accessor :withholding_allowance + + # Federal tax withheld + attr_accessor :federal_tax_withheld + + # Tax not deposited indicator + attr_accessor :tax_not_deposited_indicator + + # Academic indicator + attr_accessor :academic_indicator + + # Tax withheld by other agents + attr_accessor :tax_withheld_other_agents + + # Amount repaid to recipient + attr_accessor :amount_repaid + + # Tax paid by withholding agent + attr_accessor :tax_paid_agent + + # Chapter 3 status code + attr_accessor :chap3_status_code + + # Chapter 4 status code + attr_accessor :chap4_status_code + + # Primary withholding agent information + attr_accessor :primary_withholding_agent + + # Intermediary or flow-through entity information + attr_accessor :intermediary_or_flow_through + + # Issuer ID + attr_accessor :issuer_id + + # Reference ID + attr_accessor :reference_id + + # Recipient Tax ID Number + attr_accessor :recipient_tin + + # Recipient name + attr_accessor :recipient_name + + # Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN + attr_accessor :tin_type + + # Recipient second name + attr_accessor :recipient_second_name + + # Address + attr_accessor :address + + # Address line 2 + attr_accessor :address2 + + # City + attr_accessor :city + + # US state. Required if CountryCode is \"US\". + attr_accessor :state + + # Zip/postal code + attr_accessor :zip + + # Recipient email address + attr_accessor :recipient_email + + # Account number + attr_accessor :account_number + + # Office code + attr_accessor :office_code + + # Foreign province + attr_accessor :recipient_non_us_province + + # Country code, as defined at https://www.irs.gov/e-file-providers/country-codes + attr_accessor :country_code + + # Boolean indicating that federal e-filing should be scheduled for this form + attr_accessor :federal_e_file + + # Boolean indicating that postal mailing to the recipient should be scheduled for this form + attr_accessor :postal_mail + + # Boolean indicating that state e-filing should be scheduled for this form + attr_accessor :state_e_file + + # Boolean indicating that TIN Matching should be scheduled for this form + attr_accessor :tin_match + + # Boolean indicating that address verification should be scheduled for this form + attr_accessor :address_verification + + # State and local withholding information + attr_accessor :state_and_local_withholding + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'unique_form_id' => :'uniqueFormId', + :'no_tin' => :'noTin', + :'recipient_date_of_birth' => :'recipientDateOfBirth', + :'recipient_giin' => :'recipientGiin', + :'recipient_foreign_tin' => :'recipientForeignTin', + :'lob_code' => :'lobCode', + :'income_code' => :'incomeCode', + :'gross_income' => :'grossIncome', + :'withholding_indicator' => :'withholdingIndicator', + :'tax_country_code' => :'taxCountryCode', + :'exemption_code_chap3' => :'exemptionCodeChap3', + :'exemption_code_chap4' => :'exemptionCodeChap4', + :'tax_rate_chap3' => :'taxRateChap3', + :'withholding_allowance' => :'withholdingAllowance', + :'federal_tax_withheld' => :'federalTaxWithheld', + :'tax_not_deposited_indicator' => :'taxNotDepositedIndicator', + :'academic_indicator' => :'academicIndicator', + :'tax_withheld_other_agents' => :'taxWithheldOtherAgents', + :'amount_repaid' => :'amountRepaid', + :'tax_paid_agent' => :'taxPaidAgent', + :'chap3_status_code' => :'chap3StatusCode', + :'chap4_status_code' => :'chap4StatusCode', + :'primary_withholding_agent' => :'primaryWithholdingAgent', + :'intermediary_or_flow_through' => :'intermediaryOrFlowThrough', + :'issuer_id' => :'issuerId', + :'reference_id' => :'referenceId', + :'recipient_tin' => :'recipientTin', + :'recipient_name' => :'recipientName', + :'tin_type' => :'tinType', + :'recipient_second_name' => :'recipientSecondName', + :'address' => :'address', + :'address2' => :'address2', + :'city' => :'city', + :'state' => :'state', + :'zip' => :'zip', + :'recipient_email' => :'recipientEmail', + :'account_number' => :'accountNumber', + :'office_code' => :'officeCode', + :'recipient_non_us_province' => :'recipientNonUsProvince', + :'country_code' => :'countryCode', + :'federal_e_file' => :'federalEFile', + :'postal_mail' => :'postalMail', + :'state_e_file' => :'stateEFile', + :'tin_match' => :'tinMatch', + :'address_verification' => :'addressVerification', + :'state_and_local_withholding' => :'stateAndLocalWithholding' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'unique_form_id' => :'String', + :'no_tin' => :'Boolean', + :'recipient_date_of_birth' => :'Time', + :'recipient_giin' => :'String', + :'recipient_foreign_tin' => :'String', + :'lob_code' => :'String', + :'income_code' => :'String', + :'gross_income' => :'Float', + :'withholding_indicator' => :'String', + :'tax_country_code' => :'String', + :'exemption_code_chap3' => :'String', + :'exemption_code_chap4' => :'String', + :'tax_rate_chap3' => :'String', + :'withholding_allowance' => :'Float', + :'federal_tax_withheld' => :'Float', + :'tax_not_deposited_indicator' => :'Boolean', + :'academic_indicator' => :'Boolean', + :'tax_withheld_other_agents' => :'Float', + :'amount_repaid' => :'Float', + :'tax_paid_agent' => :'Float', + :'chap3_status_code' => :'String', + :'chap4_status_code' => :'String', + :'primary_withholding_agent' => :'PrimaryWithholdingAgent', + :'intermediary_or_flow_through' => :'IntermediaryOrFlowThrough', + :'issuer_id' => :'String', + :'reference_id' => :'String', + :'recipient_tin' => :'String', + :'recipient_name' => :'String', + :'tin_type' => :'String', + :'recipient_second_name' => :'String', + :'address' => :'String', + :'address2' => :'String', + :'city' => :'String', + :'state' => :'String', + :'zip' => :'String', + :'recipient_email' => :'String', + :'account_number' => :'String', + :'office_code' => :'String', + :'recipient_non_us_province' => :'String', + :'country_code' => :'String', + :'federal_e_file' => :'Boolean', + :'postal_mail' => :'Boolean', + :'state_e_file' => :'Boolean', + :'tin_match' => :'Boolean', + :'address_verification' => :'Boolean', + :'state_and_local_withholding' => :'StateAndLocalWithholdingRequest' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'no_tin', + :'recipient_date_of_birth', + :'recipient_giin', + :'recipient_foreign_tin', + :'lob_code', + :'exemption_code_chap3', + :'exemption_code_chap4', + :'tax_rate_chap3', + :'withholding_allowance', + :'federal_tax_withheld', + :'tax_not_deposited_indicator', + :'academic_indicator', + :'tax_withheld_other_agents', + :'amount_repaid', + :'tax_paid_agent', + :'chap3_status_code', + :'chap4_status_code', + :'issuer_id', + :'reference_id', + :'recipient_second_name', + :'address2', + :'recipient_email', + :'account_number', + :'office_code', + :'recipient_non_us_province', + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'FormRequestBase' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::A1099::V2::Form1042SListItem` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::A1099::V2::Form1042SListItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'unique_form_id') + self.unique_form_id = attributes[:'unique_form_id'] + end + + if attributes.key?(:'no_tin') + self.no_tin = attributes[:'no_tin'] + end + + if attributes.key?(:'recipient_date_of_birth') + self.recipient_date_of_birth = attributes[:'recipient_date_of_birth'] + end + + if attributes.key?(:'recipient_giin') + self.recipient_giin = attributes[:'recipient_giin'] + end + + if attributes.key?(:'recipient_foreign_tin') + self.recipient_foreign_tin = attributes[:'recipient_foreign_tin'] + end + + if attributes.key?(:'lob_code') + self.lob_code = attributes[:'lob_code'] + end + + if attributes.key?(:'income_code') + self.income_code = attributes[:'income_code'] + end + + if attributes.key?(:'gross_income') + self.gross_income = attributes[:'gross_income'] + end + + if attributes.key?(:'withholding_indicator') + self.withholding_indicator = attributes[:'withholding_indicator'] + end + + if attributes.key?(:'tax_country_code') + self.tax_country_code = attributes[:'tax_country_code'] + end + + if attributes.key?(:'exemption_code_chap3') + self.exemption_code_chap3 = attributes[:'exemption_code_chap3'] + end + + if attributes.key?(:'exemption_code_chap4') + self.exemption_code_chap4 = attributes[:'exemption_code_chap4'] + end + + if attributes.key?(:'tax_rate_chap3') + self.tax_rate_chap3 = attributes[:'tax_rate_chap3'] + end + + if attributes.key?(:'withholding_allowance') + self.withholding_allowance = attributes[:'withholding_allowance'] + end + + if attributes.key?(:'federal_tax_withheld') + self.federal_tax_withheld = attributes[:'federal_tax_withheld'] + end + + if attributes.key?(:'tax_not_deposited_indicator') + self.tax_not_deposited_indicator = attributes[:'tax_not_deposited_indicator'] + end + + if attributes.key?(:'academic_indicator') + self.academic_indicator = attributes[:'academic_indicator'] + end + + if attributes.key?(:'tax_withheld_other_agents') + self.tax_withheld_other_agents = attributes[:'tax_withheld_other_agents'] + end + + if attributes.key?(:'amount_repaid') + self.amount_repaid = attributes[:'amount_repaid'] + end + + if attributes.key?(:'tax_paid_agent') + self.tax_paid_agent = attributes[:'tax_paid_agent'] + end + + if attributes.key?(:'chap3_status_code') + self.chap3_status_code = attributes[:'chap3_status_code'] + end + + if attributes.key?(:'chap4_status_code') + self.chap4_status_code = attributes[:'chap4_status_code'] + end + + if attributes.key?(:'primary_withholding_agent') + self.primary_withholding_agent = attributes[:'primary_withholding_agent'] + end + + if attributes.key?(:'intermediary_or_flow_through') + self.intermediary_or_flow_through = attributes[:'intermediary_or_flow_through'] + end + + if attributes.key?(:'issuer_id') + self.issuer_id = attributes[:'issuer_id'] + end + + if attributes.key?(:'reference_id') + self.reference_id = attributes[:'reference_id'] + end + + if attributes.key?(:'recipient_tin') + self.recipient_tin = attributes[:'recipient_tin'] + end + + if attributes.key?(:'recipient_name') + self.recipient_name = attributes[:'recipient_name'] + else + self.recipient_name = nil + end + + if attributes.key?(:'tin_type') + self.tin_type = attributes[:'tin_type'] + end + + if attributes.key?(:'recipient_second_name') + self.recipient_second_name = attributes[:'recipient_second_name'] + end + + if attributes.key?(:'address') + self.address = attributes[:'address'] + else + self.address = nil + end + + if attributes.key?(:'address2') + self.address2 = attributes[:'address2'] + end + + if attributes.key?(:'city') + self.city = attributes[:'city'] + else + self.city = nil + end + + if attributes.key?(:'state') + self.state = attributes[:'state'] + end + + if attributes.key?(:'zip') + self.zip = attributes[:'zip'] + end + + if attributes.key?(:'recipient_email') + self.recipient_email = attributes[:'recipient_email'] + end + + if attributes.key?(:'account_number') + self.account_number = attributes[:'account_number'] + end + + if attributes.key?(:'office_code') + self.office_code = attributes[:'office_code'] + end + + if attributes.key?(:'recipient_non_us_province') + self.recipient_non_us_province = attributes[:'recipient_non_us_province'] + end + + if attributes.key?(:'country_code') + self.country_code = attributes[:'country_code'] + else + self.country_code = nil + end + + if attributes.key?(:'federal_e_file') + self.federal_e_file = attributes[:'federal_e_file'] + end + + if attributes.key?(:'postal_mail') + self.postal_mail = attributes[:'postal_mail'] + end + + if attributes.key?(:'state_e_file') + self.state_e_file = attributes[:'state_e_file'] + end + + if attributes.key?(:'tin_match') + self.tin_match = attributes[:'tin_match'] + end + + if attributes.key?(:'address_verification') + self.address_verification = attributes[:'address_verification'] + end + + if attributes.key?(:'state_and_local_withholding') + self.state_and_local_withholding = attributes[:'state_and_local_withholding'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @recipient_name.nil? + invalid_properties.push('invalid value for "recipient_name", recipient_name cannot be nil.') + end + + if @recipient_name.to_s.length < 1 + invalid_properties.push('invalid value for "recipient_name", the character length must be great than or equal to 1.') + end + + if @address.nil? + invalid_properties.push('invalid value for "address", address cannot be nil.') + end + + if @address.to_s.length < 1 + invalid_properties.push('invalid value for "address", the character length must be great than or equal to 1.') + end + + if @city.nil? + invalid_properties.push('invalid value for "city", city cannot be nil.') + end + + if @city.to_s.length < 1 + invalid_properties.push('invalid value for "city", the character length must be great than or equal to 1.') + end + + if @country_code.nil? + invalid_properties.push('invalid value for "country_code", country_code cannot be nil.') + end + + if @country_code.to_s.length < 1 + invalid_properties.push('invalid value for "country_code", the character length must be great than or equal to 1.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + lob_code_validator = EnumAttributeValidator.new('String', ["Individual", "GovernmentContractingState", "TaxExemptPensionTrust", "TaxExemptCharitableOrganization", "PubliclyTradedCorporation", "SubsidiaryOfPubliclyTradedCorporation", "CompanyOwnershipBaseErosionTest", "CompanyDerivativeBenefitsTest", "CompanyActiveTradeOrBusinessTest", "DiscretionaryDetermination", "Other", "NoLobArticleInTreaty"]) + return false unless lob_code_validator.valid?(@lob_code) + exemption_code_chap3_validator = EnumAttributeValidator.new('String', ["TaxRateDueToBackupWithholding", "EffectivelyConnectedIncome", "ExemptUnderIrc", "IncomeNotFromUsSources", "ExemptUnderTaxTreaty", "PortfolioInterestExemptUnderIrc", "QiThatAssumesPrimaryWithholdingResponsibility", "WfPorWft", "UsBranchTreatedAsUsPerson", "TerritoryFiTreatedAsUsPerson", "QiRepresentsIncomeExempt", "QslThatAssumesPrimaryWithholdingResponsibility", "PayeeSubjectedToChapter4Withholding", "QddThatAssumesPrimaryWithholdingResponsibility", "ExemptUnderSection897L", "ExemptUnderSection892"]) + return false unless exemption_code_chap3_validator.valid?(@exemption_code_chap3) + exemption_code_chap4_validator = EnumAttributeValidator.new('String', ["NotExempt", "GrandfatheredPayment", "EffectivelyConnectedIncome", "PayeeNotSubjectToChapter4Withholding", "ExcludedNonfinancialPayment", "ForeignEntityThatAssumesPrimaryWithholdingResponsibility", "UsPayeesOfParticipatingFfi", "ExemptFromWithholdingUnderIga", "DormantAccount", "OtherPaymentNotSubjectToChapter4Withholding"]) + return false unless exemption_code_chap4_validator.valid?(@exemption_code_chap4) + chap3_status_code_validator = EnumAttributeValidator.new('String', ["USWithholdingAgentFI", "USWithholdingAgentOther", "TerritoryFITreatedAsUSPerson", "TerritoryFINotTreatedAsUSPerson", "USBranchTreatedAsUSPerson", "USBranchNotTreatedAsUSPerson", "USBranchECIPresumptionApplied", "PartnershipOtherThanWithholdingForeignPartnership", "WithholdingForeignPartnership", "TrustOtherThanWithholdingForeignTrust", "WithholdingForeignTrust", "QualifiedIntermediary", "QualifiedSecuritiesLenderQualifiedIntermediary", "QualifiedSecuritiesLenderOther", "Corporation", "Individual", "Estate", "PrivateFoundation", "GovernmentOrInternationalOrganization", "TaxExemptOrganizationSection501cEntities", "UnknownRecipient", "ArtistOrAthlete", "Pension", "ForeignCentralBankOfIssue", "NonqualifiedIntermediary", "HybridEntityMakingTreatyClaim", "WithholdingRatePoolGeneral", "WithholdingRatePoolExemptOrganization", "PAIWithholdingRatePoolGeneral", "PAIWithholdingRatePoolExemptOrganization", "AgencyWithholdingRatePoolGeneral", "AgencyWithholdingRatePoolExemptOrganization", "USWithholdingAgentForeignBranchOfFI", "QualifiedDerivativesDealer", "ForeignGovernmentIntegralPart", "ForeignGovernmentControlledEntity", "PubliclyTradedPartnership", "DisclosingQualifiedIntermediary"]) + return false unless chap3_status_code_validator.valid?(@chap3_status_code) + chap4_status_code_validator = EnumAttributeValidator.new('String', ["UsWithholdingAgentFi", "UsWithholdingAgentOther", "TerritoryFiNotTreatedAsUsPerson", "TerritoryFiTreatedAsUsPerson", "ParticipatingFfiOther", "ParticipatingFfiReportingModel2Ffi", "RegisteredDeemedCompliantFfiReportingModel1Ffi", "RegisteredDeemedCompliantFfiSponsoredEntity", "RegisteredDeemedCompliantFfiOther", "CertifiedDeemedCompliantFfiOther", "CertifiedDeemedCompliantFfiffiWithLowValueAccounts", "CertifiedDeemedCompliantFfiNonRegisteringLocalBank", "CertifiedDeemedCompliantFfiSponsoredEntity", "CertifiedDeemedCompliantFfiInvestmentAdvisorOrManager", "NonparticipatingFfi", "OwnerDocumentedFfi", "UsBranchTreatedAsUsPerson", "UsBranchNotTreatedAsUsPerson", "PassiveNffeIdentifyingSubstantialUsOwners", "PassiveNffeWithNoSubstantialUsOwners", "PubliclyTradedNffeOrAffiliate", "ActiveNffe", "Individual", "Section501CEntities", "ExceptedTerritoryNffe", "ExceptedNffeOther", "ExemptBeneficialOwner", "EntityWhollyOwnedByExemptBeneficialOwners", "UnknownRecipient", "RecalcitrantAccountHolder", "NonreportingIgafii", "DirectReportingNffe", "UsReportableAccount", "NonConsentingUsAccount", "SponsoredDirectReportingNffe", "ExceptedInterAffiliateFfi", "UndocumentedPreexistingObligation", "UsBranchEciPresumptionApplied", "AccountHolderOfExcludedFinancialAccount", "PassiveNffeReportedByFfi", "NffeSubjectTo1472Withholding", "RecalcitrantPoolNoUsIndicia", "RecalcitrantPoolUsIndicia", "RecalcitrantPoolDormantAccount", "RecalcitrantPoolUsPersons", "RecalcitrantPoolPassiveNffEs", "NonparticipatingFfiPool", "UsPayeesPool", "QiRecalcitrantPoolGeneral", "UsWithholdingAgentForeignBranchOfFi"]) + return false unless chap4_status_code_validator.valid?(@chap4_status_code) + return false if @recipient_name.nil? + return false if @recipient_name.to_s.length < 1 + tin_type_validator = EnumAttributeValidator.new('String', ["EIN", "SSN", "ITIN", "ATIN"]) + return false unless tin_type_validator.valid?(@tin_type) + return false if @address.nil? + return false if @address.to_s.length < 1 + return false if @city.nil? + return false if @city.to_s.length < 1 + return false if @country_code.nil? + return false if @country_code.to_s.length < 1 + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] lob_code Object to be assigned + def lob_code=(lob_code) + validator = EnumAttributeValidator.new('String', ["Individual", "GovernmentContractingState", "TaxExemptPensionTrust", "TaxExemptCharitableOrganization", "PubliclyTradedCorporation", "SubsidiaryOfPubliclyTradedCorporation", "CompanyOwnershipBaseErosionTest", "CompanyDerivativeBenefitsTest", "CompanyActiveTradeOrBusinessTest", "DiscretionaryDetermination", "Other", "NoLobArticleInTreaty"]) + unless validator.valid?(lob_code) + fail ArgumentError, "invalid value for \"lob_code\", must be one of #{validator.allowable_values}." + end + @lob_code = lob_code + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] exemption_code_chap3 Object to be assigned + def exemption_code_chap3=(exemption_code_chap3) + validator = EnumAttributeValidator.new('String', ["TaxRateDueToBackupWithholding", "EffectivelyConnectedIncome", "ExemptUnderIrc", "IncomeNotFromUsSources", "ExemptUnderTaxTreaty", "PortfolioInterestExemptUnderIrc", "QiThatAssumesPrimaryWithholdingResponsibility", "WfPorWft", "UsBranchTreatedAsUsPerson", "TerritoryFiTreatedAsUsPerson", "QiRepresentsIncomeExempt", "QslThatAssumesPrimaryWithholdingResponsibility", "PayeeSubjectedToChapter4Withholding", "QddThatAssumesPrimaryWithholdingResponsibility", "ExemptUnderSection897L", "ExemptUnderSection892"]) + unless validator.valid?(exemption_code_chap3) + fail ArgumentError, "invalid value for \"exemption_code_chap3\", must be one of #{validator.allowable_values}." + end + @exemption_code_chap3 = exemption_code_chap3 + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] exemption_code_chap4 Object to be assigned + def exemption_code_chap4=(exemption_code_chap4) + validator = EnumAttributeValidator.new('String', ["NotExempt", "GrandfatheredPayment", "EffectivelyConnectedIncome", "PayeeNotSubjectToChapter4Withholding", "ExcludedNonfinancialPayment", "ForeignEntityThatAssumesPrimaryWithholdingResponsibility", "UsPayeesOfParticipatingFfi", "ExemptFromWithholdingUnderIga", "DormantAccount", "OtherPaymentNotSubjectToChapter4Withholding"]) + unless validator.valid?(exemption_code_chap4) + fail ArgumentError, "invalid value for \"exemption_code_chap4\", must be one of #{validator.allowable_values}." + end + @exemption_code_chap4 = exemption_code_chap4 + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] chap3_status_code Object to be assigned + def chap3_status_code=(chap3_status_code) + validator = EnumAttributeValidator.new('String', ["USWithholdingAgentFI", "USWithholdingAgentOther", "TerritoryFITreatedAsUSPerson", "TerritoryFINotTreatedAsUSPerson", "USBranchTreatedAsUSPerson", "USBranchNotTreatedAsUSPerson", "USBranchECIPresumptionApplied", "PartnershipOtherThanWithholdingForeignPartnership", "WithholdingForeignPartnership", "TrustOtherThanWithholdingForeignTrust", "WithholdingForeignTrust", "QualifiedIntermediary", "QualifiedSecuritiesLenderQualifiedIntermediary", "QualifiedSecuritiesLenderOther", "Corporation", "Individual", "Estate", "PrivateFoundation", "GovernmentOrInternationalOrganization", "TaxExemptOrganizationSection501cEntities", "UnknownRecipient", "ArtistOrAthlete", "Pension", "ForeignCentralBankOfIssue", "NonqualifiedIntermediary", "HybridEntityMakingTreatyClaim", "WithholdingRatePoolGeneral", "WithholdingRatePoolExemptOrganization", "PAIWithholdingRatePoolGeneral", "PAIWithholdingRatePoolExemptOrganization", "AgencyWithholdingRatePoolGeneral", "AgencyWithholdingRatePoolExemptOrganization", "USWithholdingAgentForeignBranchOfFI", "QualifiedDerivativesDealer", "ForeignGovernmentIntegralPart", "ForeignGovernmentControlledEntity", "PubliclyTradedPartnership", "DisclosingQualifiedIntermediary"]) + unless validator.valid?(chap3_status_code) + fail ArgumentError, "invalid value for \"chap3_status_code\", must be one of #{validator.allowable_values}." + end + @chap3_status_code = chap3_status_code + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] chap4_status_code Object to be assigned + def chap4_status_code=(chap4_status_code) + validator = EnumAttributeValidator.new('String', ["UsWithholdingAgentFi", "UsWithholdingAgentOther", "TerritoryFiNotTreatedAsUsPerson", "TerritoryFiTreatedAsUsPerson", "ParticipatingFfiOther", "ParticipatingFfiReportingModel2Ffi", "RegisteredDeemedCompliantFfiReportingModel1Ffi", "RegisteredDeemedCompliantFfiSponsoredEntity", "RegisteredDeemedCompliantFfiOther", "CertifiedDeemedCompliantFfiOther", "CertifiedDeemedCompliantFfiffiWithLowValueAccounts", "CertifiedDeemedCompliantFfiNonRegisteringLocalBank", "CertifiedDeemedCompliantFfiSponsoredEntity", "CertifiedDeemedCompliantFfiInvestmentAdvisorOrManager", "NonparticipatingFfi", "OwnerDocumentedFfi", "UsBranchTreatedAsUsPerson", "UsBranchNotTreatedAsUsPerson", "PassiveNffeIdentifyingSubstantialUsOwners", "PassiveNffeWithNoSubstantialUsOwners", "PubliclyTradedNffeOrAffiliate", "ActiveNffe", "Individual", "Section501CEntities", "ExceptedTerritoryNffe", "ExceptedNffeOther", "ExemptBeneficialOwner", "EntityWhollyOwnedByExemptBeneficialOwners", "UnknownRecipient", "RecalcitrantAccountHolder", "NonreportingIgafii", "DirectReportingNffe", "UsReportableAccount", "NonConsentingUsAccount", "SponsoredDirectReportingNffe", "ExceptedInterAffiliateFfi", "UndocumentedPreexistingObligation", "UsBranchEciPresumptionApplied", "AccountHolderOfExcludedFinancialAccount", "PassiveNffeReportedByFfi", "NffeSubjectTo1472Withholding", "RecalcitrantPoolNoUsIndicia", "RecalcitrantPoolUsIndicia", "RecalcitrantPoolDormantAccount", "RecalcitrantPoolUsPersons", "RecalcitrantPoolPassiveNffEs", "NonparticipatingFfiPool", "UsPayeesPool", "QiRecalcitrantPoolGeneral", "UsWithholdingAgentForeignBranchOfFi"]) + unless validator.valid?(chap4_status_code) + fail ArgumentError, "invalid value for \"chap4_status_code\", must be one of #{validator.allowable_values}." + end + @chap4_status_code = chap4_status_code + end + + # Custom attribute writer method with validation + # @param [Object] recipient_name Value to be assigned + def recipient_name=(recipient_name) + if recipient_name.nil? + fail ArgumentError, 'recipient_name cannot be nil' + end + + if recipient_name.to_s.length < 1 + fail ArgumentError, 'invalid value for "recipient_name", the character length must be great than or equal to 1.' + end + + @recipient_name = recipient_name + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] tin_type Object to be assigned + def tin_type=(tin_type) + validator = EnumAttributeValidator.new('String', ["EIN", "SSN", "ITIN", "ATIN"]) + unless validator.valid?(tin_type) + fail ArgumentError, "invalid value for \"tin_type\", must be one of #{validator.allowable_values}." + end + @tin_type = tin_type + end + + # Custom attribute writer method with validation + # @param [Object] address Value to be assigned + def address=(address) + if address.nil? + fail ArgumentError, 'address cannot be nil' + end + + if address.to_s.length < 1 + fail ArgumentError, 'invalid value for "address", the character length must be great than or equal to 1.' + end + + @address = address + end + + # Custom attribute writer method with validation + # @param [Object] city Value to be assigned + def city=(city) + if city.nil? + fail ArgumentError, 'city cannot be nil' + end + + if city.to_s.length < 1 + fail ArgumentError, 'invalid value for "city", the character length must be great than or equal to 1.' + end + + @city = city + end + + # Custom attribute writer method with validation + # @param [Object] country_code Value to be assigned + def country_code=(country_code) + if country_code.nil? + fail ArgumentError, 'country_code cannot be nil' + end + + if country_code.to_s.length < 1 + fail ArgumentError, 'invalid value for "country_code", the character length must be great than or equal to 1.' + end + + @country_code = country_code + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + unique_form_id == o.unique_form_id && + no_tin == o.no_tin && + recipient_date_of_birth == o.recipient_date_of_birth && + recipient_giin == o.recipient_giin && + recipient_foreign_tin == o.recipient_foreign_tin && + lob_code == o.lob_code && + income_code == o.income_code && + gross_income == o.gross_income && + withholding_indicator == o.withholding_indicator && + tax_country_code == o.tax_country_code && + exemption_code_chap3 == o.exemption_code_chap3 && + exemption_code_chap4 == o.exemption_code_chap4 && + tax_rate_chap3 == o.tax_rate_chap3 && + withholding_allowance == o.withholding_allowance && + federal_tax_withheld == o.federal_tax_withheld && + tax_not_deposited_indicator == o.tax_not_deposited_indicator && + academic_indicator == o.academic_indicator && + tax_withheld_other_agents == o.tax_withheld_other_agents && + amount_repaid == o.amount_repaid && + tax_paid_agent == o.tax_paid_agent && + chap3_status_code == o.chap3_status_code && + chap4_status_code == o.chap4_status_code && + primary_withholding_agent == o.primary_withholding_agent && + intermediary_or_flow_through == o.intermediary_or_flow_through && + issuer_id == o.issuer_id && + reference_id == o.reference_id && + recipient_tin == o.recipient_tin && + recipient_name == o.recipient_name && + tin_type == o.tin_type && + recipient_second_name == o.recipient_second_name && + address == o.address && + address2 == o.address2 && + city == o.city && + state == o.state && + zip == o.zip && + recipient_email == o.recipient_email && + account_number == o.account_number && + office_code == o.office_code && + recipient_non_us_province == o.recipient_non_us_province && + country_code == o.country_code && + federal_e_file == o.federal_e_file && + postal_mail == o.postal_mail && + state_e_file == o.state_e_file && + tin_match == o.tin_match && + address_verification == o.address_verification && + state_and_local_withholding == o.state_and_local_withholding + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [unique_form_id, no_tin, recipient_date_of_birth, recipient_giin, recipient_foreign_tin, lob_code, income_code, gross_income, withholding_indicator, tax_country_code, exemption_code_chap3, exemption_code_chap4, tax_rate_chap3, withholding_allowance, federal_tax_withheld, tax_not_deposited_indicator, academic_indicator, tax_withheld_other_agents, amount_repaid, tax_paid_agent, chap3_status_code, chap4_status_code, primary_withholding_agent, intermediary_or_flow_through, issuer_id, reference_id, recipient_tin, recipient_name, tin_type, recipient_second_name, address, address2, city, state, zip, recipient_email, account_number, office_code, recipient_non_us_province, country_code, federal_e_file, postal_mail, state_e_file, tin_match, address_verification, state_and_local_withholding].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::A1099::V2.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/A1099/V2/form1042_s_list_item_response.rb b/lib/avalara_sdk/models/A1099/V2/form1042_s_list_item_response.rb new file mode 100644 index 0000000..0aebc4b --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/form1042_s_list_item_response.rb @@ -0,0 +1,925 @@ +=begin +#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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class Form1042SListItemResponse + # Unique form identifier + attr_accessor :unique_form_id + + # No TIN indicator + attr_accessor :no_tin + + # Recipient's date of birth + attr_accessor :recipient_date_of_birth + + # Recipient's GIIN (Global Intermediary Identification Number) + attr_accessor :recipient_giin + + # Recipient's foreign TIN + attr_accessor :recipient_foreign_tin + + # Limitation on benefits code + attr_accessor :lob_code + + # Income code + attr_accessor :income_code + + # Gross income + attr_accessor :gross_income + + # Withholding indicator + attr_accessor :withholding_indicator + + # Country code + attr_accessor :tax_country_code + + # Exemption code (Chapter 3) + attr_accessor :exemption_code_chap3 + + # Exemption code (Chapter 4) + attr_accessor :exemption_code_chap4 + + # Tax rate (Chapter 3) + attr_accessor :tax_rate_chap3 + + # Withholding allowance + attr_accessor :withholding_allowance + + # Federal tax withheld + attr_accessor :federal_tax_withheld + + # Tax not deposited indicator + attr_accessor :tax_not_deposited_indicator + + # Academic indicator + attr_accessor :academic_indicator + + # Tax withheld by other agents + attr_accessor :tax_withheld_other_agents + + # Amount repaid to recipient + attr_accessor :amount_repaid + + # Tax paid by withholding agent + attr_accessor :tax_paid_agent + + # Chapter 3 status code + attr_accessor :chap3_status_code + + # Chapter 4 status code + attr_accessor :chap4_status_code + + # Primary withholding agent information + attr_accessor :primary_withholding_agent + + # Intermediary or flow-through entity information + attr_accessor :intermediary_or_flow_through + + # ID of the form + attr_accessor :id + + # 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 + attr_accessor :type + + # Issuer ID + attr_accessor :issuer_id + + # Issuer Reference ID + attr_accessor :issuer_reference_id + + # Issuer TIN + attr_accessor :issuer_tin + + # Tax year + attr_accessor :tax_year + + # Boolean indicating that federal e-filing has been scheduled for this form + attr_accessor :federal_efile + + # Federal e-file status + attr_accessor :federal_efile_status + + # Boolean indicating that state e-filing has been scheduled for this form + attr_accessor :state_efile + + # State e-file status + attr_accessor :state_efile_status + + # Boolean indicating that postal mailing to the recipient has been scheduled for this form + attr_accessor :postal_mail + + # Postal mail to recipient status + attr_accessor :postal_mail_status + + # Boolean indicating that TIN Matching has been scheduled for this form + attr_accessor :tin_match + + # TIN Match status + attr_accessor :tin_match_status + + # Boolean indicating that address verification has been scheduled for this form + attr_accessor :address_verification + + # Address verification status + attr_accessor :address_verification_status + + # Reference ID + attr_accessor :reference_id + + # Recipient email address + attr_accessor :email + + # Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN + attr_accessor :tin_type + + # Recipient Tax ID Number + attr_accessor :tin + + # Recipient name + attr_accessor :recipient_name + + # Recipient second name + attr_accessor :recipient_second_name + + # Address + attr_accessor :address + + # Address line 2 + attr_accessor :address2 + + # City + attr_accessor :city + + # US state + attr_accessor :state + + # Zip/postal code + attr_accessor :zip + + # Foreign province + attr_accessor :foreign_province + + # Country code, as defined at https://www.irs.gov/e-file-providers/country-codes + attr_accessor :country_code + + # Validation errors + attr_accessor :validation_errors + + # Creation time + attr_accessor :created_at + + # Update time + attr_accessor :updated_at + + attr_accessor :state_and_local_withholding + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'unique_form_id' => :'uniqueFormId', + :'no_tin' => :'noTin', + :'recipient_date_of_birth' => :'recipientDateOfBirth', + :'recipient_giin' => :'recipientGiin', + :'recipient_foreign_tin' => :'recipientForeignTin', + :'lob_code' => :'lobCode', + :'income_code' => :'incomeCode', + :'gross_income' => :'grossIncome', + :'withholding_indicator' => :'withholdingIndicator', + :'tax_country_code' => :'taxCountryCode', + :'exemption_code_chap3' => :'exemptionCodeChap3', + :'exemption_code_chap4' => :'exemptionCodeChap4', + :'tax_rate_chap3' => :'taxRateChap3', + :'withholding_allowance' => :'withholdingAllowance', + :'federal_tax_withheld' => :'federalTaxWithheld', + :'tax_not_deposited_indicator' => :'taxNotDepositedIndicator', + :'academic_indicator' => :'academicIndicator', + :'tax_withheld_other_agents' => :'taxWithheldOtherAgents', + :'amount_repaid' => :'amountRepaid', + :'tax_paid_agent' => :'taxPaidAgent', + :'chap3_status_code' => :'chap3StatusCode', + :'chap4_status_code' => :'chap4StatusCode', + :'primary_withholding_agent' => :'primaryWithholdingAgent', + :'intermediary_or_flow_through' => :'intermediaryOrFlowThrough', + :'id' => :'id', + :'type' => :'type', + :'issuer_id' => :'issuerId', + :'issuer_reference_id' => :'issuerReferenceId', + :'issuer_tin' => :'issuerTin', + :'tax_year' => :'taxYear', + :'federal_efile' => :'federalEfile', + :'federal_efile_status' => :'federalEfileStatus', + :'state_efile' => :'stateEfile', + :'state_efile_status' => :'stateEfileStatus', + :'postal_mail' => :'postalMail', + :'postal_mail_status' => :'postalMailStatus', + :'tin_match' => :'tinMatch', + :'tin_match_status' => :'tinMatchStatus', + :'address_verification' => :'addressVerification', + :'address_verification_status' => :'addressVerificationStatus', + :'reference_id' => :'referenceId', + :'email' => :'email', + :'tin_type' => :'tinType', + :'tin' => :'tin', + :'recipient_name' => :'recipientName', + :'recipient_second_name' => :'recipientSecondName', + :'address' => :'address', + :'address2' => :'address2', + :'city' => :'city', + :'state' => :'state', + :'zip' => :'zip', + :'foreign_province' => :'foreignProvince', + :'country_code' => :'countryCode', + :'validation_errors' => :'validationErrors', + :'created_at' => :'createdAt', + :'updated_at' => :'updatedAt', + :'state_and_local_withholding' => :'stateAndLocalWithholding' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'unique_form_id' => :'String', + :'no_tin' => :'Boolean', + :'recipient_date_of_birth' => :'Time', + :'recipient_giin' => :'String', + :'recipient_foreign_tin' => :'String', + :'lob_code' => :'String', + :'income_code' => :'String', + :'gross_income' => :'Float', + :'withholding_indicator' => :'String', + :'tax_country_code' => :'String', + :'exemption_code_chap3' => :'String', + :'exemption_code_chap4' => :'String', + :'tax_rate_chap3' => :'String', + :'withholding_allowance' => :'Float', + :'federal_tax_withheld' => :'Float', + :'tax_not_deposited_indicator' => :'Boolean', + :'academic_indicator' => :'Boolean', + :'tax_withheld_other_agents' => :'Float', + :'amount_repaid' => :'Float', + :'tax_paid_agent' => :'Float', + :'chap3_status_code' => :'String', + :'chap4_status_code' => :'String', + :'primary_withholding_agent' => :'PrimaryWithholdingAgentResponse', + :'intermediary_or_flow_through' => :'IntermediaryOrFlowThroughResponse', + :'id' => :'String', + :'type' => :'String', + :'issuer_id' => :'Integer', + :'issuer_reference_id' => :'String', + :'issuer_tin' => :'String', + :'tax_year' => :'Integer', + :'federal_efile' => :'Boolean', + :'federal_efile_status' => :'Form1099StatusDetailResponse', + :'state_efile' => :'Boolean', + :'state_efile_status' => :'Array', + :'postal_mail' => :'Boolean', + :'postal_mail_status' => :'Form1099StatusDetailResponse', + :'tin_match' => :'Boolean', + :'tin_match_status' => :'Form1099StatusDetailResponse', + :'address_verification' => :'Boolean', + :'address_verification_status' => :'Form1099StatusDetailResponse', + :'reference_id' => :'String', + :'email' => :'String', + :'tin_type' => :'String', + :'tin' => :'String', + :'recipient_name' => :'String', + :'recipient_second_name' => :'String', + :'address' => :'String', + :'address2' => :'String', + :'city' => :'String', + :'state' => :'String', + :'zip' => :'String', + :'foreign_province' => :'String', + :'country_code' => :'String', + :'validation_errors' => :'Array', + :'created_at' => :'Time', + :'updated_at' => :'Time', + :'state_and_local_withholding' => :'StateAndLocalWithholdingResponse' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'no_tin', + :'recipient_date_of_birth', + :'recipient_giin', + :'recipient_foreign_tin', + :'lob_code', + :'exemption_code_chap3', + :'exemption_code_chap4', + :'tax_rate_chap3', + :'withholding_allowance', + :'federal_tax_withheld', + :'tax_not_deposited_indicator', + :'academic_indicator', + :'tax_withheld_other_agents', + :'amount_repaid', + :'tax_paid_agent', + :'chap3_status_code', + :'chap4_status_code', + :'issuer_reference_id', + :'issuer_tin', + :'state_efile_status', + :'postal_mail_status', + :'tin_match_status', + :'address_verification_status', + :'reference_id', + :'email', + :'tin_type', + :'tin', + :'recipient_name', + :'recipient_second_name', + :'address', + :'address2', + :'city', + :'state', + :'zip', + :'foreign_province', + :'country_code', + :'validation_errors', + :'state_and_local_withholding' + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'Form1099BaseResponse' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::A1099::V2::Form1042SListItemResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::A1099::V2::Form1042SListItemResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'unique_form_id') + self.unique_form_id = attributes[:'unique_form_id'] + end + + if attributes.key?(:'no_tin') + self.no_tin = attributes[:'no_tin'] + end + + if attributes.key?(:'recipient_date_of_birth') + self.recipient_date_of_birth = attributes[:'recipient_date_of_birth'] + end + + if attributes.key?(:'recipient_giin') + self.recipient_giin = attributes[:'recipient_giin'] + end + + if attributes.key?(:'recipient_foreign_tin') + self.recipient_foreign_tin = attributes[:'recipient_foreign_tin'] + end + + if attributes.key?(:'lob_code') + self.lob_code = attributes[:'lob_code'] + end + + if attributes.key?(:'income_code') + self.income_code = attributes[:'income_code'] + end + + if attributes.key?(:'gross_income') + self.gross_income = attributes[:'gross_income'] + end + + if attributes.key?(:'withholding_indicator') + self.withholding_indicator = attributes[:'withholding_indicator'] + end + + if attributes.key?(:'tax_country_code') + self.tax_country_code = attributes[:'tax_country_code'] + end + + if attributes.key?(:'exemption_code_chap3') + self.exemption_code_chap3 = attributes[:'exemption_code_chap3'] + end + + if attributes.key?(:'exemption_code_chap4') + self.exemption_code_chap4 = attributes[:'exemption_code_chap4'] + end + + if attributes.key?(:'tax_rate_chap3') + self.tax_rate_chap3 = attributes[:'tax_rate_chap3'] + end + + if attributes.key?(:'withholding_allowance') + self.withholding_allowance = attributes[:'withholding_allowance'] + end + + if attributes.key?(:'federal_tax_withheld') + self.federal_tax_withheld = attributes[:'federal_tax_withheld'] + end + + if attributes.key?(:'tax_not_deposited_indicator') + self.tax_not_deposited_indicator = attributes[:'tax_not_deposited_indicator'] + end + + if attributes.key?(:'academic_indicator') + self.academic_indicator = attributes[:'academic_indicator'] + end + + if attributes.key?(:'tax_withheld_other_agents') + self.tax_withheld_other_agents = attributes[:'tax_withheld_other_agents'] + end + + if attributes.key?(:'amount_repaid') + self.amount_repaid = attributes[:'amount_repaid'] + end + + if attributes.key?(:'tax_paid_agent') + self.tax_paid_agent = attributes[:'tax_paid_agent'] + end + + if attributes.key?(:'chap3_status_code') + self.chap3_status_code = attributes[:'chap3_status_code'] + end + + if attributes.key?(:'chap4_status_code') + self.chap4_status_code = attributes[:'chap4_status_code'] + end + + if attributes.key?(:'primary_withholding_agent') + self.primary_withholding_agent = attributes[:'primary_withholding_agent'] + end + + if attributes.key?(:'intermediary_or_flow_through') + self.intermediary_or_flow_through = attributes[:'intermediary_or_flow_through'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + else + self.id = nil + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + else + self.type = nil + end + + if attributes.key?(:'issuer_id') + self.issuer_id = attributes[:'issuer_id'] + else + self.issuer_id = nil + end + + if attributes.key?(:'issuer_reference_id') + self.issuer_reference_id = attributes[:'issuer_reference_id'] + end + + if attributes.key?(:'issuer_tin') + self.issuer_tin = attributes[:'issuer_tin'] + end + + if attributes.key?(:'tax_year') + self.tax_year = attributes[:'tax_year'] + end + + if attributes.key?(:'federal_efile') + self.federal_efile = attributes[:'federal_efile'] + else + self.federal_efile = nil + end + + if attributes.key?(:'federal_efile_status') + self.federal_efile_status = attributes[:'federal_efile_status'] + end + + if attributes.key?(:'state_efile') + self.state_efile = attributes[:'state_efile'] + else + self.state_efile = nil + end + + if attributes.key?(:'state_efile_status') + if (value = attributes[:'state_efile_status']).is_a?(Array) + self.state_efile_status = value + end + end + + if attributes.key?(:'postal_mail') + self.postal_mail = attributes[:'postal_mail'] + else + self.postal_mail = nil + end + + if attributes.key?(:'postal_mail_status') + self.postal_mail_status = attributes[:'postal_mail_status'] + end + + if attributes.key?(:'tin_match') + self.tin_match = attributes[:'tin_match'] + else + self.tin_match = nil + end + + if attributes.key?(:'tin_match_status') + self.tin_match_status = attributes[:'tin_match_status'] + end + + if attributes.key?(:'address_verification') + self.address_verification = attributes[:'address_verification'] + else + self.address_verification = nil + end + + if attributes.key?(:'address_verification_status') + self.address_verification_status = attributes[:'address_verification_status'] + end + + if attributes.key?(:'reference_id') + self.reference_id = attributes[:'reference_id'] + end + + if attributes.key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.key?(:'tin_type') + self.tin_type = attributes[:'tin_type'] + end + + if attributes.key?(:'tin') + self.tin = attributes[:'tin'] + end + + if attributes.key?(:'recipient_name') + self.recipient_name = attributes[:'recipient_name'] + end + + if attributes.key?(:'recipient_second_name') + self.recipient_second_name = attributes[:'recipient_second_name'] + end + + if attributes.key?(:'address') + self.address = attributes[:'address'] + end + + if attributes.key?(:'address2') + self.address2 = attributes[:'address2'] + end + + if attributes.key?(:'city') + self.city = attributes[:'city'] + end + + if attributes.key?(:'state') + self.state = attributes[:'state'] + end + + if attributes.key?(:'zip') + self.zip = attributes[:'zip'] + end + + if attributes.key?(:'foreign_province') + self.foreign_province = attributes[:'foreign_province'] + end + + if attributes.key?(:'country_code') + self.country_code = attributes[:'country_code'] + end + + if attributes.key?(:'validation_errors') + if (value = attributes[:'validation_errors']).is_a?(Array) + self.validation_errors = value + end + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + end + + if attributes.key?(:'state_and_local_withholding') + self.state_and_local_withholding = attributes[:'state_and_local_withholding'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @id.nil? + invalid_properties.push('invalid value for "id", id cannot be nil.') + end + + if @id.to_s.length < 1 + invalid_properties.push('invalid value for "id", the character length must be great than or equal to 1.') + end + + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @type.to_s.length < 1 + invalid_properties.push('invalid value for "type", the character length must be great than or equal to 1.') + end + + if @issuer_id.nil? + invalid_properties.push('invalid value for "issuer_id", issuer_id cannot be nil.') + end + + if @federal_efile.nil? + invalid_properties.push('invalid value for "federal_efile", federal_efile cannot be nil.') + end + + if @state_efile.nil? + invalid_properties.push('invalid value for "state_efile", state_efile cannot be nil.') + end + + if @postal_mail.nil? + invalid_properties.push('invalid value for "postal_mail", postal_mail cannot be nil.') + end + + if @tin_match.nil? + invalid_properties.push('invalid value for "tin_match", tin_match cannot be nil.') + end + + if @address_verification.nil? + invalid_properties.push('invalid value for "address_verification", address_verification cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @id.nil? + return false if @id.to_s.length < 1 + return false if @type.nil? + return false if @type.to_s.length < 1 + return false if @issuer_id.nil? + return false if @federal_efile.nil? + return false if @state_efile.nil? + return false if @postal_mail.nil? + return false if @tin_match.nil? + return false if @address_verification.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + if id.to_s.length < 1 + fail ArgumentError, 'invalid value for "id", the character length must be great than or equal to 1.' + end + + @id = id + end + + # Custom attribute writer method with validation + # @param [Object] type Value to be assigned + def type=(type) + if type.nil? + fail ArgumentError, 'type cannot be nil' + end + + if type.to_s.length < 1 + fail ArgumentError, 'invalid value for "type", the character length must be great than or equal to 1.' + end + + @type = type + end + + # Custom attribute writer method with validation + # @param [Object] state_efile_status Value to be assigned + def state_efile_status=(state_efile_status) + @state_efile_status = state_efile_status + end + + # Custom attribute writer method with validation + # @param [Object] validation_errors Value to be assigned + def validation_errors=(validation_errors) + @validation_errors = validation_errors + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + unique_form_id == o.unique_form_id && + no_tin == o.no_tin && + recipient_date_of_birth == o.recipient_date_of_birth && + recipient_giin == o.recipient_giin && + recipient_foreign_tin == o.recipient_foreign_tin && + lob_code == o.lob_code && + income_code == o.income_code && + gross_income == o.gross_income && + withholding_indicator == o.withholding_indicator && + tax_country_code == o.tax_country_code && + exemption_code_chap3 == o.exemption_code_chap3 && + exemption_code_chap4 == o.exemption_code_chap4 && + tax_rate_chap3 == o.tax_rate_chap3 && + withholding_allowance == o.withholding_allowance && + federal_tax_withheld == o.federal_tax_withheld && + tax_not_deposited_indicator == o.tax_not_deposited_indicator && + academic_indicator == o.academic_indicator && + tax_withheld_other_agents == o.tax_withheld_other_agents && + amount_repaid == o.amount_repaid && + tax_paid_agent == o.tax_paid_agent && + chap3_status_code == o.chap3_status_code && + chap4_status_code == o.chap4_status_code && + primary_withholding_agent == o.primary_withholding_agent && + intermediary_or_flow_through == o.intermediary_or_flow_through && + id == o.id && + type == o.type && + issuer_id == o.issuer_id && + issuer_reference_id == o.issuer_reference_id && + issuer_tin == o.issuer_tin && + tax_year == o.tax_year && + federal_efile == o.federal_efile && + federal_efile_status == o.federal_efile_status && + state_efile == o.state_efile && + state_efile_status == o.state_efile_status && + postal_mail == o.postal_mail && + postal_mail_status == o.postal_mail_status && + tin_match == o.tin_match && + tin_match_status == o.tin_match_status && + address_verification == o.address_verification && + address_verification_status == o.address_verification_status && + reference_id == o.reference_id && + email == o.email && + tin_type == o.tin_type && + tin == o.tin && + recipient_name == o.recipient_name && + recipient_second_name == o.recipient_second_name && + address == o.address && + address2 == o.address2 && + city == o.city && + state == o.state && + zip == o.zip && + foreign_province == o.foreign_province && + country_code == o.country_code && + validation_errors == o.validation_errors && + created_at == o.created_at && + updated_at == o.updated_at && + state_and_local_withholding == o.state_and_local_withholding + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [unique_form_id, no_tin, recipient_date_of_birth, recipient_giin, recipient_foreign_tin, lob_code, income_code, gross_income, withholding_indicator, tax_country_code, exemption_code_chap3, exemption_code_chap4, tax_rate_chap3, withholding_allowance, federal_tax_withheld, tax_not_deposited_indicator, academic_indicator, tax_withheld_other_agents, amount_repaid, tax_paid_agent, chap3_status_code, chap4_status_code, primary_withholding_agent, intermediary_or_flow_through, id, type, issuer_id, issuer_reference_id, issuer_tin, tax_year, federal_efile, federal_efile_status, state_efile, state_efile_status, postal_mail, postal_mail_status, tin_match, tin_match_status, address_verification, address_verification_status, reference_id, email, tin_type, tin, recipient_name, recipient_second_name, address, address2, city, state, zip, foreign_province, country_code, validation_errors, created_at, updated_at, state_and_local_withholding].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::A1099::V2.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/A1099/V2/form1042_s_request.rb b/lib/avalara_sdk/models/A1099/V2/form1042_s_request.rb new file mode 100644 index 0000000..226d58a --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/form1042_s_request.rb @@ -0,0 +1,855 @@ +=begin +#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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class Form1042SRequest + # Unique form identifier + attr_accessor :unique_form_id + + # No TIN indicator + attr_accessor :no_tin + + # Recipient's date of birth + attr_accessor :recipient_date_of_birth + + # Recipient's GIIN (Global Intermediary Identification Number) + attr_accessor :recipient_giin + + # Recipient's foreign TIN + attr_accessor :recipient_foreign_tin + + # Limitation on benefits code + attr_accessor :lob_code + + # Income code + attr_accessor :income_code + + # Gross income + attr_accessor :gross_income + + # Withholding indicator + attr_accessor :withholding_indicator + + # Country code + attr_accessor :tax_country_code + + # Exemption code (Chapter 3) + attr_accessor :exemption_code_chap3 + + # Exemption code (Chapter 4) + attr_accessor :exemption_code_chap4 + + # Tax rate (Chapter 3) + attr_accessor :tax_rate_chap3 + + # Withholding allowance + attr_accessor :withholding_allowance + + # Federal tax withheld + attr_accessor :federal_tax_withheld + + # Tax not deposited indicator + attr_accessor :tax_not_deposited_indicator + + # Academic indicator + attr_accessor :academic_indicator + + # Tax withheld by other agents + attr_accessor :tax_withheld_other_agents + + # Amount repaid to recipient + attr_accessor :amount_repaid + + # Tax paid by withholding agent + attr_accessor :tax_paid_agent + + # Chapter 3 status code + attr_accessor :chap3_status_code + + # Chapter 4 status code + attr_accessor :chap4_status_code + + # Primary withholding agent information + attr_accessor :primary_withholding_agent + + # Intermediary or flow-through entity information + attr_accessor :intermediary_or_flow_through + + # State and local withholding information + attr_accessor :state_and_local_withholding + + attr_accessor :type + + # Issuer ID + attr_accessor :issuer_id + + # Reference ID + attr_accessor :reference_id + + # Recipient Tax ID Number + attr_accessor :recipient_tin + + # Recipient name + attr_accessor :recipient_name + + # Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN + attr_accessor :tin_type + + # Recipient second name + attr_accessor :recipient_second_name + + # Address + attr_accessor :address + + # Address line 2 + attr_accessor :address2 + + # City + attr_accessor :city + + # US state. Required if CountryCode is \"US\". + attr_accessor :state + + # Zip/postal code + attr_accessor :zip + + # Recipient email address + attr_accessor :recipient_email + + # Account number + attr_accessor :account_number + + # Office code + attr_accessor :office_code + + # Foreign province + attr_accessor :recipient_non_us_province + + # Country code, as defined at https://www.irs.gov/e-file-providers/country-codes + attr_accessor :country_code + + # Boolean indicating that federal e-filing should be scheduled for this form + attr_accessor :federal_e_file + + # Boolean indicating that postal mailing to the recipient should be scheduled for this form + attr_accessor :postal_mail + + # Boolean indicating that state e-filing should be scheduled for this form + attr_accessor :state_e_file + + # Boolean indicating that TIN Matching should be scheduled for this form + attr_accessor :tin_match + + # Boolean indicating that address verification should be scheduled for this form + attr_accessor :address_verification + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'unique_form_id' => :'uniqueFormId', + :'no_tin' => :'noTin', + :'recipient_date_of_birth' => :'recipientDateOfBirth', + :'recipient_giin' => :'recipientGiin', + :'recipient_foreign_tin' => :'recipientForeignTin', + :'lob_code' => :'lobCode', + :'income_code' => :'incomeCode', + :'gross_income' => :'grossIncome', + :'withholding_indicator' => :'withholdingIndicator', + :'tax_country_code' => :'taxCountryCode', + :'exemption_code_chap3' => :'exemptionCodeChap3', + :'exemption_code_chap4' => :'exemptionCodeChap4', + :'tax_rate_chap3' => :'taxRateChap3', + :'withholding_allowance' => :'withholdingAllowance', + :'federal_tax_withheld' => :'federalTaxWithheld', + :'tax_not_deposited_indicator' => :'taxNotDepositedIndicator', + :'academic_indicator' => :'academicIndicator', + :'tax_withheld_other_agents' => :'taxWithheldOtherAgents', + :'amount_repaid' => :'amountRepaid', + :'tax_paid_agent' => :'taxPaidAgent', + :'chap3_status_code' => :'chap3StatusCode', + :'chap4_status_code' => :'chap4StatusCode', + :'primary_withholding_agent' => :'primaryWithholdingAgent', + :'intermediary_or_flow_through' => :'intermediaryOrFlowThrough', + :'state_and_local_withholding' => :'stateAndLocalWithholding', + :'type' => :'type', + :'issuer_id' => :'issuerId', + :'reference_id' => :'referenceId', + :'recipient_tin' => :'recipientTin', + :'recipient_name' => :'recipientName', + :'tin_type' => :'tinType', + :'recipient_second_name' => :'recipientSecondName', + :'address' => :'address', + :'address2' => :'address2', + :'city' => :'city', + :'state' => :'state', + :'zip' => :'zip', + :'recipient_email' => :'recipientEmail', + :'account_number' => :'accountNumber', + :'office_code' => :'officeCode', + :'recipient_non_us_province' => :'recipientNonUsProvince', + :'country_code' => :'countryCode', + :'federal_e_file' => :'federalEFile', + :'postal_mail' => :'postalMail', + :'state_e_file' => :'stateEFile', + :'tin_match' => :'tinMatch', + :'address_verification' => :'addressVerification' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'unique_form_id' => :'String', + :'no_tin' => :'Boolean', + :'recipient_date_of_birth' => :'Time', + :'recipient_giin' => :'String', + :'recipient_foreign_tin' => :'String', + :'lob_code' => :'String', + :'income_code' => :'String', + :'gross_income' => :'Float', + :'withholding_indicator' => :'String', + :'tax_country_code' => :'String', + :'exemption_code_chap3' => :'String', + :'exemption_code_chap4' => :'String', + :'tax_rate_chap3' => :'String', + :'withholding_allowance' => :'Float', + :'federal_tax_withheld' => :'Float', + :'tax_not_deposited_indicator' => :'Boolean', + :'academic_indicator' => :'Boolean', + :'tax_withheld_other_agents' => :'Float', + :'amount_repaid' => :'Float', + :'tax_paid_agent' => :'Float', + :'chap3_status_code' => :'String', + :'chap4_status_code' => :'String', + :'primary_withholding_agent' => :'PrimaryWithholdingAgentRequest', + :'intermediary_or_flow_through' => :'IntermediaryOrFlowThroughRequest', + :'state_and_local_withholding' => :'StateAndLocalWithholdingRequest', + :'type' => :'String', + :'issuer_id' => :'String', + :'reference_id' => :'String', + :'recipient_tin' => :'String', + :'recipient_name' => :'String', + :'tin_type' => :'String', + :'recipient_second_name' => :'String', + :'address' => :'String', + :'address2' => :'String', + :'city' => :'String', + :'state' => :'String', + :'zip' => :'String', + :'recipient_email' => :'String', + :'account_number' => :'String', + :'office_code' => :'String', + :'recipient_non_us_province' => :'String', + :'country_code' => :'String', + :'federal_e_file' => :'Boolean', + :'postal_mail' => :'Boolean', + :'state_e_file' => :'Boolean', + :'tin_match' => :'Boolean', + :'address_verification' => :'Boolean' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'no_tin', + :'recipient_date_of_birth', + :'recipient_giin', + :'recipient_foreign_tin', + :'lob_code', + :'income_code', + :'withholding_indicator', + :'tax_country_code', + :'exemption_code_chap3', + :'exemption_code_chap4', + :'tax_rate_chap3', + :'withholding_allowance', + :'federal_tax_withheld', + :'tax_not_deposited_indicator', + :'academic_indicator', + :'tax_withheld_other_agents', + :'amount_repaid', + :'tax_paid_agent', + :'chap3_status_code', + :'chap4_status_code', + :'issuer_id', + :'reference_id', + :'recipient_second_name', + :'address2', + :'recipient_email', + :'account_number', + :'office_code', + :'recipient_non_us_province', + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'FormSingleRequestBase' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::A1099::V2::Form1042SRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::A1099::V2::Form1042SRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'unique_form_id') + self.unique_form_id = attributes[:'unique_form_id'] + end + + if attributes.key?(:'no_tin') + self.no_tin = attributes[:'no_tin'] + end + + if attributes.key?(:'recipient_date_of_birth') + self.recipient_date_of_birth = attributes[:'recipient_date_of_birth'] + end + + if attributes.key?(:'recipient_giin') + self.recipient_giin = attributes[:'recipient_giin'] + end + + if attributes.key?(:'recipient_foreign_tin') + self.recipient_foreign_tin = attributes[:'recipient_foreign_tin'] + end + + if attributes.key?(:'lob_code') + self.lob_code = attributes[:'lob_code'] + end + + if attributes.key?(:'income_code') + self.income_code = attributes[:'income_code'] + end + + if attributes.key?(:'gross_income') + self.gross_income = attributes[:'gross_income'] + end + + if attributes.key?(:'withholding_indicator') + self.withholding_indicator = attributes[:'withholding_indicator'] + end + + if attributes.key?(:'tax_country_code') + self.tax_country_code = attributes[:'tax_country_code'] + end + + if attributes.key?(:'exemption_code_chap3') + self.exemption_code_chap3 = attributes[:'exemption_code_chap3'] + end + + if attributes.key?(:'exemption_code_chap4') + self.exemption_code_chap4 = attributes[:'exemption_code_chap4'] + end + + if attributes.key?(:'tax_rate_chap3') + self.tax_rate_chap3 = attributes[:'tax_rate_chap3'] + end + + if attributes.key?(:'withholding_allowance') + self.withholding_allowance = attributes[:'withholding_allowance'] + end + + if attributes.key?(:'federal_tax_withheld') + self.federal_tax_withheld = attributes[:'federal_tax_withheld'] + end + + if attributes.key?(:'tax_not_deposited_indicator') + self.tax_not_deposited_indicator = attributes[:'tax_not_deposited_indicator'] + end + + if attributes.key?(:'academic_indicator') + self.academic_indicator = attributes[:'academic_indicator'] + end + + if attributes.key?(:'tax_withheld_other_agents') + self.tax_withheld_other_agents = attributes[:'tax_withheld_other_agents'] + end + + if attributes.key?(:'amount_repaid') + self.amount_repaid = attributes[:'amount_repaid'] + end + + if attributes.key?(:'tax_paid_agent') + self.tax_paid_agent = attributes[:'tax_paid_agent'] + end + + if attributes.key?(:'chap3_status_code') + self.chap3_status_code = attributes[:'chap3_status_code'] + end + + if attributes.key?(:'chap4_status_code') + self.chap4_status_code = attributes[:'chap4_status_code'] + end + + if attributes.key?(:'primary_withholding_agent') + self.primary_withholding_agent = attributes[:'primary_withholding_agent'] + end + + if attributes.key?(:'intermediary_or_flow_through') + self.intermediary_or_flow_through = attributes[:'intermediary_or_flow_through'] + end + + if attributes.key?(:'state_and_local_withholding') + self.state_and_local_withholding = attributes[:'state_and_local_withholding'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'issuer_id') + self.issuer_id = attributes[:'issuer_id'] + end + + if attributes.key?(:'reference_id') + self.reference_id = attributes[:'reference_id'] + end + + if attributes.key?(:'recipient_tin') + self.recipient_tin = attributes[:'recipient_tin'] + end + + if attributes.key?(:'recipient_name') + self.recipient_name = attributes[:'recipient_name'] + else + self.recipient_name = nil + end + + if attributes.key?(:'tin_type') + self.tin_type = attributes[:'tin_type'] + end + + if attributes.key?(:'recipient_second_name') + self.recipient_second_name = attributes[:'recipient_second_name'] + end + + if attributes.key?(:'address') + self.address = attributes[:'address'] + else + self.address = nil + end + + if attributes.key?(:'address2') + self.address2 = attributes[:'address2'] + end + + if attributes.key?(:'city') + self.city = attributes[:'city'] + else + self.city = nil + end + + if attributes.key?(:'state') + self.state = attributes[:'state'] + end + + if attributes.key?(:'zip') + self.zip = attributes[:'zip'] + end + + if attributes.key?(:'recipient_email') + self.recipient_email = attributes[:'recipient_email'] + end + + if attributes.key?(:'account_number') + self.account_number = attributes[:'account_number'] + end + + if attributes.key?(:'office_code') + self.office_code = attributes[:'office_code'] + end + + if attributes.key?(:'recipient_non_us_province') + self.recipient_non_us_province = attributes[:'recipient_non_us_province'] + end + + if attributes.key?(:'country_code') + self.country_code = attributes[:'country_code'] + else + self.country_code = nil + end + + if attributes.key?(:'federal_e_file') + self.federal_e_file = attributes[:'federal_e_file'] + end + + if attributes.key?(:'postal_mail') + self.postal_mail = attributes[:'postal_mail'] + end + + if attributes.key?(:'state_e_file') + self.state_e_file = attributes[:'state_e_file'] + end + + if attributes.key?(:'tin_match') + self.tin_match = attributes[:'tin_match'] + end + + if attributes.key?(:'address_verification') + self.address_verification = attributes[:'address_verification'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @recipient_name.nil? + invalid_properties.push('invalid value for "recipient_name", recipient_name cannot be nil.') + end + + if @recipient_name.to_s.length < 1 + invalid_properties.push('invalid value for "recipient_name", the character length must be great than or equal to 1.') + end + + if @address.nil? + invalid_properties.push('invalid value for "address", address cannot be nil.') + end + + if @address.to_s.length < 1 + invalid_properties.push('invalid value for "address", the character length must be great than or equal to 1.') + end + + if @city.nil? + invalid_properties.push('invalid value for "city", city cannot be nil.') + end + + if @city.to_s.length < 1 + invalid_properties.push('invalid value for "city", the character length must be great than or equal to 1.') + end + + if @country_code.nil? + invalid_properties.push('invalid value for "country_code", country_code cannot be nil.') + end + + if @country_code.to_s.length < 1 + invalid_properties.push('invalid value for "country_code", the character length must be great than or equal to 1.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + type_validator = EnumAttributeValidator.new('String', ["1099-NEC", "1099-MISC", "1099-DIV", "1099-R", "1099-K", "1095-B", "1042-S"]) + return false unless type_validator.valid?(@type) + return false if @recipient_name.nil? + return false if @recipient_name.to_s.length < 1 + tin_type_validator = EnumAttributeValidator.new('String', ["EIN", "SSN", "ITIN", "ATIN"]) + return false unless tin_type_validator.valid?(@tin_type) + return false if @address.nil? + return false if @address.to_s.length < 1 + return false if @city.nil? + return false if @city.to_s.length < 1 + return false if @country_code.nil? + return false if @country_code.to_s.length < 1 + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["1099-NEC", "1099-MISC", "1099-DIV", "1099-R", "1099-K", "1095-B", "1042-S"]) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Custom attribute writer method with validation + # @param [Object] recipient_name Value to be assigned + def recipient_name=(recipient_name) + if recipient_name.nil? + fail ArgumentError, 'recipient_name cannot be nil' + end + + if recipient_name.to_s.length < 1 + fail ArgumentError, 'invalid value for "recipient_name", the character length must be great than or equal to 1.' + end + + @recipient_name = recipient_name + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] tin_type Object to be assigned + def tin_type=(tin_type) + validator = EnumAttributeValidator.new('String', ["EIN", "SSN", "ITIN", "ATIN"]) + unless validator.valid?(tin_type) + fail ArgumentError, "invalid value for \"tin_type\", must be one of #{validator.allowable_values}." + end + @tin_type = tin_type + end + + # Custom attribute writer method with validation + # @param [Object] address Value to be assigned + def address=(address) + if address.nil? + fail ArgumentError, 'address cannot be nil' + end + + if address.to_s.length < 1 + fail ArgumentError, 'invalid value for "address", the character length must be great than or equal to 1.' + end + + @address = address + end + + # Custom attribute writer method with validation + # @param [Object] city Value to be assigned + def city=(city) + if city.nil? + fail ArgumentError, 'city cannot be nil' + end + + if city.to_s.length < 1 + fail ArgumentError, 'invalid value for "city", the character length must be great than or equal to 1.' + end + + @city = city + end + + # Custom attribute writer method with validation + # @param [Object] country_code Value to be assigned + def country_code=(country_code) + if country_code.nil? + fail ArgumentError, 'country_code cannot be nil' + end + + if country_code.to_s.length < 1 + fail ArgumentError, 'invalid value for "country_code", the character length must be great than or equal to 1.' + end + + @country_code = country_code + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + unique_form_id == o.unique_form_id && + no_tin == o.no_tin && + recipient_date_of_birth == o.recipient_date_of_birth && + recipient_giin == o.recipient_giin && + recipient_foreign_tin == o.recipient_foreign_tin && + lob_code == o.lob_code && + income_code == o.income_code && + gross_income == o.gross_income && + withholding_indicator == o.withholding_indicator && + tax_country_code == o.tax_country_code && + exemption_code_chap3 == o.exemption_code_chap3 && + exemption_code_chap4 == o.exemption_code_chap4 && + tax_rate_chap3 == o.tax_rate_chap3 && + withholding_allowance == o.withholding_allowance && + federal_tax_withheld == o.federal_tax_withheld && + tax_not_deposited_indicator == o.tax_not_deposited_indicator && + academic_indicator == o.academic_indicator && + tax_withheld_other_agents == o.tax_withheld_other_agents && + amount_repaid == o.amount_repaid && + tax_paid_agent == o.tax_paid_agent && + chap3_status_code == o.chap3_status_code && + chap4_status_code == o.chap4_status_code && + primary_withholding_agent == o.primary_withholding_agent && + intermediary_or_flow_through == o.intermediary_or_flow_through && + state_and_local_withholding == o.state_and_local_withholding && + type == o.type && + issuer_id == o.issuer_id && + reference_id == o.reference_id && + recipient_tin == o.recipient_tin && + recipient_name == o.recipient_name && + tin_type == o.tin_type && + recipient_second_name == o.recipient_second_name && + address == o.address && + address2 == o.address2 && + city == o.city && + state == o.state && + zip == o.zip && + recipient_email == o.recipient_email && + account_number == o.account_number && + office_code == o.office_code && + recipient_non_us_province == o.recipient_non_us_province && + country_code == o.country_code && + federal_e_file == o.federal_e_file && + postal_mail == o.postal_mail && + state_e_file == o.state_e_file && + tin_match == o.tin_match && + address_verification == o.address_verification + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [unique_form_id, no_tin, recipient_date_of_birth, recipient_giin, recipient_foreign_tin, lob_code, income_code, gross_income, withholding_indicator, tax_country_code, exemption_code_chap3, exemption_code_chap4, tax_rate_chap3, withholding_allowance, federal_tax_withheld, tax_not_deposited_indicator, academic_indicator, tax_withheld_other_agents, amount_repaid, tax_paid_agent, chap3_status_code, chap4_status_code, primary_withholding_agent, intermediary_or_flow_through, state_and_local_withholding, type, issuer_id, reference_id, recipient_tin, recipient_name, tin_type, recipient_second_name, address, address2, city, state, zip, recipient_email, account_number, office_code, recipient_non_us_province, country_code, federal_e_file, postal_mail, state_e_file, tin_match, address_verification].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::A1099::V2.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/A1099/V2/form1042_s_response.rb b/lib/avalara_sdk/models/A1099/V2/form1042_s_response.rb new file mode 100644 index 0000000..0d9b306 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/form1042_s_response.rb @@ -0,0 +1,600 @@ +=begin +#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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class Form1042SResponse + attr_accessor :type + + attr_accessor :created_at + + attr_accessor :updated_at + + attr_accessor :user_id + + attr_accessor :state_and_local_withholding + + attr_accessor :tin_type + + attr_accessor :id + + attr_accessor :issuer_id + + attr_accessor :issuer_reference_id + + attr_accessor :issuer_tin + + attr_accessor :tax_year + + attr_accessor :reference_id + + attr_accessor :recipient_name + + attr_accessor :recipient_tin + + attr_accessor :recipient_second_name + + attr_accessor :address + + attr_accessor :address2 + + attr_accessor :city + + attr_accessor :state + + attr_accessor :zip + + attr_accessor :recipient_email + + attr_accessor :account_number + + attr_accessor :office_code + + attr_accessor :recipient_non_us_province + + attr_accessor :country_code + + attr_accessor :federal_e_file + + attr_accessor :postal_mail + + attr_accessor :state_e_file + + attr_accessor :tin_match + + attr_accessor :address_verification + + attr_accessor :federal_efile_status + + attr_accessor :state_efile_status + + attr_accessor :postal_mail_status + + attr_accessor :tin_match_status + + attr_accessor :address_verification_status + + attr_accessor :validation_errors + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'created_at' => :'createdAt', + :'updated_at' => :'updatedAt', + :'user_id' => :'userId', + :'state_and_local_withholding' => :'stateAndLocalWithholding', + :'tin_type' => :'tinType', + :'id' => :'id', + :'issuer_id' => :'issuerId', + :'issuer_reference_id' => :'issuerReferenceId', + :'issuer_tin' => :'issuerTin', + :'tax_year' => :'taxYear', + :'reference_id' => :'referenceId', + :'recipient_name' => :'recipientName', + :'recipient_tin' => :'recipientTin', + :'recipient_second_name' => :'recipientSecondName', + :'address' => :'address', + :'address2' => :'address2', + :'city' => :'city', + :'state' => :'state', + :'zip' => :'zip', + :'recipient_email' => :'recipientEmail', + :'account_number' => :'accountNumber', + :'office_code' => :'officeCode', + :'recipient_non_us_province' => :'recipientNonUsProvince', + :'country_code' => :'countryCode', + :'federal_e_file' => :'federalEFile', + :'postal_mail' => :'postalMail', + :'state_e_file' => :'stateEFile', + :'tin_match' => :'tinMatch', + :'address_verification' => :'addressVerification', + :'federal_efile_status' => :'federalEfileStatus', + :'state_efile_status' => :'stateEfileStatus', + :'postal_mail_status' => :'postalMailStatus', + :'tin_match_status' => :'tinMatchStatus', + :'address_verification_status' => :'addressVerificationStatus', + :'validation_errors' => :'validationErrors' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'String', + :'created_at' => :'Time', + :'updated_at' => :'Time', + :'user_id' => :'String', + :'state_and_local_withholding' => :'StateAndLocalWithholdingResponse', + :'tin_type' => :'String', + :'id' => :'String', + :'issuer_id' => :'String', + :'issuer_reference_id' => :'String', + :'issuer_tin' => :'String', + :'tax_year' => :'Integer', + :'reference_id' => :'String', + :'recipient_name' => :'String', + :'recipient_tin' => :'String', + :'recipient_second_name' => :'String', + :'address' => :'String', + :'address2' => :'String', + :'city' => :'String', + :'state' => :'String', + :'zip' => :'String', + :'recipient_email' => :'String', + :'account_number' => :'String', + :'office_code' => :'String', + :'recipient_non_us_province' => :'String', + :'country_code' => :'String', + :'federal_e_file' => :'Boolean', + :'postal_mail' => :'Boolean', + :'state_e_file' => :'Boolean', + :'tin_match' => :'Boolean', + :'address_verification' => :'Boolean', + :'federal_efile_status' => :'StatusDetail', + :'state_efile_status' => :'Array', + :'postal_mail_status' => :'StatusDetail', + :'tin_match_status' => :'StatusDetail', + :'address_verification_status' => :'StatusDetail', + :'validation_errors' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'federal_efile_status', + :'state_efile_status', + :'postal_mail_status', + :'tin_match_status', + :'address_verification_status', + :'validation_errors' + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'FormResponseBase' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::A1099::V2::Form1042SResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::A1099::V2::Form1042SResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + end + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + end + + if attributes.key?(:'state_and_local_withholding') + self.state_and_local_withholding = attributes[:'state_and_local_withholding'] + end + + if attributes.key?(:'tin_type') + self.tin_type = attributes[:'tin_type'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'issuer_id') + self.issuer_id = attributes[:'issuer_id'] + end + + if attributes.key?(:'issuer_reference_id') + self.issuer_reference_id = attributes[:'issuer_reference_id'] + end + + if attributes.key?(:'issuer_tin') + self.issuer_tin = attributes[:'issuer_tin'] + end + + if attributes.key?(:'tax_year') + self.tax_year = attributes[:'tax_year'] + end + + if attributes.key?(:'reference_id') + self.reference_id = attributes[:'reference_id'] + end + + if attributes.key?(:'recipient_name') + self.recipient_name = attributes[:'recipient_name'] + end + + if attributes.key?(:'recipient_tin') + self.recipient_tin = attributes[:'recipient_tin'] + end + + if attributes.key?(:'recipient_second_name') + self.recipient_second_name = attributes[:'recipient_second_name'] + end + + if attributes.key?(:'address') + self.address = attributes[:'address'] + end + + if attributes.key?(:'address2') + self.address2 = attributes[:'address2'] + end + + if attributes.key?(:'city') + self.city = attributes[:'city'] + end + + if attributes.key?(:'state') + self.state = attributes[:'state'] + end + + if attributes.key?(:'zip') + self.zip = attributes[:'zip'] + end + + if attributes.key?(:'recipient_email') + self.recipient_email = attributes[:'recipient_email'] + end + + if attributes.key?(:'account_number') + self.account_number = attributes[:'account_number'] + end + + if attributes.key?(:'office_code') + self.office_code = attributes[:'office_code'] + end + + if attributes.key?(:'recipient_non_us_province') + self.recipient_non_us_province = attributes[:'recipient_non_us_province'] + end + + if attributes.key?(:'country_code') + self.country_code = attributes[:'country_code'] + end + + if attributes.key?(:'federal_e_file') + self.federal_e_file = attributes[:'federal_e_file'] + end + + if attributes.key?(:'postal_mail') + self.postal_mail = attributes[:'postal_mail'] + end + + if attributes.key?(:'state_e_file') + self.state_e_file = attributes[:'state_e_file'] + end + + if attributes.key?(:'tin_match') + self.tin_match = attributes[:'tin_match'] + end + + if attributes.key?(:'address_verification') + self.address_verification = attributes[:'address_verification'] + end + + if attributes.key?(:'federal_efile_status') + self.federal_efile_status = attributes[:'federal_efile_status'] + end + + if attributes.key?(:'state_efile_status') + if (value = attributes[:'state_efile_status']).is_a?(Array) + self.state_efile_status = value + end + end + + if attributes.key?(:'postal_mail_status') + self.postal_mail_status = attributes[:'postal_mail_status'] + end + + if attributes.key?(:'tin_match_status') + self.tin_match_status = attributes[:'tin_match_status'] + end + + if attributes.key?(:'address_verification_status') + self.address_verification_status = attributes[:'address_verification_status'] + end + + if attributes.key?(:'validation_errors') + if (value = attributes[:'validation_errors']).is_a?(Array) + self.validation_errors = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + type_validator = EnumAttributeValidator.new('String', ["1099-NEC", "1099-MISC", "1099-DIV", "1099-R", "1099-K", "1095-B", "1042-S"]) + return false unless type_validator.valid?(@type) + tin_type_validator = EnumAttributeValidator.new('String', ["EIN", "SSN", "ITIN", "ATIN"]) + return false unless tin_type_validator.valid?(@tin_type) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["1099-NEC", "1099-MISC", "1099-DIV", "1099-R", "1099-K", "1095-B", "1042-S"]) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] tin_type Object to be assigned + def tin_type=(tin_type) + validator = EnumAttributeValidator.new('String', ["EIN", "SSN", "ITIN", "ATIN"]) + unless validator.valid?(tin_type) + fail ArgumentError, "invalid value for \"tin_type\", must be one of #{validator.allowable_values}." + end + @tin_type = tin_type + end + + # Custom attribute writer method with validation + # @param [Object] state_efile_status Value to be assigned + def state_efile_status=(state_efile_status) + @state_efile_status = state_efile_status + end + + # Custom attribute writer method with validation + # @param [Object] validation_errors Value to be assigned + def validation_errors=(validation_errors) + @validation_errors = validation_errors + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + created_at == o.created_at && + updated_at == o.updated_at && + user_id == o.user_id && + state_and_local_withholding == o.state_and_local_withholding && + tin_type == o.tin_type && + id == o.id && + issuer_id == o.issuer_id && + issuer_reference_id == o.issuer_reference_id && + issuer_tin == o.issuer_tin && + tax_year == o.tax_year && + reference_id == o.reference_id && + recipient_name == o.recipient_name && + recipient_tin == o.recipient_tin && + recipient_second_name == o.recipient_second_name && + address == o.address && + address2 == o.address2 && + city == o.city && + state == o.state && + zip == o.zip && + recipient_email == o.recipient_email && + account_number == o.account_number && + office_code == o.office_code && + recipient_non_us_province == o.recipient_non_us_province && + country_code == o.country_code && + federal_e_file == o.federal_e_file && + postal_mail == o.postal_mail && + state_e_file == o.state_e_file && + tin_match == o.tin_match && + address_verification == o.address_verification && + federal_efile_status == o.federal_efile_status && + state_efile_status == o.state_efile_status && + postal_mail_status == o.postal_mail_status && + tin_match_status == o.tin_match_status && + address_verification_status == o.address_verification_status && + validation_errors == o.validation_errors + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, created_at, updated_at, user_id, state_and_local_withholding, tin_type, id, issuer_id, issuer_reference_id, issuer_tin, tax_year, reference_id, recipient_name, recipient_tin, recipient_second_name, address, address2, city, state, zip, recipient_email, account_number, office_code, recipient_non_us_province, country_code, federal_e_file, postal_mail, state_e_file, tin_match, address_verification, federal_efile_status, state_efile_status, postal_mail_status, tin_match_status, address_verification_status, validation_errors].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::A1099::V2.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/A1099/V2/form1095_b_list.rb b/lib/avalara_sdk/models/A1099/V2/form1095_b_list.rb index 341d12f..9b0aea6 100644 --- a/lib/avalara_sdk/models/A1099/V2/form1095_b_list.rb +++ b/lib/avalara_sdk/models/A1099/V2/form1095_b_list.rb @@ -1,7 +1,7 @@ =begin #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) =end diff --git a/lib/avalara_sdk/models/A1099/V2/form1095_b_list_item.rb b/lib/avalara_sdk/models/A1099/V2/form1095_b_list_item.rb index 427f016..0443831 100644 --- a/lib/avalara_sdk/models/A1099/V2/form1095_b_list_item.rb +++ b/lib/avalara_sdk/models/A1099/V2/form1095_b_list_item.rb @@ -1,7 +1,7 @@ =begin #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) =end @@ -11,62 +11,91 @@ module AvalaraSdk::A1099::V2 class Form1095BListItem + # Employee's first name attr_accessor :employee_first_name + # Employee's middle name attr_accessor :employee_middle_name + # Employee's last name attr_accessor :employee_last_name + # Employee's name suffix attr_accessor :employee_name_suffix + # Employee's date of birth attr_accessor :employee_date_of_birth + # Origin of health coverage code attr_accessor :origin_of_health_coverage_code + # Covered individuals information attr_accessor :covered_individuals + # Issuer ID attr_accessor :issuer_id + # Reference ID attr_accessor :reference_id - attr_accessor :recipient_name - + # Recipient Tax ID Number attr_accessor :recipient_tin + # Recipient name + attr_accessor :recipient_name + + # Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN attr_accessor :tin_type + # Recipient second name attr_accessor :recipient_second_name + # Address attr_accessor :address + # Address line 2 attr_accessor :address2 + # City attr_accessor :city + # US state. Required if CountryCode is \"US\". attr_accessor :state + # Zip/postal code attr_accessor :zip + # Recipient email address attr_accessor :recipient_email + # Account number attr_accessor :account_number + # Office code attr_accessor :office_code + # Foreign province attr_accessor :recipient_non_us_province + # Country code, as defined at https://www.irs.gov/e-file-providers/country-codes attr_accessor :country_code + # Boolean indicating that federal e-filing should be scheduled for this form attr_accessor :federal_e_file + # Boolean indicating that postal mailing to the recipient should be scheduled for this form attr_accessor :postal_mail + # Boolean indicating that state e-filing should be scheduled for this form attr_accessor :state_e_file + # Boolean indicating that TIN Matching should be scheduled for this form attr_accessor :tin_match + # Boolean indicating that address verification should be scheduled for this form attr_accessor :address_verification + # State and local withholding information attr_accessor :state_and_local_withholding class EnumAttributeValidator @@ -103,8 +132,8 @@ def self.attribute_map :'covered_individuals' => :'coveredIndividuals', :'issuer_id' => :'issuerId', :'reference_id' => :'referenceId', - :'recipient_name' => :'recipientName', :'recipient_tin' => :'recipientTin', + :'recipient_name' => :'recipientName', :'tin_type' => :'tinType', :'recipient_second_name' => :'recipientSecondName', :'address' => :'address', @@ -143,8 +172,8 @@ def self.openapi_types :'covered_individuals' => :'Array', :'issuer_id' => :'String', :'reference_id' => :'String', - :'recipient_name' => :'String', :'recipient_tin' => :'String', + :'recipient_name' => :'String', :'tin_type' => :'String', :'recipient_second_name' => :'String', :'address' => :'String', @@ -174,7 +203,7 @@ def self.openapi_nullable :'employee_date_of_birth', :'issuer_id', :'reference_id', - :'recipient_name', + :'recipient_second_name', :'address2', :'recipient_email', :'account_number', @@ -243,14 +272,16 @@ def initialize(attributes = {}) self.reference_id = attributes[:'reference_id'] end - if attributes.key?(:'recipient_name') - self.recipient_name = attributes[:'recipient_name'] - end - if attributes.key?(:'recipient_tin') self.recipient_tin = attributes[:'recipient_tin'] end + if attributes.key?(:'recipient_name') + self.recipient_name = attributes[:'recipient_name'] + else + self.recipient_name = nil + end + if attributes.key?(:'tin_type') self.tin_type = attributes[:'tin_type'] end @@ -261,6 +292,8 @@ def initialize(attributes = {}) if attributes.key?(:'address') self.address = attributes[:'address'] + else + self.address = nil end if attributes.key?(:'address2') @@ -269,6 +302,8 @@ def initialize(attributes = {}) if attributes.key?(:'city') self.city = attributes[:'city'] + else + self.city = nil end if attributes.key?(:'state') @@ -297,6 +332,8 @@ def initialize(attributes = {}) if attributes.key?(:'country_code') self.country_code = attributes[:'country_code'] + else + self.country_code = nil end if attributes.key?(:'federal_e_file') @@ -329,6 +366,38 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @recipient_name.nil? + invalid_properties.push('invalid value for "recipient_name", recipient_name cannot be nil.') + end + + if @recipient_name.to_s.length < 1 + invalid_properties.push('invalid value for "recipient_name", the character length must be great than or equal to 1.') + end + + if @address.nil? + invalid_properties.push('invalid value for "address", address cannot be nil.') + end + + if @address.to_s.length < 1 + invalid_properties.push('invalid value for "address", the character length must be great than or equal to 1.') + end + + if @city.nil? + invalid_properties.push('invalid value for "city", city cannot be nil.') + end + + if @city.to_s.length < 1 + invalid_properties.push('invalid value for "city", the character length must be great than or equal to 1.') + end + + if @country_code.nil? + invalid_properties.push('invalid value for "country_code", country_code cannot be nil.') + end + + if @country_code.to_s.length < 1 + invalid_properties.push('invalid value for "country_code", the character length must be great than or equal to 1.') + end + invalid_properties end @@ -336,17 +405,25 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - origin_of_health_coverage_code_validator = EnumAttributeValidator.new('String', ["SmallBusinessHealthOptionsProgram", "EmployerSponsored", "GovernmentSponsored", "IndividualMarket", "MultiemployerPlan", "OtherDesignatedMinimumEssentialCoverage", "EmployerSponsoredIndividualHra"]) + origin_of_health_coverage_code_validator = EnumAttributeValidator.new('String', ["A", "B", "C", "D", "E", "F", "G"]) return false unless origin_of_health_coverage_code_validator.valid?(@origin_of_health_coverage_code) + return false if @recipient_name.nil? + return false if @recipient_name.to_s.length < 1 tin_type_validator = EnumAttributeValidator.new('String', ["EIN", "SSN", "ITIN", "ATIN"]) return false unless tin_type_validator.valid?(@tin_type) + return false if @address.nil? + return false if @address.to_s.length < 1 + return false if @city.nil? + return false if @city.to_s.length < 1 + return false if @country_code.nil? + return false if @country_code.to_s.length < 1 true end # Custom attribute writer method checking allowed values (enum). # @param [Object] origin_of_health_coverage_code Object to be assigned def origin_of_health_coverage_code=(origin_of_health_coverage_code) - validator = EnumAttributeValidator.new('String', ["SmallBusinessHealthOptionsProgram", "EmployerSponsored", "GovernmentSponsored", "IndividualMarket", "MultiemployerPlan", "OtherDesignatedMinimumEssentialCoverage", "EmployerSponsoredIndividualHra"]) + validator = EnumAttributeValidator.new('String', ["A", "B", "C", "D", "E", "F", "G"]) unless validator.valid?(origin_of_health_coverage_code) fail ArgumentError, "invalid value for \"origin_of_health_coverage_code\", must be one of #{validator.allowable_values}." end @@ -363,6 +440,20 @@ def covered_individuals=(covered_individuals) @covered_individuals = covered_individuals end + # Custom attribute writer method with validation + # @param [Object] recipient_name Value to be assigned + def recipient_name=(recipient_name) + if recipient_name.nil? + fail ArgumentError, 'recipient_name cannot be nil' + end + + if recipient_name.to_s.length < 1 + fail ArgumentError, 'invalid value for "recipient_name", the character length must be great than or equal to 1.' + end + + @recipient_name = recipient_name + end + # Custom attribute writer method checking allowed values (enum). # @param [Object] tin_type Object to be assigned def tin_type=(tin_type) @@ -373,6 +464,48 @@ def tin_type=(tin_type) @tin_type = tin_type end + # Custom attribute writer method with validation + # @param [Object] address Value to be assigned + def address=(address) + if address.nil? + fail ArgumentError, 'address cannot be nil' + end + + if address.to_s.length < 1 + fail ArgumentError, 'invalid value for "address", the character length must be great than or equal to 1.' + end + + @address = address + end + + # Custom attribute writer method with validation + # @param [Object] city Value to be assigned + def city=(city) + if city.nil? + fail ArgumentError, 'city cannot be nil' + end + + if city.to_s.length < 1 + fail ArgumentError, 'invalid value for "city", the character length must be great than or equal to 1.' + end + + @city = city + end + + # Custom attribute writer method with validation + # @param [Object] country_code Value to be assigned + def country_code=(country_code) + if country_code.nil? + fail ArgumentError, 'country_code cannot be nil' + end + + if country_code.to_s.length < 1 + fail ArgumentError, 'invalid value for "country_code", the character length must be great than or equal to 1.' + end + + @country_code = country_code + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -387,8 +520,8 @@ def ==(o) covered_individuals == o.covered_individuals && issuer_id == o.issuer_id && reference_id == o.reference_id && - recipient_name == o.recipient_name && recipient_tin == o.recipient_tin && + recipient_name == o.recipient_name && tin_type == o.tin_type && recipient_second_name == o.recipient_second_name && address == o.address && @@ -418,7 +551,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [employee_first_name, employee_middle_name, employee_last_name, employee_name_suffix, employee_date_of_birth, origin_of_health_coverage_code, covered_individuals, issuer_id, reference_id, recipient_name, recipient_tin, tin_type, recipient_second_name, address, address2, city, state, zip, recipient_email, account_number, office_code, recipient_non_us_province, country_code, federal_e_file, postal_mail, state_e_file, tin_match, address_verification, state_and_local_withholding].hash + [employee_first_name, employee_middle_name, employee_last_name, employee_name_suffix, employee_date_of_birth, origin_of_health_coverage_code, covered_individuals, issuer_id, reference_id, recipient_tin, recipient_name, tin_type, recipient_second_name, address, address2, city, state, zip, recipient_email, account_number, office_code, recipient_non_us_province, country_code, federal_e_file, postal_mail, state_e_file, tin_match, address_verification, state_and_local_withholding].hash end # Builds the object from hash diff --git a/lib/avalara_sdk/models/A1099/V2/form1095_b_list_item_response.rb b/lib/avalara_sdk/models/A1099/V2/form1095_b_list_item_response.rb new file mode 100644 index 0000000..4eb1a30 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/form1095_b_list_item_response.rb @@ -0,0 +1,700 @@ +=begin +#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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class Form1095BListItemResponse + # Origin of health coverage code + attr_accessor :origin_of_health_coverage_code + + # Covered individuals information + attr_accessor :covered_individuals + + # ID of the form + attr_accessor :id + + # 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 + attr_accessor :type + + # Issuer ID + attr_accessor :issuer_id + + # Issuer Reference ID + attr_accessor :issuer_reference_id + + # Issuer TIN + attr_accessor :issuer_tin + + # Tax year + attr_accessor :tax_year + + # Boolean indicating that federal e-filing has been scheduled for this form + attr_accessor :federal_efile + + # Federal e-file status + attr_accessor :federal_efile_status + + # Boolean indicating that state e-filing has been scheduled for this form + attr_accessor :state_efile + + # State e-file status + attr_accessor :state_efile_status + + # Boolean indicating that postal mailing to the recipient has been scheduled for this form + attr_accessor :postal_mail + + # Postal mail to recipient status + attr_accessor :postal_mail_status + + # Boolean indicating that TIN Matching has been scheduled for this form + attr_accessor :tin_match + + # TIN Match status + attr_accessor :tin_match_status + + # Boolean indicating that address verification has been scheduled for this form + attr_accessor :address_verification + + # Address verification status + attr_accessor :address_verification_status + + # Reference ID + attr_accessor :reference_id + + # Recipient email address + attr_accessor :email + + # Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN + attr_accessor :tin_type + + # Recipient Tax ID Number + attr_accessor :tin + + # Recipient name + attr_accessor :recipient_name + + # Recipient second name + attr_accessor :recipient_second_name + + # Address + attr_accessor :address + + # Address line 2 + attr_accessor :address2 + + # City + attr_accessor :city + + # US state + attr_accessor :state + + # Zip/postal code + attr_accessor :zip + + # Foreign province + attr_accessor :foreign_province + + # Country code, as defined at https://www.irs.gov/e-file-providers/country-codes + attr_accessor :country_code + + # Validation errors + attr_accessor :validation_errors + + # Creation time + attr_accessor :created_at + + # Update time + attr_accessor :updated_at + + attr_accessor :state_and_local_withholding + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'origin_of_health_coverage_code' => :'originOfHealthCoverageCode', + :'covered_individuals' => :'coveredIndividuals', + :'id' => :'id', + :'type' => :'type', + :'issuer_id' => :'issuerId', + :'issuer_reference_id' => :'issuerReferenceId', + :'issuer_tin' => :'issuerTin', + :'tax_year' => :'taxYear', + :'federal_efile' => :'federalEfile', + :'federal_efile_status' => :'federalEfileStatus', + :'state_efile' => :'stateEfile', + :'state_efile_status' => :'stateEfileStatus', + :'postal_mail' => :'postalMail', + :'postal_mail_status' => :'postalMailStatus', + :'tin_match' => :'tinMatch', + :'tin_match_status' => :'tinMatchStatus', + :'address_verification' => :'addressVerification', + :'address_verification_status' => :'addressVerificationStatus', + :'reference_id' => :'referenceId', + :'email' => :'email', + :'tin_type' => :'tinType', + :'tin' => :'tin', + :'recipient_name' => :'recipientName', + :'recipient_second_name' => :'recipientSecondName', + :'address' => :'address', + :'address2' => :'address2', + :'city' => :'city', + :'state' => :'state', + :'zip' => :'zip', + :'foreign_province' => :'foreignProvince', + :'country_code' => :'countryCode', + :'validation_errors' => :'validationErrors', + :'created_at' => :'createdAt', + :'updated_at' => :'updatedAt', + :'state_and_local_withholding' => :'stateAndLocalWithholding' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'origin_of_health_coverage_code' => :'String', + :'covered_individuals' => :'Array', + :'id' => :'String', + :'type' => :'String', + :'issuer_id' => :'Integer', + :'issuer_reference_id' => :'String', + :'issuer_tin' => :'String', + :'tax_year' => :'Integer', + :'federal_efile' => :'Boolean', + :'federal_efile_status' => :'Form1099StatusDetailResponse', + :'state_efile' => :'Boolean', + :'state_efile_status' => :'Array', + :'postal_mail' => :'Boolean', + :'postal_mail_status' => :'Form1099StatusDetailResponse', + :'tin_match' => :'Boolean', + :'tin_match_status' => :'Form1099StatusDetailResponse', + :'address_verification' => :'Boolean', + :'address_verification_status' => :'Form1099StatusDetailResponse', + :'reference_id' => :'String', + :'email' => :'String', + :'tin_type' => :'String', + :'tin' => :'String', + :'recipient_name' => :'String', + :'recipient_second_name' => :'String', + :'address' => :'String', + :'address2' => :'String', + :'city' => :'String', + :'state' => :'String', + :'zip' => :'String', + :'foreign_province' => :'String', + :'country_code' => :'String', + :'validation_errors' => :'Array', + :'created_at' => :'Time', + :'updated_at' => :'Time', + :'state_and_local_withholding' => :'StateAndLocalWithholdingResponse' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'issuer_reference_id', + :'issuer_tin', + :'state_efile_status', + :'postal_mail_status', + :'tin_match_status', + :'address_verification_status', + :'reference_id', + :'email', + :'tin_type', + :'tin', + :'recipient_name', + :'recipient_second_name', + :'address', + :'address2', + :'city', + :'state', + :'zip', + :'foreign_province', + :'country_code', + :'validation_errors', + :'state_and_local_withholding' + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'Form1099BaseResponse' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::A1099::V2::Form1095BListItemResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::A1099::V2::Form1095BListItemResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'origin_of_health_coverage_code') + self.origin_of_health_coverage_code = attributes[:'origin_of_health_coverage_code'] + end + + if attributes.key?(:'covered_individuals') + if (value = attributes[:'covered_individuals']).is_a?(Array) + self.covered_individuals = value + end + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + else + self.id = nil + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + else + self.type = nil + end + + if attributes.key?(:'issuer_id') + self.issuer_id = attributes[:'issuer_id'] + else + self.issuer_id = nil + end + + if attributes.key?(:'issuer_reference_id') + self.issuer_reference_id = attributes[:'issuer_reference_id'] + end + + if attributes.key?(:'issuer_tin') + self.issuer_tin = attributes[:'issuer_tin'] + end + + if attributes.key?(:'tax_year') + self.tax_year = attributes[:'tax_year'] + end + + if attributes.key?(:'federal_efile') + self.federal_efile = attributes[:'federal_efile'] + else + self.federal_efile = nil + end + + if attributes.key?(:'federal_efile_status') + self.federal_efile_status = attributes[:'federal_efile_status'] + end + + if attributes.key?(:'state_efile') + self.state_efile = attributes[:'state_efile'] + else + self.state_efile = nil + end + + if attributes.key?(:'state_efile_status') + if (value = attributes[:'state_efile_status']).is_a?(Array) + self.state_efile_status = value + end + end + + if attributes.key?(:'postal_mail') + self.postal_mail = attributes[:'postal_mail'] + else + self.postal_mail = nil + end + + if attributes.key?(:'postal_mail_status') + self.postal_mail_status = attributes[:'postal_mail_status'] + end + + if attributes.key?(:'tin_match') + self.tin_match = attributes[:'tin_match'] + else + self.tin_match = nil + end + + if attributes.key?(:'tin_match_status') + self.tin_match_status = attributes[:'tin_match_status'] + end + + if attributes.key?(:'address_verification') + self.address_verification = attributes[:'address_verification'] + else + self.address_verification = nil + end + + if attributes.key?(:'address_verification_status') + self.address_verification_status = attributes[:'address_verification_status'] + end + + if attributes.key?(:'reference_id') + self.reference_id = attributes[:'reference_id'] + end + + if attributes.key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.key?(:'tin_type') + self.tin_type = attributes[:'tin_type'] + end + + if attributes.key?(:'tin') + self.tin = attributes[:'tin'] + end + + if attributes.key?(:'recipient_name') + self.recipient_name = attributes[:'recipient_name'] + end + + if attributes.key?(:'recipient_second_name') + self.recipient_second_name = attributes[:'recipient_second_name'] + end + + if attributes.key?(:'address') + self.address = attributes[:'address'] + end + + if attributes.key?(:'address2') + self.address2 = attributes[:'address2'] + end + + if attributes.key?(:'city') + self.city = attributes[:'city'] + end + + if attributes.key?(:'state') + self.state = attributes[:'state'] + end + + if attributes.key?(:'zip') + self.zip = attributes[:'zip'] + end + + if attributes.key?(:'foreign_province') + self.foreign_province = attributes[:'foreign_province'] + end + + if attributes.key?(:'country_code') + self.country_code = attributes[:'country_code'] + end + + if attributes.key?(:'validation_errors') + if (value = attributes[:'validation_errors']).is_a?(Array) + self.validation_errors = value + end + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + end + + if attributes.key?(:'state_and_local_withholding') + self.state_and_local_withholding = attributes[:'state_and_local_withholding'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @id.nil? + invalid_properties.push('invalid value for "id", id cannot be nil.') + end + + if @id.to_s.length < 1 + invalid_properties.push('invalid value for "id", the character length must be great than or equal to 1.') + end + + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @type.to_s.length < 1 + invalid_properties.push('invalid value for "type", the character length must be great than or equal to 1.') + end + + if @issuer_id.nil? + invalid_properties.push('invalid value for "issuer_id", issuer_id cannot be nil.') + end + + if @federal_efile.nil? + invalid_properties.push('invalid value for "federal_efile", federal_efile cannot be nil.') + end + + if @state_efile.nil? + invalid_properties.push('invalid value for "state_efile", state_efile cannot be nil.') + end + + if @postal_mail.nil? + invalid_properties.push('invalid value for "postal_mail", postal_mail cannot be nil.') + end + + if @tin_match.nil? + invalid_properties.push('invalid value for "tin_match", tin_match cannot be nil.') + end + + if @address_verification.nil? + invalid_properties.push('invalid value for "address_verification", address_verification cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @id.nil? + return false if @id.to_s.length < 1 + return false if @type.nil? + return false if @type.to_s.length < 1 + return false if @issuer_id.nil? + return false if @federal_efile.nil? + return false if @state_efile.nil? + return false if @postal_mail.nil? + return false if @tin_match.nil? + return false if @address_verification.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] covered_individuals Value to be assigned + def covered_individuals=(covered_individuals) + if covered_individuals.nil? + fail ArgumentError, 'covered_individuals cannot be nil' + end + + @covered_individuals = covered_individuals + end + + # Custom attribute writer method with validation + # @param [Object] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + if id.to_s.length < 1 + fail ArgumentError, 'invalid value for "id", the character length must be great than or equal to 1.' + end + + @id = id + end + + # Custom attribute writer method with validation + # @param [Object] type Value to be assigned + def type=(type) + if type.nil? + fail ArgumentError, 'type cannot be nil' + end + + if type.to_s.length < 1 + fail ArgumentError, 'invalid value for "type", the character length must be great than or equal to 1.' + end + + @type = type + end + + # Custom attribute writer method with validation + # @param [Object] state_efile_status Value to be assigned + def state_efile_status=(state_efile_status) + @state_efile_status = state_efile_status + end + + # Custom attribute writer method with validation + # @param [Object] validation_errors Value to be assigned + def validation_errors=(validation_errors) + @validation_errors = validation_errors + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + origin_of_health_coverage_code == o.origin_of_health_coverage_code && + covered_individuals == o.covered_individuals && + id == o.id && + type == o.type && + issuer_id == o.issuer_id && + issuer_reference_id == o.issuer_reference_id && + issuer_tin == o.issuer_tin && + tax_year == o.tax_year && + federal_efile == o.federal_efile && + federal_efile_status == o.federal_efile_status && + state_efile == o.state_efile && + state_efile_status == o.state_efile_status && + postal_mail == o.postal_mail && + postal_mail_status == o.postal_mail_status && + tin_match == o.tin_match && + tin_match_status == o.tin_match_status && + address_verification == o.address_verification && + address_verification_status == o.address_verification_status && + reference_id == o.reference_id && + email == o.email && + tin_type == o.tin_type && + tin == o.tin && + recipient_name == o.recipient_name && + recipient_second_name == o.recipient_second_name && + address == o.address && + address2 == o.address2 && + city == o.city && + state == o.state && + zip == o.zip && + foreign_province == o.foreign_province && + country_code == o.country_code && + validation_errors == o.validation_errors && + created_at == o.created_at && + updated_at == o.updated_at && + state_and_local_withholding == o.state_and_local_withholding + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [origin_of_health_coverage_code, covered_individuals, id, type, issuer_id, issuer_reference_id, issuer_tin, tax_year, federal_efile, federal_efile_status, state_efile, state_efile_status, postal_mail, postal_mail_status, tin_match, tin_match_status, address_verification, address_verification_status, reference_id, email, tin_type, tin, recipient_name, recipient_second_name, address, address2, city, state, zip, foreign_province, country_code, validation_errors, created_at, updated_at, state_and_local_withholding].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::A1099::V2.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/A1099/V2/form1095_b_request.rb b/lib/avalara_sdk/models/A1099/V2/form1095_b_request.rb index 933eda7..2647be2 100644 --- a/lib/avalara_sdk/models/A1099/V2/form1095_b_request.rb +++ b/lib/avalara_sdk/models/A1099/V2/form1095_b_request.rb @@ -1,7 +1,7 @@ =begin #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) =end @@ -11,64 +11,93 @@ module AvalaraSdk::A1099::V2 class Form1095BRequest + # Employee's first name attr_accessor :employee_first_name + # Employee's middle name attr_accessor :employee_middle_name + # Employee's last name attr_accessor :employee_last_name + # Employee's name suffix attr_accessor :employee_name_suffix + # Employee's date of birth attr_accessor :employee_date_of_birth + # Origin of health coverage code attr_accessor :origin_of_health_coverage_code + # Covered individuals information attr_accessor :covered_individuals attr_accessor :type + # Issuer ID attr_accessor :issuer_id + # Reference ID attr_accessor :reference_id - attr_accessor :recipient_name - + # Recipient Tax ID Number attr_accessor :recipient_tin + # Recipient name + attr_accessor :recipient_name + + # Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN attr_accessor :tin_type + # Recipient second name attr_accessor :recipient_second_name + # Address attr_accessor :address + # Address line 2 attr_accessor :address2 + # City attr_accessor :city + # US state. Required if CountryCode is \"US\". attr_accessor :state + # Zip/postal code attr_accessor :zip + # Recipient email address attr_accessor :recipient_email + # Account number attr_accessor :account_number + # Office code attr_accessor :office_code + # Foreign province attr_accessor :recipient_non_us_province + # Country code, as defined at https://www.irs.gov/e-file-providers/country-codes attr_accessor :country_code + # Boolean indicating that federal e-filing should be scheduled for this form attr_accessor :federal_e_file + # Boolean indicating that postal mailing to the recipient should be scheduled for this form attr_accessor :postal_mail + # Boolean indicating that state e-filing should be scheduled for this form attr_accessor :state_e_file + # Boolean indicating that TIN Matching should be scheduled for this form attr_accessor :tin_match + # Boolean indicating that address verification should be scheduled for this form attr_accessor :address_verification + # State and local withholding information attr_accessor :state_and_local_withholding class EnumAttributeValidator @@ -106,8 +135,8 @@ def self.attribute_map :'type' => :'type', :'issuer_id' => :'issuerId', :'reference_id' => :'referenceId', - :'recipient_name' => :'recipientName', :'recipient_tin' => :'recipientTin', + :'recipient_name' => :'recipientName', :'tin_type' => :'tinType', :'recipient_second_name' => :'recipientSecondName', :'address' => :'address', @@ -147,8 +176,8 @@ def self.openapi_types :'type' => :'String', :'issuer_id' => :'String', :'reference_id' => :'String', - :'recipient_name' => :'String', :'recipient_tin' => :'String', + :'recipient_name' => :'String', :'tin_type' => :'String', :'recipient_second_name' => :'String', :'address' => :'String', @@ -178,7 +207,7 @@ def self.openapi_nullable :'employee_date_of_birth', :'issuer_id', :'reference_id', - :'recipient_name', + :'recipient_second_name', :'address2', :'recipient_email', :'account_number', @@ -251,14 +280,16 @@ def initialize(attributes = {}) self.reference_id = attributes[:'reference_id'] end - if attributes.key?(:'recipient_name') - self.recipient_name = attributes[:'recipient_name'] - end - if attributes.key?(:'recipient_tin') self.recipient_tin = attributes[:'recipient_tin'] end + if attributes.key?(:'recipient_name') + self.recipient_name = attributes[:'recipient_name'] + else + self.recipient_name = nil + end + if attributes.key?(:'tin_type') self.tin_type = attributes[:'tin_type'] end @@ -269,6 +300,8 @@ def initialize(attributes = {}) if attributes.key?(:'address') self.address = attributes[:'address'] + else + self.address = nil end if attributes.key?(:'address2') @@ -277,6 +310,8 @@ def initialize(attributes = {}) if attributes.key?(:'city') self.city = attributes[:'city'] + else + self.city = nil end if attributes.key?(:'state') @@ -305,6 +340,8 @@ def initialize(attributes = {}) if attributes.key?(:'country_code') self.country_code = attributes[:'country_code'] + else + self.country_code = nil end if attributes.key?(:'federal_e_file') @@ -337,6 +374,38 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @recipient_name.nil? + invalid_properties.push('invalid value for "recipient_name", recipient_name cannot be nil.') + end + + if @recipient_name.to_s.length < 1 + invalid_properties.push('invalid value for "recipient_name", the character length must be great than or equal to 1.') + end + + if @address.nil? + invalid_properties.push('invalid value for "address", address cannot be nil.') + end + + if @address.to_s.length < 1 + invalid_properties.push('invalid value for "address", the character length must be great than or equal to 1.') + end + + if @city.nil? + invalid_properties.push('invalid value for "city", city cannot be nil.') + end + + if @city.to_s.length < 1 + invalid_properties.push('invalid value for "city", the character length must be great than or equal to 1.') + end + + if @country_code.nil? + invalid_properties.push('invalid value for "country_code", country_code cannot be nil.') + end + + if @country_code.to_s.length < 1 + invalid_properties.push('invalid value for "country_code", the character length must be great than or equal to 1.') + end + invalid_properties end @@ -344,19 +413,27 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - origin_of_health_coverage_code_validator = EnumAttributeValidator.new('String', ["SmallBusinessHealthOptionsProgram", "EmployerSponsored", "GovernmentSponsored", "IndividualMarket", "MultiemployerPlan", "OtherDesignatedMinimumEssentialCoverage", "EmployerSponsoredIndividualHra"]) + origin_of_health_coverage_code_validator = EnumAttributeValidator.new('String', ["A", "B", "C", "D", "E", "F", "G"]) return false unless origin_of_health_coverage_code_validator.valid?(@origin_of_health_coverage_code) - type_validator = EnumAttributeValidator.new('String', ["Form1099Nec", "Form1099Misc", "Form1099Div", "Form1099R", "Form1099K", "Form1095B"]) + type_validator = EnumAttributeValidator.new('String', ["1099-NEC", "1099-MISC", "1099-DIV", "1099-R", "1099-K", "1095-B", "1042-S"]) return false unless type_validator.valid?(@type) + return false if @recipient_name.nil? + return false if @recipient_name.to_s.length < 1 tin_type_validator = EnumAttributeValidator.new('String', ["EIN", "SSN", "ITIN", "ATIN"]) return false unless tin_type_validator.valid?(@tin_type) + return false if @address.nil? + return false if @address.to_s.length < 1 + return false if @city.nil? + return false if @city.to_s.length < 1 + return false if @country_code.nil? + return false if @country_code.to_s.length < 1 true end # Custom attribute writer method checking allowed values (enum). # @param [Object] origin_of_health_coverage_code Object to be assigned def origin_of_health_coverage_code=(origin_of_health_coverage_code) - validator = EnumAttributeValidator.new('String', ["SmallBusinessHealthOptionsProgram", "EmployerSponsored", "GovernmentSponsored", "IndividualMarket", "MultiemployerPlan", "OtherDesignatedMinimumEssentialCoverage", "EmployerSponsoredIndividualHra"]) + validator = EnumAttributeValidator.new('String', ["A", "B", "C", "D", "E", "F", "G"]) unless validator.valid?(origin_of_health_coverage_code) fail ArgumentError, "invalid value for \"origin_of_health_coverage_code\", must be one of #{validator.allowable_values}." end @@ -376,13 +453,27 @@ def covered_individuals=(covered_individuals) # Custom attribute writer method checking allowed values (enum). # @param [Object] type Object to be assigned def type=(type) - validator = EnumAttributeValidator.new('String', ["Form1099Nec", "Form1099Misc", "Form1099Div", "Form1099R", "Form1099K", "Form1095B"]) + validator = EnumAttributeValidator.new('String', ["1099-NEC", "1099-MISC", "1099-DIV", "1099-R", "1099-K", "1095-B", "1042-S"]) unless validator.valid?(type) fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." end @type = type end + # Custom attribute writer method with validation + # @param [Object] recipient_name Value to be assigned + def recipient_name=(recipient_name) + if recipient_name.nil? + fail ArgumentError, 'recipient_name cannot be nil' + end + + if recipient_name.to_s.length < 1 + fail ArgumentError, 'invalid value for "recipient_name", the character length must be great than or equal to 1.' + end + + @recipient_name = recipient_name + end + # Custom attribute writer method checking allowed values (enum). # @param [Object] tin_type Object to be assigned def tin_type=(tin_type) @@ -393,6 +484,48 @@ def tin_type=(tin_type) @tin_type = tin_type end + # Custom attribute writer method with validation + # @param [Object] address Value to be assigned + def address=(address) + if address.nil? + fail ArgumentError, 'address cannot be nil' + end + + if address.to_s.length < 1 + fail ArgumentError, 'invalid value for "address", the character length must be great than or equal to 1.' + end + + @address = address + end + + # Custom attribute writer method with validation + # @param [Object] city Value to be assigned + def city=(city) + if city.nil? + fail ArgumentError, 'city cannot be nil' + end + + if city.to_s.length < 1 + fail ArgumentError, 'invalid value for "city", the character length must be great than or equal to 1.' + end + + @city = city + end + + # Custom attribute writer method with validation + # @param [Object] country_code Value to be assigned + def country_code=(country_code) + if country_code.nil? + fail ArgumentError, 'country_code cannot be nil' + end + + if country_code.to_s.length < 1 + fail ArgumentError, 'invalid value for "country_code", the character length must be great than or equal to 1.' + end + + @country_code = country_code + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -408,8 +541,8 @@ def ==(o) type == o.type && issuer_id == o.issuer_id && reference_id == o.reference_id && - recipient_name == o.recipient_name && recipient_tin == o.recipient_tin && + recipient_name == o.recipient_name && tin_type == o.tin_type && recipient_second_name == o.recipient_second_name && address == o.address && @@ -439,7 +572,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [employee_first_name, employee_middle_name, employee_last_name, employee_name_suffix, employee_date_of_birth, origin_of_health_coverage_code, covered_individuals, type, issuer_id, reference_id, recipient_name, recipient_tin, tin_type, recipient_second_name, address, address2, city, state, zip, recipient_email, account_number, office_code, recipient_non_us_province, country_code, federal_e_file, postal_mail, state_e_file, tin_match, address_verification, state_and_local_withholding].hash + [employee_first_name, employee_middle_name, employee_last_name, employee_name_suffix, employee_date_of_birth, origin_of_health_coverage_code, covered_individuals, type, issuer_id, reference_id, recipient_tin, recipient_name, tin_type, recipient_second_name, address, address2, city, state, zip, recipient_email, account_number, office_code, recipient_non_us_province, country_code, federal_e_file, postal_mail, state_e_file, tin_match, address_verification, state_and_local_withholding].hash end # Builds the object from hash diff --git a/lib/avalara_sdk/models/A1099/V2/form1099_base_response.rb b/lib/avalara_sdk/models/A1099/V2/form1099_base_response.rb new file mode 100644 index 0000000..5aa9a10 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/form1099_base_response.rb @@ -0,0 +1,661 @@ +=begin +#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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class Form1099BaseResponse + # ID of the form + attr_accessor :id + + # 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 + attr_accessor :type + + # Issuer ID + attr_accessor :issuer_id + + # Issuer Reference ID + attr_accessor :issuer_reference_id + + # Issuer TIN + attr_accessor :issuer_tin + + # Tax year + attr_accessor :tax_year + + # Boolean indicating that federal e-filing has been scheduled for this form + attr_accessor :federal_efile + + # Federal e-file status + attr_accessor :federal_efile_status + + # Boolean indicating that state e-filing has been scheduled for this form + attr_accessor :state_efile + + # State e-file status + attr_accessor :state_efile_status + + # Boolean indicating that postal mailing to the recipient has been scheduled for this form + attr_accessor :postal_mail + + # Postal mail to recipient status + attr_accessor :postal_mail_status + + # Boolean indicating that TIN Matching has been scheduled for this form + attr_accessor :tin_match + + # TIN Match status + attr_accessor :tin_match_status + + # Boolean indicating that address verification has been scheduled for this form + attr_accessor :address_verification + + # Address verification status + attr_accessor :address_verification_status + + # Reference ID + attr_accessor :reference_id + + # Recipient email address + attr_accessor :email + + # Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN + attr_accessor :tin_type + + # Recipient Tax ID Number + attr_accessor :tin + + # Recipient name + attr_accessor :recipient_name + + # Recipient second name + attr_accessor :recipient_second_name + + # Address + attr_accessor :address + + # Address line 2 + attr_accessor :address2 + + # City + attr_accessor :city + + # US state + attr_accessor :state + + # Zip/postal code + attr_accessor :zip + + # Foreign province + attr_accessor :foreign_province + + # Country code, as defined at https://www.irs.gov/e-file-providers/country-codes + attr_accessor :country_code + + # Validation errors + attr_accessor :validation_errors + + # Creation time + attr_accessor :created_at + + # Update time + attr_accessor :updated_at + + attr_accessor :state_and_local_withholding + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type', + :'issuer_id' => :'issuerId', + :'issuer_reference_id' => :'issuerReferenceId', + :'issuer_tin' => :'issuerTin', + :'tax_year' => :'taxYear', + :'federal_efile' => :'federalEfile', + :'federal_efile_status' => :'federalEfileStatus', + :'state_efile' => :'stateEfile', + :'state_efile_status' => :'stateEfileStatus', + :'postal_mail' => :'postalMail', + :'postal_mail_status' => :'postalMailStatus', + :'tin_match' => :'tinMatch', + :'tin_match_status' => :'tinMatchStatus', + :'address_verification' => :'addressVerification', + :'address_verification_status' => :'addressVerificationStatus', + :'reference_id' => :'referenceId', + :'email' => :'email', + :'tin_type' => :'tinType', + :'tin' => :'tin', + :'recipient_name' => :'recipientName', + :'recipient_second_name' => :'recipientSecondName', + :'address' => :'address', + :'address2' => :'address2', + :'city' => :'city', + :'state' => :'state', + :'zip' => :'zip', + :'foreign_province' => :'foreignProvince', + :'country_code' => :'countryCode', + :'validation_errors' => :'validationErrors', + :'created_at' => :'createdAt', + :'updated_at' => :'updatedAt', + :'state_and_local_withholding' => :'stateAndLocalWithholding' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'type' => :'String', + :'issuer_id' => :'Integer', + :'issuer_reference_id' => :'String', + :'issuer_tin' => :'String', + :'tax_year' => :'Integer', + :'federal_efile' => :'Boolean', + :'federal_efile_status' => :'Form1099StatusDetailResponse', + :'state_efile' => :'Boolean', + :'state_efile_status' => :'Array', + :'postal_mail' => :'Boolean', + :'postal_mail_status' => :'Form1099StatusDetailResponse', + :'tin_match' => :'Boolean', + :'tin_match_status' => :'Form1099StatusDetailResponse', + :'address_verification' => :'Boolean', + :'address_verification_status' => :'Form1099StatusDetailResponse', + :'reference_id' => :'String', + :'email' => :'String', + :'tin_type' => :'String', + :'tin' => :'String', + :'recipient_name' => :'String', + :'recipient_second_name' => :'String', + :'address' => :'String', + :'address2' => :'String', + :'city' => :'String', + :'state' => :'String', + :'zip' => :'String', + :'foreign_province' => :'String', + :'country_code' => :'String', + :'validation_errors' => :'Array', + :'created_at' => :'Time', + :'updated_at' => :'Time', + :'state_and_local_withholding' => :'StateAndLocalWithholdingResponse' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'issuer_reference_id', + :'issuer_tin', + :'state_efile_status', + :'postal_mail_status', + :'tin_match_status', + :'address_verification_status', + :'reference_id', + :'email', + :'tin_type', + :'tin', + :'recipient_name', + :'recipient_second_name', + :'address', + :'address2', + :'city', + :'state', + :'zip', + :'foreign_province', + :'country_code', + :'validation_errors', + :'state_and_local_withholding' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::A1099::V2::Form1099BaseResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::A1099::V2::Form1099BaseResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + else + self.id = nil + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + else + self.type = nil + end + + if attributes.key?(:'issuer_id') + self.issuer_id = attributes[:'issuer_id'] + else + self.issuer_id = nil + end + + if attributes.key?(:'issuer_reference_id') + self.issuer_reference_id = attributes[:'issuer_reference_id'] + end + + if attributes.key?(:'issuer_tin') + self.issuer_tin = attributes[:'issuer_tin'] + end + + if attributes.key?(:'tax_year') + self.tax_year = attributes[:'tax_year'] + end + + if attributes.key?(:'federal_efile') + self.federal_efile = attributes[:'federal_efile'] + else + self.federal_efile = nil + end + + if attributes.key?(:'federal_efile_status') + self.federal_efile_status = attributes[:'federal_efile_status'] + end + + if attributes.key?(:'state_efile') + self.state_efile = attributes[:'state_efile'] + else + self.state_efile = nil + end + + if attributes.key?(:'state_efile_status') + if (value = attributes[:'state_efile_status']).is_a?(Array) + self.state_efile_status = value + end + end + + if attributes.key?(:'postal_mail') + self.postal_mail = attributes[:'postal_mail'] + else + self.postal_mail = nil + end + + if attributes.key?(:'postal_mail_status') + self.postal_mail_status = attributes[:'postal_mail_status'] + end + + if attributes.key?(:'tin_match') + self.tin_match = attributes[:'tin_match'] + else + self.tin_match = nil + end + + if attributes.key?(:'tin_match_status') + self.tin_match_status = attributes[:'tin_match_status'] + end + + if attributes.key?(:'address_verification') + self.address_verification = attributes[:'address_verification'] + else + self.address_verification = nil + end + + if attributes.key?(:'address_verification_status') + self.address_verification_status = attributes[:'address_verification_status'] + end + + if attributes.key?(:'reference_id') + self.reference_id = attributes[:'reference_id'] + end + + if attributes.key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.key?(:'tin_type') + self.tin_type = attributes[:'tin_type'] + end + + if attributes.key?(:'tin') + self.tin = attributes[:'tin'] + end + + if attributes.key?(:'recipient_name') + self.recipient_name = attributes[:'recipient_name'] + end + + if attributes.key?(:'recipient_second_name') + self.recipient_second_name = attributes[:'recipient_second_name'] + end + + if attributes.key?(:'address') + self.address = attributes[:'address'] + end + + if attributes.key?(:'address2') + self.address2 = attributes[:'address2'] + end + + if attributes.key?(:'city') + self.city = attributes[:'city'] + end + + if attributes.key?(:'state') + self.state = attributes[:'state'] + end + + if attributes.key?(:'zip') + self.zip = attributes[:'zip'] + end + + if attributes.key?(:'foreign_province') + self.foreign_province = attributes[:'foreign_province'] + end + + if attributes.key?(:'country_code') + self.country_code = attributes[:'country_code'] + end + + if attributes.key?(:'validation_errors') + if (value = attributes[:'validation_errors']).is_a?(Array) + self.validation_errors = value + end + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + end + + if attributes.key?(:'state_and_local_withholding') + self.state_and_local_withholding = attributes[:'state_and_local_withholding'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @id.nil? + invalid_properties.push('invalid value for "id", id cannot be nil.') + end + + if @id.to_s.length < 1 + invalid_properties.push('invalid value for "id", the character length must be great than or equal to 1.') + end + + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @type.to_s.length < 1 + invalid_properties.push('invalid value for "type", the character length must be great than or equal to 1.') + end + + if @issuer_id.nil? + invalid_properties.push('invalid value for "issuer_id", issuer_id cannot be nil.') + end + + if @federal_efile.nil? + invalid_properties.push('invalid value for "federal_efile", federal_efile cannot be nil.') + end + + if @state_efile.nil? + invalid_properties.push('invalid value for "state_efile", state_efile cannot be nil.') + end + + if @postal_mail.nil? + invalid_properties.push('invalid value for "postal_mail", postal_mail cannot be nil.') + end + + if @tin_match.nil? + invalid_properties.push('invalid value for "tin_match", tin_match cannot be nil.') + end + + if @address_verification.nil? + invalid_properties.push('invalid value for "address_verification", address_verification cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @id.nil? + return false if @id.to_s.length < 1 + return false if @type.nil? + return false if @type.to_s.length < 1 + return false if @issuer_id.nil? + return false if @federal_efile.nil? + return false if @state_efile.nil? + return false if @postal_mail.nil? + return false if @tin_match.nil? + return false if @address_verification.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + if id.to_s.length < 1 + fail ArgumentError, 'invalid value for "id", the character length must be great than or equal to 1.' + end + + @id = id + end + + # Custom attribute writer method with validation + # @param [Object] type Value to be assigned + def type=(type) + if type.nil? + fail ArgumentError, 'type cannot be nil' + end + + if type.to_s.length < 1 + fail ArgumentError, 'invalid value for "type", the character length must be great than or equal to 1.' + end + + @type = type + end + + # Custom attribute writer method with validation + # @param [Object] state_efile_status Value to be assigned + def state_efile_status=(state_efile_status) + @state_efile_status = state_efile_status + end + + # Custom attribute writer method with validation + # @param [Object] validation_errors Value to be assigned + def validation_errors=(validation_errors) + @validation_errors = validation_errors + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + issuer_id == o.issuer_id && + issuer_reference_id == o.issuer_reference_id && + issuer_tin == o.issuer_tin && + tax_year == o.tax_year && + federal_efile == o.federal_efile && + federal_efile_status == o.federal_efile_status && + state_efile == o.state_efile && + state_efile_status == o.state_efile_status && + postal_mail == o.postal_mail && + postal_mail_status == o.postal_mail_status && + tin_match == o.tin_match && + tin_match_status == o.tin_match_status && + address_verification == o.address_verification && + address_verification_status == o.address_verification_status && + reference_id == o.reference_id && + email == o.email && + tin_type == o.tin_type && + tin == o.tin && + recipient_name == o.recipient_name && + recipient_second_name == o.recipient_second_name && + address == o.address && + address2 == o.address2 && + city == o.city && + state == o.state && + zip == o.zip && + foreign_province == o.foreign_province && + country_code == o.country_code && + validation_errors == o.validation_errors && + created_at == o.created_at && + updated_at == o.updated_at && + state_and_local_withholding == o.state_and_local_withholding + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, type, issuer_id, issuer_reference_id, issuer_tin, tax_year, federal_efile, federal_efile_status, state_efile, state_efile_status, postal_mail, postal_mail_status, tin_match, tin_match_status, address_verification, address_verification_status, reference_id, email, tin_type, tin, recipient_name, recipient_second_name, address, address2, city, state, zip, foreign_province, country_code, validation_errors, created_at, updated_at, state_and_local_withholding].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::A1099::V2.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/A1099/V2/form1099_div_list.rb b/lib/avalara_sdk/models/A1099/V2/form1099_div_list.rb index 91c28ea..6a8d367 100644 --- a/lib/avalara_sdk/models/A1099/V2/form1099_div_list.rb +++ b/lib/avalara_sdk/models/A1099/V2/form1099_div_list.rb @@ -1,7 +1,7 @@ =begin #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) =end diff --git a/lib/avalara_sdk/models/A1099/V2/form1099_div_list_item.rb b/lib/avalara_sdk/models/A1099/V2/form1099_div_list_item.rb index ab9e676..099af25 100644 --- a/lib/avalara_sdk/models/A1099/V2/form1099_div_list_item.rb +++ b/lib/avalara_sdk/models/A1099/V2/form1099_div_list_item.rb @@ -1,7 +1,7 @@ =begin #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) =end @@ -11,92 +11,136 @@ module AvalaraSdk::A1099::V2 class Form1099DivListItem + # Total ordinary dividends attr_accessor :total_ordinary_dividends + # Qualified dividends attr_accessor :qualified_dividends + # Total capital gain distributions attr_accessor :total_capital_gain_distr + # Unrecaptured Section 1250 gain attr_accessor :unrecap_sec1250_gain + # Section 1202 gain attr_accessor :section1202_gain + # Collectibles (28%) gain attr_accessor :collectibles_gain + # Section 897 ordinary dividends attr_accessor :section897_ordinary_dividends + # Section 897 capital gain attr_accessor :section897_capital_gain + # Nondividend distributions attr_accessor :nondividend_distributions + # Federal income tax withheld attr_accessor :federal_income_tax_withheld + # Section 199A dividends attr_accessor :section199_a_dividends + # Investment expenses attr_accessor :investment_expenses + # Foreign tax paid attr_accessor :foreign_tax_paid + # Foreign country or U.S. possession attr_accessor :foreign_country_or_us_possession + # Cash liquidation distributions attr_accessor :cash_liquidation_distributions + # Noncash liquidation distributions attr_accessor :noncash_liquidation_distributions + # Exempt-interest dividends attr_accessor :exempt_interest_dividends + # Specified private activity bond interest dividends attr_accessor :specified_private_activity_bond_interest_dividends + # FATCA filing requirement attr_accessor :fatca_filing_requirement + # Issuer Reference ID. One of `issuerReferenceId` or `issuerTin` is required. attr_accessor :issuer_reference_id + # Issuer TIN. One of `issuerReferenceId` or `issuerTin` is required. attr_accessor :issuer_tin + # Tax year attr_accessor :tax_year + # Issuer ID attr_accessor :issuer_id + # Reference ID attr_accessor :reference_id - attr_accessor :recipient_name - + # Recipient Tax ID Number attr_accessor :recipient_tin + # Recipient name + attr_accessor :recipient_name + + # Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN attr_accessor :tin_type + # Recipient second name attr_accessor :recipient_second_name + # Address attr_accessor :address + # Address line 2 attr_accessor :address2 + # City attr_accessor :city + # US state. Required if CountryCode is \"US\". attr_accessor :state + # Zip/postal code attr_accessor :zip + # Recipient email address attr_accessor :recipient_email + # Account number attr_accessor :account_number + # Office code attr_accessor :office_code + # Foreign province attr_accessor :recipient_non_us_province + # Country code, as defined at https://www.irs.gov/e-file-providers/country-codes attr_accessor :country_code + # Boolean indicating that federal e-filing should be scheduled for this form attr_accessor :federal_e_file + # Boolean indicating that postal mailing to the recipient should be scheduled for this form attr_accessor :postal_mail + # Boolean indicating that state e-filing should be scheduled for this form attr_accessor :state_e_file + # Boolean indicating that TIN Matching should be scheduled for this form attr_accessor :tin_match + # Boolean indicating that address verification should be scheduled for this form attr_accessor :address_verification + # State and local withholding information attr_accessor :state_and_local_withholding class EnumAttributeValidator @@ -148,8 +192,8 @@ def self.attribute_map :'tax_year' => :'taxYear', :'issuer_id' => :'issuerId', :'reference_id' => :'referenceId', - :'recipient_name' => :'recipientName', :'recipient_tin' => :'recipientTin', + :'recipient_name' => :'recipientName', :'tin_type' => :'tinType', :'recipient_second_name' => :'recipientSecondName', :'address' => :'address', @@ -203,8 +247,8 @@ def self.openapi_types :'tax_year' => :'Integer', :'issuer_id' => :'String', :'reference_id' => :'String', - :'recipient_name' => :'String', :'recipient_tin' => :'String', + :'recipient_name' => :'String', :'tin_type' => :'String', :'recipient_second_name' => :'String', :'address' => :'String', @@ -231,7 +275,7 @@ def self.openapi_nullable Set.new([ :'issuer_id', :'reference_id', - :'recipient_name', + :'recipient_second_name', :'address2', :'recipient_email', :'account_number', @@ -243,7 +287,7 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'FormRequestCsvBase' + :'FormRequestListItemBase' ] end @@ -348,6 +392,8 @@ def initialize(attributes = {}) if attributes.key?(:'tax_year') self.tax_year = attributes[:'tax_year'] + else + self.tax_year = nil end if attributes.key?(:'issuer_id') @@ -358,14 +404,16 @@ def initialize(attributes = {}) self.reference_id = attributes[:'reference_id'] end - if attributes.key?(:'recipient_name') - self.recipient_name = attributes[:'recipient_name'] - end - if attributes.key?(:'recipient_tin') self.recipient_tin = attributes[:'recipient_tin'] end + if attributes.key?(:'recipient_name') + self.recipient_name = attributes[:'recipient_name'] + else + self.recipient_name = nil + end + if attributes.key?(:'tin_type') self.tin_type = attributes[:'tin_type'] end @@ -376,6 +424,8 @@ def initialize(attributes = {}) if attributes.key?(:'address') self.address = attributes[:'address'] + else + self.address = nil end if attributes.key?(:'address2') @@ -384,6 +434,8 @@ def initialize(attributes = {}) if attributes.key?(:'city') self.city = attributes[:'city'] + else + self.city = nil end if attributes.key?(:'state') @@ -412,6 +464,8 @@ def initialize(attributes = {}) if attributes.key?(:'country_code') self.country_code = attributes[:'country_code'] + else + self.country_code = nil end if attributes.key?(:'federal_e_file') @@ -444,6 +498,42 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @tax_year.nil? + invalid_properties.push('invalid value for "tax_year", tax_year cannot be nil.') + end + + if @recipient_name.nil? + invalid_properties.push('invalid value for "recipient_name", recipient_name cannot be nil.') + end + + if @recipient_name.to_s.length < 1 + invalid_properties.push('invalid value for "recipient_name", the character length must be great than or equal to 1.') + end + + if @address.nil? + invalid_properties.push('invalid value for "address", address cannot be nil.') + end + + if @address.to_s.length < 1 + invalid_properties.push('invalid value for "address", the character length must be great than or equal to 1.') + end + + if @city.nil? + invalid_properties.push('invalid value for "city", city cannot be nil.') + end + + if @city.to_s.length < 1 + invalid_properties.push('invalid value for "city", the character length must be great than or equal to 1.') + end + + if @country_code.nil? + invalid_properties.push('invalid value for "country_code", country_code cannot be nil.') + end + + if @country_code.to_s.length < 1 + invalid_properties.push('invalid value for "country_code", the character length must be great than or equal to 1.') + end + invalid_properties end @@ -451,11 +541,34 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @tax_year.nil? + return false if @recipient_name.nil? + return false if @recipient_name.to_s.length < 1 tin_type_validator = EnumAttributeValidator.new('String', ["EIN", "SSN", "ITIN", "ATIN"]) return false unless tin_type_validator.valid?(@tin_type) + return false if @address.nil? + return false if @address.to_s.length < 1 + return false if @city.nil? + return false if @city.to_s.length < 1 + return false if @country_code.nil? + return false if @country_code.to_s.length < 1 true end + # Custom attribute writer method with validation + # @param [Object] recipient_name Value to be assigned + def recipient_name=(recipient_name) + if recipient_name.nil? + fail ArgumentError, 'recipient_name cannot be nil' + end + + if recipient_name.to_s.length < 1 + fail ArgumentError, 'invalid value for "recipient_name", the character length must be great than or equal to 1.' + end + + @recipient_name = recipient_name + end + # Custom attribute writer method checking allowed values (enum). # @param [Object] tin_type Object to be assigned def tin_type=(tin_type) @@ -466,6 +579,48 @@ def tin_type=(tin_type) @tin_type = tin_type end + # Custom attribute writer method with validation + # @param [Object] address Value to be assigned + def address=(address) + if address.nil? + fail ArgumentError, 'address cannot be nil' + end + + if address.to_s.length < 1 + fail ArgumentError, 'invalid value for "address", the character length must be great than or equal to 1.' + end + + @address = address + end + + # Custom attribute writer method with validation + # @param [Object] city Value to be assigned + def city=(city) + if city.nil? + fail ArgumentError, 'city cannot be nil' + end + + if city.to_s.length < 1 + fail ArgumentError, 'invalid value for "city", the character length must be great than or equal to 1.' + end + + @city = city + end + + # Custom attribute writer method with validation + # @param [Object] country_code Value to be assigned + def country_code=(country_code) + if country_code.nil? + fail ArgumentError, 'country_code cannot be nil' + end + + if country_code.to_s.length < 1 + fail ArgumentError, 'invalid value for "country_code", the character length must be great than or equal to 1.' + end + + @country_code = country_code + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -495,8 +650,8 @@ def ==(o) tax_year == o.tax_year && issuer_id == o.issuer_id && reference_id == o.reference_id && - recipient_name == o.recipient_name && recipient_tin == o.recipient_tin && + recipient_name == o.recipient_name && tin_type == o.tin_type && recipient_second_name == o.recipient_second_name && address == o.address && @@ -526,7 +681,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [total_ordinary_dividends, qualified_dividends, total_capital_gain_distr, unrecap_sec1250_gain, section1202_gain, collectibles_gain, section897_ordinary_dividends, section897_capital_gain, nondividend_distributions, federal_income_tax_withheld, section199_a_dividends, investment_expenses, foreign_tax_paid, foreign_country_or_us_possession, cash_liquidation_distributions, noncash_liquidation_distributions, exempt_interest_dividends, specified_private_activity_bond_interest_dividends, fatca_filing_requirement, issuer_reference_id, issuer_tin, tax_year, issuer_id, reference_id, recipient_name, recipient_tin, tin_type, recipient_second_name, address, address2, city, state, zip, recipient_email, account_number, office_code, recipient_non_us_province, country_code, federal_e_file, postal_mail, state_e_file, tin_match, address_verification, state_and_local_withholding].hash + [total_ordinary_dividends, qualified_dividends, total_capital_gain_distr, unrecap_sec1250_gain, section1202_gain, collectibles_gain, section897_ordinary_dividends, section897_capital_gain, nondividend_distributions, federal_income_tax_withheld, section199_a_dividends, investment_expenses, foreign_tax_paid, foreign_country_or_us_possession, cash_liquidation_distributions, noncash_liquidation_distributions, exempt_interest_dividends, specified_private_activity_bond_interest_dividends, fatca_filing_requirement, issuer_reference_id, issuer_tin, tax_year, issuer_id, reference_id, recipient_tin, recipient_name, tin_type, recipient_second_name, address, address2, city, state, zip, recipient_email, account_number, office_code, recipient_non_us_province, country_code, federal_e_file, postal_mail, state_e_file, tin_match, address_verification, state_and_local_withholding].hash end # Builds the object from hash diff --git a/lib/avalara_sdk/models/A1099/V2/form1099_div_request.rb b/lib/avalara_sdk/models/A1099/V2/form1099_div_request.rb index 7096927..674737e 100644 --- a/lib/avalara_sdk/models/A1099/V2/form1099_div_request.rb +++ b/lib/avalara_sdk/models/A1099/V2/form1099_div_request.rb @@ -1,7 +1,7 @@ =begin #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) =end @@ -11,88 +11,129 @@ module AvalaraSdk::A1099::V2 class Form1099DivRequest + # Total ordinary dividends attr_accessor :total_ordinary_dividends + # Qualified dividends attr_accessor :qualified_dividends + # Total capital gain distributions attr_accessor :total_capital_gain_distr + # Unrecaptured Section 1250 gain attr_accessor :unrecap_sec1250_gain + # Section 1202 gain attr_accessor :section1202_gain + # Collectibles (28%) gain attr_accessor :collectibles_gain + # Section 897 ordinary dividends attr_accessor :section897_ordinary_dividends + # Section 897 capital gain attr_accessor :section897_capital_gain + # Nondividend distributions attr_accessor :nondividend_distributions + # Federal income tax withheld attr_accessor :federal_income_tax_withheld + # Section 199A dividends attr_accessor :section199_a_dividends + # Investment expenses attr_accessor :investment_expenses + # Foreign tax paid attr_accessor :foreign_tax_paid + # Foreign country or U.S. possession attr_accessor :foreign_country_or_us_possession + # Cash liquidation distributions attr_accessor :cash_liquidation_distributions + # Noncash liquidation distributions attr_accessor :noncash_liquidation_distributions + # Exempt-interest dividends attr_accessor :exempt_interest_dividends + # Specified private activity bond interest dividends attr_accessor :specified_private_activity_bond_interest_dividends + # FATCA filing requirement attr_accessor :fatca_filing_requirement attr_accessor :type + # Issuer ID attr_accessor :issuer_id + # Reference ID attr_accessor :reference_id - attr_accessor :recipient_name - + # Recipient Tax ID Number attr_accessor :recipient_tin + # Recipient name + attr_accessor :recipient_name + + # Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN attr_accessor :tin_type + # Recipient second name attr_accessor :recipient_second_name + # Address attr_accessor :address + # Address line 2 attr_accessor :address2 + # City attr_accessor :city + # US state. Required if CountryCode is \"US\". attr_accessor :state + # Zip/postal code attr_accessor :zip + # Recipient email address attr_accessor :recipient_email + # Account number attr_accessor :account_number + # Office code attr_accessor :office_code + # Foreign province attr_accessor :recipient_non_us_province + # Country code, as defined at https://www.irs.gov/e-file-providers/country-codes attr_accessor :country_code + # Boolean indicating that federal e-filing should be scheduled for this form attr_accessor :federal_e_file + # Boolean indicating that postal mailing to the recipient should be scheduled for this form attr_accessor :postal_mail + # Boolean indicating that state e-filing should be scheduled for this form attr_accessor :state_e_file + # Boolean indicating that TIN Matching should be scheduled for this form attr_accessor :tin_match + # Boolean indicating that address verification should be scheduled for this form attr_accessor :address_verification + # State and local withholding information attr_accessor :state_and_local_withholding class EnumAttributeValidator @@ -142,8 +183,8 @@ def self.attribute_map :'type' => :'type', :'issuer_id' => :'issuerId', :'reference_id' => :'referenceId', - :'recipient_name' => :'recipientName', :'recipient_tin' => :'recipientTin', + :'recipient_name' => :'recipientName', :'tin_type' => :'tinType', :'recipient_second_name' => :'recipientSecondName', :'address' => :'address', @@ -195,8 +236,8 @@ def self.openapi_types :'type' => :'String', :'issuer_id' => :'String', :'reference_id' => :'String', - :'recipient_name' => :'String', :'recipient_tin' => :'String', + :'recipient_name' => :'String', :'tin_type' => :'String', :'recipient_second_name' => :'String', :'address' => :'String', @@ -223,7 +264,7 @@ def self.openapi_nullable Set.new([ :'issuer_id', :'reference_id', - :'recipient_name', + :'recipient_second_name', :'address2', :'recipient_email', :'account_number', @@ -342,14 +383,16 @@ def initialize(attributes = {}) self.reference_id = attributes[:'reference_id'] end - if attributes.key?(:'recipient_name') - self.recipient_name = attributes[:'recipient_name'] - end - if attributes.key?(:'recipient_tin') self.recipient_tin = attributes[:'recipient_tin'] end + if attributes.key?(:'recipient_name') + self.recipient_name = attributes[:'recipient_name'] + else + self.recipient_name = nil + end + if attributes.key?(:'tin_type') self.tin_type = attributes[:'tin_type'] end @@ -360,6 +403,8 @@ def initialize(attributes = {}) if attributes.key?(:'address') self.address = attributes[:'address'] + else + self.address = nil end if attributes.key?(:'address2') @@ -368,6 +413,8 @@ def initialize(attributes = {}) if attributes.key?(:'city') self.city = attributes[:'city'] + else + self.city = nil end if attributes.key?(:'state') @@ -396,6 +443,8 @@ def initialize(attributes = {}) if attributes.key?(:'country_code') self.country_code = attributes[:'country_code'] + else + self.country_code = nil end if attributes.key?(:'federal_e_file') @@ -428,6 +477,38 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @recipient_name.nil? + invalid_properties.push('invalid value for "recipient_name", recipient_name cannot be nil.') + end + + if @recipient_name.to_s.length < 1 + invalid_properties.push('invalid value for "recipient_name", the character length must be great than or equal to 1.') + end + + if @address.nil? + invalid_properties.push('invalid value for "address", address cannot be nil.') + end + + if @address.to_s.length < 1 + invalid_properties.push('invalid value for "address", the character length must be great than or equal to 1.') + end + + if @city.nil? + invalid_properties.push('invalid value for "city", city cannot be nil.') + end + + if @city.to_s.length < 1 + invalid_properties.push('invalid value for "city", the character length must be great than or equal to 1.') + end + + if @country_code.nil? + invalid_properties.push('invalid value for "country_code", country_code cannot be nil.') + end + + if @country_code.to_s.length < 1 + invalid_properties.push('invalid value for "country_code", the character length must be great than or equal to 1.') + end + invalid_properties end @@ -435,23 +516,45 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - type_validator = EnumAttributeValidator.new('String', ["Form1099Nec", "Form1099Misc", "Form1099Div", "Form1099R", "Form1099K", "Form1095B"]) + type_validator = EnumAttributeValidator.new('String', ["1099-NEC", "1099-MISC", "1099-DIV", "1099-R", "1099-K", "1095-B", "1042-S"]) return false unless type_validator.valid?(@type) + return false if @recipient_name.nil? + return false if @recipient_name.to_s.length < 1 tin_type_validator = EnumAttributeValidator.new('String', ["EIN", "SSN", "ITIN", "ATIN"]) return false unless tin_type_validator.valid?(@tin_type) + return false if @address.nil? + return false if @address.to_s.length < 1 + return false if @city.nil? + return false if @city.to_s.length < 1 + return false if @country_code.nil? + return false if @country_code.to_s.length < 1 true end # Custom attribute writer method checking allowed values (enum). # @param [Object] type Object to be assigned def type=(type) - validator = EnumAttributeValidator.new('String', ["Form1099Nec", "Form1099Misc", "Form1099Div", "Form1099R", "Form1099K", "Form1095B"]) + validator = EnumAttributeValidator.new('String', ["1099-NEC", "1099-MISC", "1099-DIV", "1099-R", "1099-K", "1095-B", "1042-S"]) unless validator.valid?(type) fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." end @type = type end + # Custom attribute writer method with validation + # @param [Object] recipient_name Value to be assigned + def recipient_name=(recipient_name) + if recipient_name.nil? + fail ArgumentError, 'recipient_name cannot be nil' + end + + if recipient_name.to_s.length < 1 + fail ArgumentError, 'invalid value for "recipient_name", the character length must be great than or equal to 1.' + end + + @recipient_name = recipient_name + end + # Custom attribute writer method checking allowed values (enum). # @param [Object] tin_type Object to be assigned def tin_type=(tin_type) @@ -462,6 +565,48 @@ def tin_type=(tin_type) @tin_type = tin_type end + # Custom attribute writer method with validation + # @param [Object] address Value to be assigned + def address=(address) + if address.nil? + fail ArgumentError, 'address cannot be nil' + end + + if address.to_s.length < 1 + fail ArgumentError, 'invalid value for "address", the character length must be great than or equal to 1.' + end + + @address = address + end + + # Custom attribute writer method with validation + # @param [Object] city Value to be assigned + def city=(city) + if city.nil? + fail ArgumentError, 'city cannot be nil' + end + + if city.to_s.length < 1 + fail ArgumentError, 'invalid value for "city", the character length must be great than or equal to 1.' + end + + @city = city + end + + # Custom attribute writer method with validation + # @param [Object] country_code Value to be assigned + def country_code=(country_code) + if country_code.nil? + fail ArgumentError, 'country_code cannot be nil' + end + + if country_code.to_s.length < 1 + fail ArgumentError, 'invalid value for "country_code", the character length must be great than or equal to 1.' + end + + @country_code = country_code + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -489,8 +634,8 @@ def ==(o) type == o.type && issuer_id == o.issuer_id && reference_id == o.reference_id && - recipient_name == o.recipient_name && recipient_tin == o.recipient_tin && + recipient_name == o.recipient_name && tin_type == o.tin_type && recipient_second_name == o.recipient_second_name && address == o.address && @@ -520,7 +665,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [total_ordinary_dividends, qualified_dividends, total_capital_gain_distr, unrecap_sec1250_gain, section1202_gain, collectibles_gain, section897_ordinary_dividends, section897_capital_gain, nondividend_distributions, federal_income_tax_withheld, section199_a_dividends, investment_expenses, foreign_tax_paid, foreign_country_or_us_possession, cash_liquidation_distributions, noncash_liquidation_distributions, exempt_interest_dividends, specified_private_activity_bond_interest_dividends, fatca_filing_requirement, type, issuer_id, reference_id, recipient_name, recipient_tin, tin_type, recipient_second_name, address, address2, city, state, zip, recipient_email, account_number, office_code, recipient_non_us_province, country_code, federal_e_file, postal_mail, state_e_file, tin_match, address_verification, state_and_local_withholding].hash + [total_ordinary_dividends, qualified_dividends, total_capital_gain_distr, unrecap_sec1250_gain, section1202_gain, collectibles_gain, section897_ordinary_dividends, section897_capital_gain, nondividend_distributions, federal_income_tax_withheld, section199_a_dividends, investment_expenses, foreign_tax_paid, foreign_country_or_us_possession, cash_liquidation_distributions, noncash_liquidation_distributions, exempt_interest_dividends, specified_private_activity_bond_interest_dividends, fatca_filing_requirement, type, issuer_id, reference_id, recipient_tin, recipient_name, tin_type, recipient_second_name, address, address2, city, state, zip, recipient_email, account_number, office_code, recipient_non_us_province, country_code, federal_e_file, postal_mail, state_e_file, tin_match, address_verification, state_and_local_withholding].hash end # Builds the object from hash diff --git a/lib/avalara_sdk/models/A1099/V2/form1099_div_response.rb b/lib/avalara_sdk/models/A1099/V2/form1099_div_response.rb index c699451..1456c5c 100644 --- a/lib/avalara_sdk/models/A1099/V2/form1099_div_response.rb +++ b/lib/avalara_sdk/models/A1099/V2/form1099_div_response.rb @@ -1,7 +1,7 @@ =begin #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) =end @@ -186,11 +186,11 @@ def self.openapi_types :'tin_match' => :'Boolean', :'address_verification' => :'Boolean', :'federal_efile_status' => :'StatusDetail', - :'state_efile_status' => :'Array', + :'state_efile_status' => :'Array', :'postal_mail_status' => :'StatusDetail', :'tin_match_status' => :'StatusDetail', :'address_verification_status' => :'StatusDetail', - :'validation_errors' => :'Array' + :'validation_errors' => :'Array' } end @@ -389,7 +389,7 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - type_validator = EnumAttributeValidator.new('String', ["Form1099Nec", "Form1099Misc", "Form1099Div", "Form1099R", "Form1099K", "Form1095B"]) + type_validator = EnumAttributeValidator.new('String', ["1099-NEC", "1099-MISC", "1099-DIV", "1099-R", "1099-K", "1095-B", "1042-S"]) return false unless type_validator.valid?(@type) tin_type_validator = EnumAttributeValidator.new('String', ["EIN", "SSN", "ITIN", "ATIN"]) return false unless tin_type_validator.valid?(@tin_type) @@ -399,7 +399,7 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] type Object to be assigned def type=(type) - validator = EnumAttributeValidator.new('String', ["Form1099Nec", "Form1099Misc", "Form1099Div", "Form1099R", "Form1099K", "Form1095B"]) + validator = EnumAttributeValidator.new('String', ["1099-NEC", "1099-MISC", "1099-DIV", "1099-R", "1099-K", "1095-B", "1042-S"]) unless validator.valid?(type) fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." end diff --git a/lib/avalara_sdk/models/A1099/V2/form1099_k_list.rb b/lib/avalara_sdk/models/A1099/V2/form1099_k_list.rb index 9820cf4..0624a43 100644 --- a/lib/avalara_sdk/models/A1099/V2/form1099_k_list.rb +++ b/lib/avalara_sdk/models/A1099/V2/form1099_k_list.rb @@ -1,7 +1,7 @@ =begin #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) =end diff --git a/lib/avalara_sdk/models/A1099/V2/form1099_k_list_item.rb b/lib/avalara_sdk/models/A1099/V2/form1099_k_list_item.rb index 0a9bbf9..a3e3de9 100644 --- a/lib/avalara_sdk/models/A1099/V2/form1099_k_list_item.rb +++ b/lib/avalara_sdk/models/A1099/V2/form1099_k_list_item.rb @@ -1,7 +1,7 @@ =begin #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) =end @@ -11,94 +11,139 @@ module AvalaraSdk::A1099::V2 class Form1099KListItem + # Filer type (PSE or EPF) attr_accessor :filer_type + # Payment type (payment card or third party network) attr_accessor :payment_type + # Payment settlement entity name and phone number attr_accessor :payment_settlement_entity_name_phone_number + # Gross amount of payment card/third party network transactions attr_accessor :gross_amount_payment_card + # Card not present transactions attr_accessor :card_not_present_transactions + # Merchant category code attr_accessor :merchant_category_code + # Number of payment transactions attr_accessor :payment_transaction_number + # Federal income tax withheld attr_accessor :federal_income_tax_withheld + # January gross payments attr_accessor :january + # February gross payments attr_accessor :february + # March gross payments attr_accessor :march + # April gross payments attr_accessor :april + # May gross payments attr_accessor :may + # June gross payments attr_accessor :june + # July gross payments attr_accessor :july + # August gross payments attr_accessor :august + # September gross payments attr_accessor :sept + # October gross payments attr_accessor :october + # November gross payments attr_accessor :november + # December gross payments attr_accessor :december + # Issuer Reference ID. One of `issuerReferenceId` or `issuerTin` is required. attr_accessor :issuer_reference_id + # Issuer TIN. One of `issuerReferenceId` or `issuerTin` is required. attr_accessor :issuer_tin + # Tax year attr_accessor :tax_year + # Issuer ID attr_accessor :issuer_id + # Reference ID attr_accessor :reference_id - attr_accessor :recipient_name - + # Recipient Tax ID Number attr_accessor :recipient_tin + # Recipient name + attr_accessor :recipient_name + + # Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN attr_accessor :tin_type + # Recipient second name attr_accessor :recipient_second_name + # Address attr_accessor :address + # Address line 2 attr_accessor :address2 + # City attr_accessor :city + # US state. Required if CountryCode is \"US\". attr_accessor :state + # Zip/postal code attr_accessor :zip + # Recipient email address attr_accessor :recipient_email + # Account number attr_accessor :account_number + # Office code attr_accessor :office_code + # Foreign province attr_accessor :recipient_non_us_province + # Country code, as defined at https://www.irs.gov/e-file-providers/country-codes attr_accessor :country_code + # Boolean indicating that federal e-filing should be scheduled for this form attr_accessor :federal_e_file + # Boolean indicating that postal mailing to the recipient should be scheduled for this form attr_accessor :postal_mail + # Boolean indicating that state e-filing should be scheduled for this form attr_accessor :state_e_file + # Boolean indicating that TIN Matching should be scheduled for this form attr_accessor :tin_match + # Boolean indicating that address verification should be scheduled for this form attr_accessor :address_verification + # State and local withholding information attr_accessor :state_and_local_withholding class EnumAttributeValidator @@ -151,8 +196,8 @@ def self.attribute_map :'tax_year' => :'taxYear', :'issuer_id' => :'issuerId', :'reference_id' => :'referenceId', - :'recipient_name' => :'recipientName', :'recipient_tin' => :'recipientTin', + :'recipient_name' => :'recipientName', :'tin_type' => :'tinType', :'recipient_second_name' => :'recipientSecondName', :'address' => :'address', @@ -207,8 +252,8 @@ def self.openapi_types :'tax_year' => :'Integer', :'issuer_id' => :'String', :'reference_id' => :'String', - :'recipient_name' => :'String', :'recipient_tin' => :'String', + :'recipient_name' => :'String', :'tin_type' => :'String', :'recipient_second_name' => :'String', :'address' => :'String', @@ -251,7 +296,7 @@ def self.openapi_nullable :'december', :'issuer_id', :'reference_id', - :'recipient_name', + :'recipient_second_name', :'address2', :'recipient_email', :'account_number', @@ -263,7 +308,7 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'FormRequestCsvBase' + :'FormRequestListItemBase' ] end @@ -372,6 +417,8 @@ def initialize(attributes = {}) if attributes.key?(:'tax_year') self.tax_year = attributes[:'tax_year'] + else + self.tax_year = nil end if attributes.key?(:'issuer_id') @@ -382,14 +429,16 @@ def initialize(attributes = {}) self.reference_id = attributes[:'reference_id'] end - if attributes.key?(:'recipient_name') - self.recipient_name = attributes[:'recipient_name'] - end - if attributes.key?(:'recipient_tin') self.recipient_tin = attributes[:'recipient_tin'] end + if attributes.key?(:'recipient_name') + self.recipient_name = attributes[:'recipient_name'] + else + self.recipient_name = nil + end + if attributes.key?(:'tin_type') self.tin_type = attributes[:'tin_type'] end @@ -400,6 +449,8 @@ def initialize(attributes = {}) if attributes.key?(:'address') self.address = attributes[:'address'] + else + self.address = nil end if attributes.key?(:'address2') @@ -408,6 +459,8 @@ def initialize(attributes = {}) if attributes.key?(:'city') self.city = attributes[:'city'] + else + self.city = nil end if attributes.key?(:'state') @@ -436,6 +489,8 @@ def initialize(attributes = {}) if attributes.key?(:'country_code') self.country_code = attributes[:'country_code'] + else + self.country_code = nil end if attributes.key?(:'federal_e_file') @@ -468,6 +523,42 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @tax_year.nil? + invalid_properties.push('invalid value for "tax_year", tax_year cannot be nil.') + end + + if @recipient_name.nil? + invalid_properties.push('invalid value for "recipient_name", recipient_name cannot be nil.') + end + + if @recipient_name.to_s.length < 1 + invalid_properties.push('invalid value for "recipient_name", the character length must be great than or equal to 1.') + end + + if @address.nil? + invalid_properties.push('invalid value for "address", address cannot be nil.') + end + + if @address.to_s.length < 1 + invalid_properties.push('invalid value for "address", the character length must be great than or equal to 1.') + end + + if @city.nil? + invalid_properties.push('invalid value for "city", city cannot be nil.') + end + + if @city.to_s.length < 1 + invalid_properties.push('invalid value for "city", the character length must be great than or equal to 1.') + end + + if @country_code.nil? + invalid_properties.push('invalid value for "country_code", country_code cannot be nil.') + end + + if @country_code.to_s.length < 1 + invalid_properties.push('invalid value for "country_code", the character length must be great than or equal to 1.') + end + invalid_properties end @@ -479,8 +570,17 @@ def valid? return false unless filer_type_validator.valid?(@filer_type) payment_type_validator = EnumAttributeValidator.new('String', ["MerchantPaymentCard", "ThirdPartyNetwork"]) return false unless payment_type_validator.valid?(@payment_type) + return false if @tax_year.nil? + return false if @recipient_name.nil? + return false if @recipient_name.to_s.length < 1 tin_type_validator = EnumAttributeValidator.new('String', ["EIN", "SSN", "ITIN", "ATIN"]) return false unless tin_type_validator.valid?(@tin_type) + return false if @address.nil? + return false if @address.to_s.length < 1 + return false if @city.nil? + return false if @city.to_s.length < 1 + return false if @country_code.nil? + return false if @country_code.to_s.length < 1 true end @@ -504,6 +604,20 @@ def payment_type=(payment_type) @payment_type = payment_type end + # Custom attribute writer method with validation + # @param [Object] recipient_name Value to be assigned + def recipient_name=(recipient_name) + if recipient_name.nil? + fail ArgumentError, 'recipient_name cannot be nil' + end + + if recipient_name.to_s.length < 1 + fail ArgumentError, 'invalid value for "recipient_name", the character length must be great than or equal to 1.' + end + + @recipient_name = recipient_name + end + # Custom attribute writer method checking allowed values (enum). # @param [Object] tin_type Object to be assigned def tin_type=(tin_type) @@ -514,6 +628,48 @@ def tin_type=(tin_type) @tin_type = tin_type end + # Custom attribute writer method with validation + # @param [Object] address Value to be assigned + def address=(address) + if address.nil? + fail ArgumentError, 'address cannot be nil' + end + + if address.to_s.length < 1 + fail ArgumentError, 'invalid value for "address", the character length must be great than or equal to 1.' + end + + @address = address + end + + # Custom attribute writer method with validation + # @param [Object] city Value to be assigned + def city=(city) + if city.nil? + fail ArgumentError, 'city cannot be nil' + end + + if city.to_s.length < 1 + fail ArgumentError, 'invalid value for "city", the character length must be great than or equal to 1.' + end + + @city = city + end + + # Custom attribute writer method with validation + # @param [Object] country_code Value to be assigned + def country_code=(country_code) + if country_code.nil? + fail ArgumentError, 'country_code cannot be nil' + end + + if country_code.to_s.length < 1 + fail ArgumentError, 'invalid value for "country_code", the character length must be great than or equal to 1.' + end + + @country_code = country_code + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -544,8 +700,8 @@ def ==(o) tax_year == o.tax_year && issuer_id == o.issuer_id && reference_id == o.reference_id && - recipient_name == o.recipient_name && recipient_tin == o.recipient_tin && + recipient_name == o.recipient_name && tin_type == o.tin_type && recipient_second_name == o.recipient_second_name && address == o.address && @@ -575,7 +731,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [filer_type, payment_type, payment_settlement_entity_name_phone_number, gross_amount_payment_card, card_not_present_transactions, merchant_category_code, payment_transaction_number, federal_income_tax_withheld, january, february, march, april, may, june, july, august, sept, october, november, december, issuer_reference_id, issuer_tin, tax_year, issuer_id, reference_id, recipient_name, recipient_tin, tin_type, recipient_second_name, address, address2, city, state, zip, recipient_email, account_number, office_code, recipient_non_us_province, country_code, federal_e_file, postal_mail, state_e_file, tin_match, address_verification, state_and_local_withholding].hash + [filer_type, payment_type, payment_settlement_entity_name_phone_number, gross_amount_payment_card, card_not_present_transactions, merchant_category_code, payment_transaction_number, federal_income_tax_withheld, january, february, march, april, may, june, july, august, sept, october, november, december, issuer_reference_id, issuer_tin, tax_year, issuer_id, reference_id, recipient_tin, recipient_name, tin_type, recipient_second_name, address, address2, city, state, zip, recipient_email, account_number, office_code, recipient_non_us_province, country_code, federal_e_file, postal_mail, state_e_file, tin_match, address_verification, state_and_local_withholding].hash end # Builds the object from hash diff --git a/lib/avalara_sdk/models/A1099/V2/form1099_k_list_item_response.rb b/lib/avalara_sdk/models/A1099/V2/form1099_k_list_item_response.rb new file mode 100644 index 0000000..bfb4657 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/form1099_k_list_item_response.rb @@ -0,0 +1,930 @@ +=begin +#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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class Form1099KListItemResponse + # Filer type (PSE or EPF) + attr_accessor :filer_type + + # Payment type (payment card or third party network) + attr_accessor :payment_type + + # Payment settlement entity name and phone number + attr_accessor :payment_settlement_entity_name_phone_number + + # Gross amount of payment card/third party network transactions + attr_accessor :gross_amount_payment_card + + # Card not present transactions + attr_accessor :card_not_present_transactions + + # Merchant category code + attr_accessor :merchant_category_code + + # Number of payment transactions + attr_accessor :payment_transaction_number + + # Federal income tax withheld + attr_accessor :federal_income_tax_withheld + + # January gross payments + attr_accessor :january + + # February gross payments + attr_accessor :february + + # March gross payments + attr_accessor :march + + # April gross payments + attr_accessor :april + + # May gross payments + attr_accessor :may + + # June gross payments + attr_accessor :june + + # July gross payments + attr_accessor :july + + # August gross payments + attr_accessor :august + + # September gross payments + attr_accessor :sept + + # October gross payments + attr_accessor :october + + # November gross payments + attr_accessor :november + + # December gross payments + attr_accessor :december + + # ID of the form + attr_accessor :id + + # 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 + attr_accessor :type + + # Issuer ID + attr_accessor :issuer_id + + # Issuer Reference ID + attr_accessor :issuer_reference_id + + # Issuer TIN + attr_accessor :issuer_tin + + # Tax year + attr_accessor :tax_year + + # Boolean indicating that federal e-filing has been scheduled for this form + attr_accessor :federal_efile + + # Federal e-file status + attr_accessor :federal_efile_status + + # Boolean indicating that state e-filing has been scheduled for this form + attr_accessor :state_efile + + # State e-file status + attr_accessor :state_efile_status + + # Boolean indicating that postal mailing to the recipient has been scheduled for this form + attr_accessor :postal_mail + + # Postal mail to recipient status + attr_accessor :postal_mail_status + + # Boolean indicating that TIN Matching has been scheduled for this form + attr_accessor :tin_match + + # TIN Match status + attr_accessor :tin_match_status + + # Boolean indicating that address verification has been scheduled for this form + attr_accessor :address_verification + + # Address verification status + attr_accessor :address_verification_status + + # Reference ID + attr_accessor :reference_id + + # Recipient email address + attr_accessor :email + + # Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN + attr_accessor :tin_type + + # Recipient Tax ID Number + attr_accessor :tin + + # Recipient name + attr_accessor :recipient_name + + # Recipient second name + attr_accessor :recipient_second_name + + # Address + attr_accessor :address + + # Address line 2 + attr_accessor :address2 + + # City + attr_accessor :city + + # US state + attr_accessor :state + + # Zip/postal code + attr_accessor :zip + + # Foreign province + attr_accessor :foreign_province + + # Country code, as defined at https://www.irs.gov/e-file-providers/country-codes + attr_accessor :country_code + + # Validation errors + attr_accessor :validation_errors + + # Creation time + attr_accessor :created_at + + # Update time + attr_accessor :updated_at + + attr_accessor :state_and_local_withholding + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'filer_type' => :'filerType', + :'payment_type' => :'paymentType', + :'payment_settlement_entity_name_phone_number' => :'paymentSettlementEntityNamePhoneNumber', + :'gross_amount_payment_card' => :'grossAmountPaymentCard', + :'card_not_present_transactions' => :'cardNotPresentTransactions', + :'merchant_category_code' => :'merchantCategoryCode', + :'payment_transaction_number' => :'paymentTransactionNumber', + :'federal_income_tax_withheld' => :'federalIncomeTaxWithheld', + :'january' => :'january', + :'february' => :'february', + :'march' => :'march', + :'april' => :'april', + :'may' => :'may', + :'june' => :'june', + :'july' => :'july', + :'august' => :'august', + :'sept' => :'sept', + :'october' => :'october', + :'november' => :'november', + :'december' => :'december', + :'id' => :'id', + :'type' => :'type', + :'issuer_id' => :'issuerId', + :'issuer_reference_id' => :'issuerReferenceId', + :'issuer_tin' => :'issuerTin', + :'tax_year' => :'taxYear', + :'federal_efile' => :'federalEfile', + :'federal_efile_status' => :'federalEfileStatus', + :'state_efile' => :'stateEfile', + :'state_efile_status' => :'stateEfileStatus', + :'postal_mail' => :'postalMail', + :'postal_mail_status' => :'postalMailStatus', + :'tin_match' => :'tinMatch', + :'tin_match_status' => :'tinMatchStatus', + :'address_verification' => :'addressVerification', + :'address_verification_status' => :'addressVerificationStatus', + :'reference_id' => :'referenceId', + :'email' => :'email', + :'tin_type' => :'tinType', + :'tin' => :'tin', + :'recipient_name' => :'recipientName', + :'recipient_second_name' => :'recipientSecondName', + :'address' => :'address', + :'address2' => :'address2', + :'city' => :'city', + :'state' => :'state', + :'zip' => :'zip', + :'foreign_province' => :'foreignProvince', + :'country_code' => :'countryCode', + :'validation_errors' => :'validationErrors', + :'created_at' => :'createdAt', + :'updated_at' => :'updatedAt', + :'state_and_local_withholding' => :'stateAndLocalWithholding' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'filer_type' => :'String', + :'payment_type' => :'String', + :'payment_settlement_entity_name_phone_number' => :'String', + :'gross_amount_payment_card' => :'Float', + :'card_not_present_transactions' => :'Float', + :'merchant_category_code' => :'String', + :'payment_transaction_number' => :'Float', + :'federal_income_tax_withheld' => :'Float', + :'january' => :'Float', + :'february' => :'Float', + :'march' => :'Float', + :'april' => :'Float', + :'may' => :'Float', + :'june' => :'Float', + :'july' => :'Float', + :'august' => :'Float', + :'sept' => :'Float', + :'october' => :'Float', + :'november' => :'Float', + :'december' => :'Float', + :'id' => :'String', + :'type' => :'String', + :'issuer_id' => :'Integer', + :'issuer_reference_id' => :'String', + :'issuer_tin' => :'String', + :'tax_year' => :'Integer', + :'federal_efile' => :'Boolean', + :'federal_efile_status' => :'Form1099StatusDetailResponse', + :'state_efile' => :'Boolean', + :'state_efile_status' => :'Array', + :'postal_mail' => :'Boolean', + :'postal_mail_status' => :'Form1099StatusDetailResponse', + :'tin_match' => :'Boolean', + :'tin_match_status' => :'Form1099StatusDetailResponse', + :'address_verification' => :'Boolean', + :'address_verification_status' => :'Form1099StatusDetailResponse', + :'reference_id' => :'String', + :'email' => :'String', + :'tin_type' => :'String', + :'tin' => :'String', + :'recipient_name' => :'String', + :'recipient_second_name' => :'String', + :'address' => :'String', + :'address2' => :'String', + :'city' => :'String', + :'state' => :'String', + :'zip' => :'String', + :'foreign_province' => :'String', + :'country_code' => :'String', + :'validation_errors' => :'Array', + :'created_at' => :'Time', + :'updated_at' => :'Time', + :'state_and_local_withholding' => :'StateAndLocalWithholdingResponse' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'payment_settlement_entity_name_phone_number', + :'card_not_present_transactions', + :'merchant_category_code', + :'federal_income_tax_withheld', + :'january', + :'february', + :'march', + :'april', + :'may', + :'june', + :'july', + :'august', + :'sept', + :'october', + :'november', + :'december', + :'issuer_reference_id', + :'issuer_tin', + :'state_efile_status', + :'postal_mail_status', + :'tin_match_status', + :'address_verification_status', + :'reference_id', + :'email', + :'tin_type', + :'tin', + :'recipient_name', + :'recipient_second_name', + :'address', + :'address2', + :'city', + :'state', + :'zip', + :'foreign_province', + :'country_code', + :'validation_errors', + :'state_and_local_withholding' + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'Form1099BaseResponse' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::A1099::V2::Form1099KListItemResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::A1099::V2::Form1099KListItemResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'filer_type') + self.filer_type = attributes[:'filer_type'] + end + + if attributes.key?(:'payment_type') + self.payment_type = attributes[:'payment_type'] + end + + if attributes.key?(:'payment_settlement_entity_name_phone_number') + self.payment_settlement_entity_name_phone_number = attributes[:'payment_settlement_entity_name_phone_number'] + end + + if attributes.key?(:'gross_amount_payment_card') + self.gross_amount_payment_card = attributes[:'gross_amount_payment_card'] + end + + if attributes.key?(:'card_not_present_transactions') + self.card_not_present_transactions = attributes[:'card_not_present_transactions'] + end + + if attributes.key?(:'merchant_category_code') + self.merchant_category_code = attributes[:'merchant_category_code'] + end + + if attributes.key?(:'payment_transaction_number') + self.payment_transaction_number = attributes[:'payment_transaction_number'] + end + + if attributes.key?(:'federal_income_tax_withheld') + self.federal_income_tax_withheld = attributes[:'federal_income_tax_withheld'] + end + + if attributes.key?(:'january') + self.january = attributes[:'january'] + end + + if attributes.key?(:'february') + self.february = attributes[:'february'] + end + + if attributes.key?(:'march') + self.march = attributes[:'march'] + end + + if attributes.key?(:'april') + self.april = attributes[:'april'] + end + + if attributes.key?(:'may') + self.may = attributes[:'may'] + end + + if attributes.key?(:'june') + self.june = attributes[:'june'] + end + + if attributes.key?(:'july') + self.july = attributes[:'july'] + end + + if attributes.key?(:'august') + self.august = attributes[:'august'] + end + + if attributes.key?(:'sept') + self.sept = attributes[:'sept'] + end + + if attributes.key?(:'october') + self.october = attributes[:'october'] + end + + if attributes.key?(:'november') + self.november = attributes[:'november'] + end + + if attributes.key?(:'december') + self.december = attributes[:'december'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + else + self.id = nil + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + else + self.type = nil + end + + if attributes.key?(:'issuer_id') + self.issuer_id = attributes[:'issuer_id'] + else + self.issuer_id = nil + end + + if attributes.key?(:'issuer_reference_id') + self.issuer_reference_id = attributes[:'issuer_reference_id'] + end + + if attributes.key?(:'issuer_tin') + self.issuer_tin = attributes[:'issuer_tin'] + end + + if attributes.key?(:'tax_year') + self.tax_year = attributes[:'tax_year'] + end + + if attributes.key?(:'federal_efile') + self.federal_efile = attributes[:'federal_efile'] + else + self.federal_efile = nil + end + + if attributes.key?(:'federal_efile_status') + self.federal_efile_status = attributes[:'federal_efile_status'] + end + + if attributes.key?(:'state_efile') + self.state_efile = attributes[:'state_efile'] + else + self.state_efile = nil + end + + if attributes.key?(:'state_efile_status') + if (value = attributes[:'state_efile_status']).is_a?(Array) + self.state_efile_status = value + end + end + + if attributes.key?(:'postal_mail') + self.postal_mail = attributes[:'postal_mail'] + else + self.postal_mail = nil + end + + if attributes.key?(:'postal_mail_status') + self.postal_mail_status = attributes[:'postal_mail_status'] + end + + if attributes.key?(:'tin_match') + self.tin_match = attributes[:'tin_match'] + else + self.tin_match = nil + end + + if attributes.key?(:'tin_match_status') + self.tin_match_status = attributes[:'tin_match_status'] + end + + if attributes.key?(:'address_verification') + self.address_verification = attributes[:'address_verification'] + else + self.address_verification = nil + end + + if attributes.key?(:'address_verification_status') + self.address_verification_status = attributes[:'address_verification_status'] + end + + if attributes.key?(:'reference_id') + self.reference_id = attributes[:'reference_id'] + end + + if attributes.key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.key?(:'tin_type') + self.tin_type = attributes[:'tin_type'] + end + + if attributes.key?(:'tin') + self.tin = attributes[:'tin'] + end + + if attributes.key?(:'recipient_name') + self.recipient_name = attributes[:'recipient_name'] + end + + if attributes.key?(:'recipient_second_name') + self.recipient_second_name = attributes[:'recipient_second_name'] + end + + if attributes.key?(:'address') + self.address = attributes[:'address'] + end + + if attributes.key?(:'address2') + self.address2 = attributes[:'address2'] + end + + if attributes.key?(:'city') + self.city = attributes[:'city'] + end + + if attributes.key?(:'state') + self.state = attributes[:'state'] + end + + if attributes.key?(:'zip') + self.zip = attributes[:'zip'] + end + + if attributes.key?(:'foreign_province') + self.foreign_province = attributes[:'foreign_province'] + end + + if attributes.key?(:'country_code') + self.country_code = attributes[:'country_code'] + end + + if attributes.key?(:'validation_errors') + if (value = attributes[:'validation_errors']).is_a?(Array) + self.validation_errors = value + end + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + end + + if attributes.key?(:'state_and_local_withholding') + self.state_and_local_withholding = attributes[:'state_and_local_withholding'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @id.nil? + invalid_properties.push('invalid value for "id", id cannot be nil.') + end + + if @id.to_s.length < 1 + invalid_properties.push('invalid value for "id", the character length must be great than or equal to 1.') + end + + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @type.to_s.length < 1 + invalid_properties.push('invalid value for "type", the character length must be great than or equal to 1.') + end + + if @issuer_id.nil? + invalid_properties.push('invalid value for "issuer_id", issuer_id cannot be nil.') + end + + if @federal_efile.nil? + invalid_properties.push('invalid value for "federal_efile", federal_efile cannot be nil.') + end + + if @state_efile.nil? + invalid_properties.push('invalid value for "state_efile", state_efile cannot be nil.') + end + + if @postal_mail.nil? + invalid_properties.push('invalid value for "postal_mail", postal_mail cannot be nil.') + end + + if @tin_match.nil? + invalid_properties.push('invalid value for "tin_match", tin_match cannot be nil.') + end + + if @address_verification.nil? + invalid_properties.push('invalid value for "address_verification", address_verification cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + filer_type_validator = EnumAttributeValidator.new('String', ["PSE", "EPF", "Other"]) + return false unless filer_type_validator.valid?(@filer_type) + payment_type_validator = EnumAttributeValidator.new('String', ["MerchantPaymentCard", "ThirdPartyNetwork"]) + return false unless payment_type_validator.valid?(@payment_type) + return false if @id.nil? + return false if @id.to_s.length < 1 + return false if @type.nil? + return false if @type.to_s.length < 1 + return false if @issuer_id.nil? + return false if @federal_efile.nil? + return false if @state_efile.nil? + return false if @postal_mail.nil? + return false if @tin_match.nil? + return false if @address_verification.nil? + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] filer_type Object to be assigned + def filer_type=(filer_type) + validator = EnumAttributeValidator.new('String', ["PSE", "EPF", "Other"]) + unless validator.valid?(filer_type) + fail ArgumentError, "invalid value for \"filer_type\", must be one of #{validator.allowable_values}." + end + @filer_type = filer_type + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] payment_type Object to be assigned + def payment_type=(payment_type) + validator = EnumAttributeValidator.new('String', ["MerchantPaymentCard", "ThirdPartyNetwork"]) + unless validator.valid?(payment_type) + fail ArgumentError, "invalid value for \"payment_type\", must be one of #{validator.allowable_values}." + end + @payment_type = payment_type + end + + # Custom attribute writer method with validation + # @param [Object] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + if id.to_s.length < 1 + fail ArgumentError, 'invalid value for "id", the character length must be great than or equal to 1.' + end + + @id = id + end + + # Custom attribute writer method with validation + # @param [Object] type Value to be assigned + def type=(type) + if type.nil? + fail ArgumentError, 'type cannot be nil' + end + + if type.to_s.length < 1 + fail ArgumentError, 'invalid value for "type", the character length must be great than or equal to 1.' + end + + @type = type + end + + # Custom attribute writer method with validation + # @param [Object] state_efile_status Value to be assigned + def state_efile_status=(state_efile_status) + @state_efile_status = state_efile_status + end + + # Custom attribute writer method with validation + # @param [Object] validation_errors Value to be assigned + def validation_errors=(validation_errors) + @validation_errors = validation_errors + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + filer_type == o.filer_type && + payment_type == o.payment_type && + payment_settlement_entity_name_phone_number == o.payment_settlement_entity_name_phone_number && + gross_amount_payment_card == o.gross_amount_payment_card && + card_not_present_transactions == o.card_not_present_transactions && + merchant_category_code == o.merchant_category_code && + payment_transaction_number == o.payment_transaction_number && + federal_income_tax_withheld == o.federal_income_tax_withheld && + january == o.january && + february == o.february && + march == o.march && + april == o.april && + may == o.may && + june == o.june && + july == o.july && + august == o.august && + sept == o.sept && + october == o.october && + november == o.november && + december == o.december && + id == o.id && + type == o.type && + issuer_id == o.issuer_id && + issuer_reference_id == o.issuer_reference_id && + issuer_tin == o.issuer_tin && + tax_year == o.tax_year && + federal_efile == o.federal_efile && + federal_efile_status == o.federal_efile_status && + state_efile == o.state_efile && + state_efile_status == o.state_efile_status && + postal_mail == o.postal_mail && + postal_mail_status == o.postal_mail_status && + tin_match == o.tin_match && + tin_match_status == o.tin_match_status && + address_verification == o.address_verification && + address_verification_status == o.address_verification_status && + reference_id == o.reference_id && + email == o.email && + tin_type == o.tin_type && + tin == o.tin && + recipient_name == o.recipient_name && + recipient_second_name == o.recipient_second_name && + address == o.address && + address2 == o.address2 && + city == o.city && + state == o.state && + zip == o.zip && + foreign_province == o.foreign_province && + country_code == o.country_code && + validation_errors == o.validation_errors && + created_at == o.created_at && + updated_at == o.updated_at && + state_and_local_withholding == o.state_and_local_withholding + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [filer_type, payment_type, payment_settlement_entity_name_phone_number, gross_amount_payment_card, card_not_present_transactions, merchant_category_code, payment_transaction_number, federal_income_tax_withheld, january, february, march, april, may, june, july, august, sept, october, november, december, id, type, issuer_id, issuer_reference_id, issuer_tin, tax_year, federal_efile, federal_efile_status, state_efile, state_efile_status, postal_mail, postal_mail_status, tin_match, tin_match_status, address_verification, address_verification_status, reference_id, email, tin_type, tin, recipient_name, recipient_second_name, address, address2, city, state, zip, foreign_province, country_code, validation_errors, created_at, updated_at, state_and_local_withholding].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::A1099::V2.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/A1099/V2/form1099_k_request.rb b/lib/avalara_sdk/models/A1099/V2/form1099_k_request.rb index 3cf7b7f..c3adb46 100644 --- a/lib/avalara_sdk/models/A1099/V2/form1099_k_request.rb +++ b/lib/avalara_sdk/models/A1099/V2/form1099_k_request.rb @@ -1,7 +1,7 @@ =begin #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) =end @@ -11,90 +11,132 @@ module AvalaraSdk::A1099::V2 class Form1099KRequest + # Filer type (PSE or EPF) attr_accessor :filer_type + # Payment type (payment card or third party network) attr_accessor :payment_type + # Payment settlement entity name and phone number attr_accessor :payment_settlement_entity_name_phone_number + # Gross amount of payment card/third party network transactions attr_accessor :gross_amount_payment_card + # Card not present transactions attr_accessor :card_not_present_transactions + # Merchant category code attr_accessor :merchant_category_code + # Number of payment transactions attr_accessor :payment_transaction_number + # Federal income tax withheld attr_accessor :federal_income_tax_withheld + # January gross payments attr_accessor :january + # February gross payments attr_accessor :february + # March gross payments attr_accessor :march + # April gross payments attr_accessor :april + # May gross payments attr_accessor :may + # June gross payments attr_accessor :june + # July gross payments attr_accessor :july + # August gross payments attr_accessor :august + # September gross payments attr_accessor :sept + # October gross payments attr_accessor :october + # November gross payments attr_accessor :november + # December gross payments attr_accessor :december attr_accessor :type + # Issuer ID attr_accessor :issuer_id + # Reference ID attr_accessor :reference_id - attr_accessor :recipient_name - + # Recipient Tax ID Number attr_accessor :recipient_tin + # Recipient name + attr_accessor :recipient_name + + # Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN attr_accessor :tin_type + # Recipient second name attr_accessor :recipient_second_name + # Address attr_accessor :address + # Address line 2 attr_accessor :address2 + # City attr_accessor :city + # US state. Required if CountryCode is \"US\". attr_accessor :state + # Zip/postal code attr_accessor :zip + # Recipient email address attr_accessor :recipient_email + # Account number attr_accessor :account_number + # Office code attr_accessor :office_code + # Foreign province attr_accessor :recipient_non_us_province + # Country code, as defined at https://www.irs.gov/e-file-providers/country-codes attr_accessor :country_code + # Boolean indicating that federal e-filing should be scheduled for this form attr_accessor :federal_e_file + # Boolean indicating that postal mailing to the recipient should be scheduled for this form attr_accessor :postal_mail + # Boolean indicating that state e-filing should be scheduled for this form attr_accessor :state_e_file + # Boolean indicating that TIN Matching should be scheduled for this form attr_accessor :tin_match + # Boolean indicating that address verification should be scheduled for this form attr_accessor :address_verification + # State and local withholding information attr_accessor :state_and_local_withholding class EnumAttributeValidator @@ -145,8 +187,8 @@ def self.attribute_map :'type' => :'type', :'issuer_id' => :'issuerId', :'reference_id' => :'referenceId', - :'recipient_name' => :'recipientName', :'recipient_tin' => :'recipientTin', + :'recipient_name' => :'recipientName', :'tin_type' => :'tinType', :'recipient_second_name' => :'recipientSecondName', :'address' => :'address', @@ -199,8 +241,8 @@ def self.openapi_types :'type' => :'String', :'issuer_id' => :'String', :'reference_id' => :'String', - :'recipient_name' => :'String', :'recipient_tin' => :'String', + :'recipient_name' => :'String', :'tin_type' => :'String', :'recipient_second_name' => :'String', :'address' => :'String', @@ -243,7 +285,7 @@ def self.openapi_nullable :'december', :'issuer_id', :'reference_id', - :'recipient_name', + :'recipient_second_name', :'address2', :'recipient_email', :'account_number', @@ -366,14 +408,16 @@ def initialize(attributes = {}) self.reference_id = attributes[:'reference_id'] end - if attributes.key?(:'recipient_name') - self.recipient_name = attributes[:'recipient_name'] - end - if attributes.key?(:'recipient_tin') self.recipient_tin = attributes[:'recipient_tin'] end + if attributes.key?(:'recipient_name') + self.recipient_name = attributes[:'recipient_name'] + else + self.recipient_name = nil + end + if attributes.key?(:'tin_type') self.tin_type = attributes[:'tin_type'] end @@ -384,6 +428,8 @@ def initialize(attributes = {}) if attributes.key?(:'address') self.address = attributes[:'address'] + else + self.address = nil end if attributes.key?(:'address2') @@ -392,6 +438,8 @@ def initialize(attributes = {}) if attributes.key?(:'city') self.city = attributes[:'city'] + else + self.city = nil end if attributes.key?(:'state') @@ -420,6 +468,8 @@ def initialize(attributes = {}) if attributes.key?(:'country_code') self.country_code = attributes[:'country_code'] + else + self.country_code = nil end if attributes.key?(:'federal_e_file') @@ -452,6 +502,38 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @recipient_name.nil? + invalid_properties.push('invalid value for "recipient_name", recipient_name cannot be nil.') + end + + if @recipient_name.to_s.length < 1 + invalid_properties.push('invalid value for "recipient_name", the character length must be great than or equal to 1.') + end + + if @address.nil? + invalid_properties.push('invalid value for "address", address cannot be nil.') + end + + if @address.to_s.length < 1 + invalid_properties.push('invalid value for "address", the character length must be great than or equal to 1.') + end + + if @city.nil? + invalid_properties.push('invalid value for "city", city cannot be nil.') + end + + if @city.to_s.length < 1 + invalid_properties.push('invalid value for "city", the character length must be great than or equal to 1.') + end + + if @country_code.nil? + invalid_properties.push('invalid value for "country_code", country_code cannot be nil.') + end + + if @country_code.to_s.length < 1 + invalid_properties.push('invalid value for "country_code", the character length must be great than or equal to 1.') + end + invalid_properties end @@ -459,23 +541,45 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - type_validator = EnumAttributeValidator.new('String', ["Form1099Nec", "Form1099Misc", "Form1099Div", "Form1099R", "Form1099K", "Form1095B"]) + type_validator = EnumAttributeValidator.new('String', ["1099-NEC", "1099-MISC", "1099-DIV", "1099-R", "1099-K", "1095-B", "1042-S"]) return false unless type_validator.valid?(@type) + return false if @recipient_name.nil? + return false if @recipient_name.to_s.length < 1 tin_type_validator = EnumAttributeValidator.new('String', ["EIN", "SSN", "ITIN", "ATIN"]) return false unless tin_type_validator.valid?(@tin_type) + return false if @address.nil? + return false if @address.to_s.length < 1 + return false if @city.nil? + return false if @city.to_s.length < 1 + return false if @country_code.nil? + return false if @country_code.to_s.length < 1 true end # Custom attribute writer method checking allowed values (enum). # @param [Object] type Object to be assigned def type=(type) - validator = EnumAttributeValidator.new('String', ["Form1099Nec", "Form1099Misc", "Form1099Div", "Form1099R", "Form1099K", "Form1095B"]) + validator = EnumAttributeValidator.new('String', ["1099-NEC", "1099-MISC", "1099-DIV", "1099-R", "1099-K", "1095-B", "1042-S"]) unless validator.valid?(type) fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." end @type = type end + # Custom attribute writer method with validation + # @param [Object] recipient_name Value to be assigned + def recipient_name=(recipient_name) + if recipient_name.nil? + fail ArgumentError, 'recipient_name cannot be nil' + end + + if recipient_name.to_s.length < 1 + fail ArgumentError, 'invalid value for "recipient_name", the character length must be great than or equal to 1.' + end + + @recipient_name = recipient_name + end + # Custom attribute writer method checking allowed values (enum). # @param [Object] tin_type Object to be assigned def tin_type=(tin_type) @@ -486,6 +590,48 @@ def tin_type=(tin_type) @tin_type = tin_type end + # Custom attribute writer method with validation + # @param [Object] address Value to be assigned + def address=(address) + if address.nil? + fail ArgumentError, 'address cannot be nil' + end + + if address.to_s.length < 1 + fail ArgumentError, 'invalid value for "address", the character length must be great than or equal to 1.' + end + + @address = address + end + + # Custom attribute writer method with validation + # @param [Object] city Value to be assigned + def city=(city) + if city.nil? + fail ArgumentError, 'city cannot be nil' + end + + if city.to_s.length < 1 + fail ArgumentError, 'invalid value for "city", the character length must be great than or equal to 1.' + end + + @city = city + end + + # Custom attribute writer method with validation + # @param [Object] country_code Value to be assigned + def country_code=(country_code) + if country_code.nil? + fail ArgumentError, 'country_code cannot be nil' + end + + if country_code.to_s.length < 1 + fail ArgumentError, 'invalid value for "country_code", the character length must be great than or equal to 1.' + end + + @country_code = country_code + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -514,8 +660,8 @@ def ==(o) type == o.type && issuer_id == o.issuer_id && reference_id == o.reference_id && - recipient_name == o.recipient_name && recipient_tin == o.recipient_tin && + recipient_name == o.recipient_name && tin_type == o.tin_type && recipient_second_name == o.recipient_second_name && address == o.address && @@ -545,7 +691,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [filer_type, payment_type, payment_settlement_entity_name_phone_number, gross_amount_payment_card, card_not_present_transactions, merchant_category_code, payment_transaction_number, federal_income_tax_withheld, january, february, march, april, may, june, july, august, sept, october, november, december, type, issuer_id, reference_id, recipient_name, recipient_tin, tin_type, recipient_second_name, address, address2, city, state, zip, recipient_email, account_number, office_code, recipient_non_us_province, country_code, federal_e_file, postal_mail, state_e_file, tin_match, address_verification, state_and_local_withholding].hash + [filer_type, payment_type, payment_settlement_entity_name_phone_number, gross_amount_payment_card, card_not_present_transactions, merchant_category_code, payment_transaction_number, federal_income_tax_withheld, january, february, march, april, may, june, july, august, sept, october, november, december, type, issuer_id, reference_id, recipient_tin, recipient_name, tin_type, recipient_second_name, address, address2, city, state, zip, recipient_email, account_number, office_code, recipient_non_us_province, country_code, federal_e_file, postal_mail, state_e_file, tin_match, address_verification, state_and_local_withholding].hash end # Builds the object from hash diff --git a/lib/avalara_sdk/models/A1099/V2/form1099_list_response.rb b/lib/avalara_sdk/models/A1099/V2/form1099_list_response.rb new file mode 100644 index 0000000..25cb057 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/form1099_list_response.rb @@ -0,0 +1,220 @@ +=begin +#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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class Form1099ListResponse + # List of Form 1099 responses + attr_accessor :value + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'value' => :'value' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'value' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'value' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::A1099::V2::Form1099ListResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::A1099::V2::Form1099ListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'value') + if (value = attributes[:'value']).is_a?(Array) + self.value = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Custom attribute writer method with validation + # @param [Object] value Value to be assigned + def value=(value) + @value = value + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + value == o.value + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [value].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::A1099::V2.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/A1099/V2/form1099_list_response_value_inner.rb b/lib/avalara_sdk/models/A1099/V2/form1099_list_response_value_inner.rb new file mode 100644 index 0000000..70a1078 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/form1099_list_response_value_inner.rb @@ -0,0 +1,106 @@ +=begin +#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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + module Form1099ListResponseValueInner + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Form1042SListItemResponse', + :'Form1095BListItemResponse', + :'Form1099BaseResponse', + :'Form1099KListItemResponse', + :'Form1099MiscListItemResponse', + :'Form1099NecListItemResponse', + :'Form1099RListItemResponse' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass, data) + return if data.nil? + + case klass.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type, item) } + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) } + end + else # model + const = AvalaraSdk::A1099::V2.const_get(klass) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model + end + end + end + + raise # if no match by now, raise + rescue + raise SchemaMismatchError, "#{data} doesn't match the #{klass} type" + end + end + end + +end diff --git a/lib/avalara_sdk/models/A1099/V2/form1099_misc_list.rb b/lib/avalara_sdk/models/A1099/V2/form1099_misc_list.rb index b56b700..be00718 100644 --- a/lib/avalara_sdk/models/A1099/V2/form1099_misc_list.rb +++ b/lib/avalara_sdk/models/A1099/V2/form1099_misc_list.rb @@ -1,7 +1,7 @@ =begin #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) =end diff --git a/lib/avalara_sdk/models/A1099/V2/form1099_misc_list_item.rb b/lib/avalara_sdk/models/A1099/V2/form1099_misc_list_item.rb index 491365b..4d18871 100644 --- a/lib/avalara_sdk/models/A1099/V2/form1099_misc_list_item.rb +++ b/lib/avalara_sdk/models/A1099/V2/form1099_misc_list_item.rb @@ -1,7 +1,7 @@ =begin #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) =end @@ -11,86 +11,127 @@ module AvalaraSdk::A1099::V2 class Form1099MiscListItem + # Second TIN notice attr_accessor :second_tin_notice + # Rents attr_accessor :rents + # Royalties attr_accessor :royalties + # Other income attr_accessor :other_income + # Federal income tax withheld attr_accessor :fed_income_tax_withheld + # Fishing boat proceeds attr_accessor :fishing_boat_proceeds + # Medical and health care payments attr_accessor :medical_health_care_payments - attr_accessor :payer_made_direct_sales + # Payer made direct sales totaling $5,000 or more of consumer products to recipient for resale + attr_accessor :direct_sales_indicator + # Substitute payments in lieu of dividends or interest attr_accessor :substitute_payments + # Crop insurance proceeds attr_accessor :crop_insurance_proceeds + # Gross proceeds paid to an attorney attr_accessor :gross_proceeds_paid_to_attorney + # Fish purchased for resale attr_accessor :fish_purchased_for_resale + # Section 409A deferrals attr_accessor :section409_a_deferrals + # FATCA filing requirement attr_accessor :fatca_filing_requirement + # (Legacy field) Excess golden parachute payments attr_accessor :excess_golden_parachute_payments + # Nonqualified deferred compensation attr_accessor :nonqualified_deferred_compensation + # Issuer Reference ID. One of `issuerReferenceId` or `issuerTin` is required. attr_accessor :issuer_reference_id + # Issuer TIN. One of `issuerReferenceId` or `issuerTin` is required. attr_accessor :issuer_tin + # Tax year attr_accessor :tax_year + # Issuer ID attr_accessor :issuer_id + # Reference ID attr_accessor :reference_id - attr_accessor :recipient_name - + # Recipient Tax ID Number attr_accessor :recipient_tin + # Recipient name + attr_accessor :recipient_name + + # Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN attr_accessor :tin_type + # Recipient second name attr_accessor :recipient_second_name + # Address attr_accessor :address + # Address line 2 attr_accessor :address2 + # City attr_accessor :city + # US state. Required if CountryCode is \"US\". attr_accessor :state + # Zip/postal code attr_accessor :zip + # Recipient email address attr_accessor :recipient_email + # Account number attr_accessor :account_number + # Office code attr_accessor :office_code + # Foreign province attr_accessor :recipient_non_us_province + # Country code, as defined at https://www.irs.gov/e-file-providers/country-codes attr_accessor :country_code + # Boolean indicating that federal e-filing should be scheduled for this form attr_accessor :federal_e_file + # Boolean indicating that postal mailing to the recipient should be scheduled for this form attr_accessor :postal_mail + # Boolean indicating that state e-filing should be scheduled for this form attr_accessor :state_e_file + # Boolean indicating that TIN Matching should be scheduled for this form attr_accessor :tin_match + # Boolean indicating that address verification should be scheduled for this form attr_accessor :address_verification + # State and local withholding information attr_accessor :state_and_local_withholding class EnumAttributeValidator @@ -125,7 +166,7 @@ def self.attribute_map :'fed_income_tax_withheld' => :'fedIncomeTaxWithheld', :'fishing_boat_proceeds' => :'fishingBoatProceeds', :'medical_health_care_payments' => :'medicalHealthCarePayments', - :'payer_made_direct_sales' => :'payerMadeDirectSales', + :'direct_sales_indicator' => :'directSalesIndicator', :'substitute_payments' => :'substitutePayments', :'crop_insurance_proceeds' => :'cropInsuranceProceeds', :'gross_proceeds_paid_to_attorney' => :'grossProceedsPaidToAttorney', @@ -139,8 +180,8 @@ def self.attribute_map :'tax_year' => :'taxYear', :'issuer_id' => :'issuerId', :'reference_id' => :'referenceId', - :'recipient_name' => :'recipientName', :'recipient_tin' => :'recipientTin', + :'recipient_name' => :'recipientName', :'tin_type' => :'tinType', :'recipient_second_name' => :'recipientSecondName', :'address' => :'address', @@ -177,7 +218,7 @@ def self.openapi_types :'fed_income_tax_withheld' => :'Float', :'fishing_boat_proceeds' => :'Float', :'medical_health_care_payments' => :'Float', - :'payer_made_direct_sales' => :'Boolean', + :'direct_sales_indicator' => :'Boolean', :'substitute_payments' => :'Float', :'crop_insurance_proceeds' => :'Float', :'gross_proceeds_paid_to_attorney' => :'Float', @@ -191,8 +232,8 @@ def self.openapi_types :'tax_year' => :'Integer', :'issuer_id' => :'String', :'reference_id' => :'String', - :'recipient_name' => :'String', :'recipient_tin' => :'String', + :'recipient_name' => :'String', :'tin_type' => :'String', :'recipient_second_name' => :'String', :'address' => :'String', @@ -219,7 +260,7 @@ def self.openapi_nullable Set.new([ :'issuer_id', :'reference_id', - :'recipient_name', + :'recipient_second_name', :'address2', :'recipient_email', :'account_number', @@ -231,7 +272,7 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'FormRequestCsvBase' + :'FormRequestListItemBase' ] end @@ -278,8 +319,8 @@ def initialize(attributes = {}) self.medical_health_care_payments = attributes[:'medical_health_care_payments'] end - if attributes.key?(:'payer_made_direct_sales') - self.payer_made_direct_sales = attributes[:'payer_made_direct_sales'] + if attributes.key?(:'direct_sales_indicator') + self.direct_sales_indicator = attributes[:'direct_sales_indicator'] end if attributes.key?(:'substitute_payments') @@ -324,6 +365,8 @@ def initialize(attributes = {}) if attributes.key?(:'tax_year') self.tax_year = attributes[:'tax_year'] + else + self.tax_year = nil end if attributes.key?(:'issuer_id') @@ -334,14 +377,16 @@ def initialize(attributes = {}) self.reference_id = attributes[:'reference_id'] end - if attributes.key?(:'recipient_name') - self.recipient_name = attributes[:'recipient_name'] - end - if attributes.key?(:'recipient_tin') self.recipient_tin = attributes[:'recipient_tin'] end + if attributes.key?(:'recipient_name') + self.recipient_name = attributes[:'recipient_name'] + else + self.recipient_name = nil + end + if attributes.key?(:'tin_type') self.tin_type = attributes[:'tin_type'] end @@ -352,6 +397,8 @@ def initialize(attributes = {}) if attributes.key?(:'address') self.address = attributes[:'address'] + else + self.address = nil end if attributes.key?(:'address2') @@ -360,6 +407,8 @@ def initialize(attributes = {}) if attributes.key?(:'city') self.city = attributes[:'city'] + else + self.city = nil end if attributes.key?(:'state') @@ -388,6 +437,8 @@ def initialize(attributes = {}) if attributes.key?(:'country_code') self.country_code = attributes[:'country_code'] + else + self.country_code = nil end if attributes.key?(:'federal_e_file') @@ -420,6 +471,42 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @tax_year.nil? + invalid_properties.push('invalid value for "tax_year", tax_year cannot be nil.') + end + + if @recipient_name.nil? + invalid_properties.push('invalid value for "recipient_name", recipient_name cannot be nil.') + end + + if @recipient_name.to_s.length < 1 + invalid_properties.push('invalid value for "recipient_name", the character length must be great than or equal to 1.') + end + + if @address.nil? + invalid_properties.push('invalid value for "address", address cannot be nil.') + end + + if @address.to_s.length < 1 + invalid_properties.push('invalid value for "address", the character length must be great than or equal to 1.') + end + + if @city.nil? + invalid_properties.push('invalid value for "city", city cannot be nil.') + end + + if @city.to_s.length < 1 + invalid_properties.push('invalid value for "city", the character length must be great than or equal to 1.') + end + + if @country_code.nil? + invalid_properties.push('invalid value for "country_code", country_code cannot be nil.') + end + + if @country_code.to_s.length < 1 + invalid_properties.push('invalid value for "country_code", the character length must be great than or equal to 1.') + end + invalid_properties end @@ -427,11 +514,34 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @tax_year.nil? + return false if @recipient_name.nil? + return false if @recipient_name.to_s.length < 1 tin_type_validator = EnumAttributeValidator.new('String', ["EIN", "SSN", "ITIN", "ATIN"]) return false unless tin_type_validator.valid?(@tin_type) + return false if @address.nil? + return false if @address.to_s.length < 1 + return false if @city.nil? + return false if @city.to_s.length < 1 + return false if @country_code.nil? + return false if @country_code.to_s.length < 1 true end + # Custom attribute writer method with validation + # @param [Object] recipient_name Value to be assigned + def recipient_name=(recipient_name) + if recipient_name.nil? + fail ArgumentError, 'recipient_name cannot be nil' + end + + if recipient_name.to_s.length < 1 + fail ArgumentError, 'invalid value for "recipient_name", the character length must be great than or equal to 1.' + end + + @recipient_name = recipient_name + end + # Custom attribute writer method checking allowed values (enum). # @param [Object] tin_type Object to be assigned def tin_type=(tin_type) @@ -442,6 +552,48 @@ def tin_type=(tin_type) @tin_type = tin_type end + # Custom attribute writer method with validation + # @param [Object] address Value to be assigned + def address=(address) + if address.nil? + fail ArgumentError, 'address cannot be nil' + end + + if address.to_s.length < 1 + fail ArgumentError, 'invalid value for "address", the character length must be great than or equal to 1.' + end + + @address = address + end + + # Custom attribute writer method with validation + # @param [Object] city Value to be assigned + def city=(city) + if city.nil? + fail ArgumentError, 'city cannot be nil' + end + + if city.to_s.length < 1 + fail ArgumentError, 'invalid value for "city", the character length must be great than or equal to 1.' + end + + @city = city + end + + # Custom attribute writer method with validation + # @param [Object] country_code Value to be assigned + def country_code=(country_code) + if country_code.nil? + fail ArgumentError, 'country_code cannot be nil' + end + + if country_code.to_s.length < 1 + fail ArgumentError, 'invalid value for "country_code", the character length must be great than or equal to 1.' + end + + @country_code = country_code + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -454,7 +606,7 @@ def ==(o) fed_income_tax_withheld == o.fed_income_tax_withheld && fishing_boat_proceeds == o.fishing_boat_proceeds && medical_health_care_payments == o.medical_health_care_payments && - payer_made_direct_sales == o.payer_made_direct_sales && + direct_sales_indicator == o.direct_sales_indicator && substitute_payments == o.substitute_payments && crop_insurance_proceeds == o.crop_insurance_proceeds && gross_proceeds_paid_to_attorney == o.gross_proceeds_paid_to_attorney && @@ -468,8 +620,8 @@ def ==(o) tax_year == o.tax_year && issuer_id == o.issuer_id && reference_id == o.reference_id && - recipient_name == o.recipient_name && recipient_tin == o.recipient_tin && + recipient_name == o.recipient_name && tin_type == o.tin_type && recipient_second_name == o.recipient_second_name && address == o.address && @@ -499,7 +651,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [second_tin_notice, rents, royalties, other_income, fed_income_tax_withheld, fishing_boat_proceeds, medical_health_care_payments, payer_made_direct_sales, substitute_payments, crop_insurance_proceeds, gross_proceeds_paid_to_attorney, fish_purchased_for_resale, section409_a_deferrals, fatca_filing_requirement, excess_golden_parachute_payments, nonqualified_deferred_compensation, issuer_reference_id, issuer_tin, tax_year, issuer_id, reference_id, recipient_name, recipient_tin, tin_type, recipient_second_name, address, address2, city, state, zip, recipient_email, account_number, office_code, recipient_non_us_province, country_code, federal_e_file, postal_mail, state_e_file, tin_match, address_verification, state_and_local_withholding].hash + [second_tin_notice, rents, royalties, other_income, fed_income_tax_withheld, fishing_boat_proceeds, medical_health_care_payments, direct_sales_indicator, substitute_payments, crop_insurance_proceeds, gross_proceeds_paid_to_attorney, fish_purchased_for_resale, section409_a_deferrals, fatca_filing_requirement, excess_golden_parachute_payments, nonqualified_deferred_compensation, issuer_reference_id, issuer_tin, tax_year, issuer_id, reference_id, recipient_tin, recipient_name, tin_type, recipient_second_name, address, address2, city, state, zip, recipient_email, account_number, office_code, recipient_non_us_province, country_code, federal_e_file, postal_mail, state_e_file, tin_match, address_verification, state_and_local_withholding].hash end # Builds the object from hash diff --git a/lib/avalara_sdk/models/A1099/V2/form1099_misc_list_item_response.rb b/lib/avalara_sdk/models/A1099/V2/form1099_misc_list_item_response.rb new file mode 100644 index 0000000..61d5351 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/form1099_misc_list_item_response.rb @@ -0,0 +1,810 @@ +=begin +#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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class Form1099MiscListItemResponse + # Rents + attr_accessor :rents + + # Royalties + attr_accessor :royalties + + # Other income + attr_accessor :other_income + + # Federal income tax withheld + attr_accessor :fed_income_tax_withheld + + # Fishing boat proceeds + attr_accessor :fishing_boat_proceeds + + # Medical and health care payments + attr_accessor :medical_and_health_care + + # Substitute payments in lieu of dividends or interest + attr_accessor :substitute_payments + + # Payer made direct sales totaling $5,000 or more of consumer products to recipient for resale + attr_accessor :direct_sales_indicator + + # Crop insurance proceeds + attr_accessor :crop_insurance_proceeds + + # (Legacy field) Excess golden parachute payments + attr_accessor :excess_golden_parachute + + # Gross proceeds paid to an attorney + attr_accessor :gross_amount_paid_attorney + + # Section 409A deferrals + attr_accessor :section409_a_deferrals + + # Nonqualified deferred compensation + attr_accessor :section409_a_income + + # ID of the form + attr_accessor :id + + # 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 + attr_accessor :type + + # Issuer ID + attr_accessor :issuer_id + + # Issuer Reference ID + attr_accessor :issuer_reference_id + + # Issuer TIN + attr_accessor :issuer_tin + + # Tax year + attr_accessor :tax_year + + # Boolean indicating that federal e-filing has been scheduled for this form + attr_accessor :federal_efile + + # Federal e-file status + attr_accessor :federal_efile_status + + # Boolean indicating that state e-filing has been scheduled for this form + attr_accessor :state_efile + + # State e-file status + attr_accessor :state_efile_status + + # Boolean indicating that postal mailing to the recipient has been scheduled for this form + attr_accessor :postal_mail + + # Postal mail to recipient status + attr_accessor :postal_mail_status + + # Boolean indicating that TIN Matching has been scheduled for this form + attr_accessor :tin_match + + # TIN Match status + attr_accessor :tin_match_status + + # Boolean indicating that address verification has been scheduled for this form + attr_accessor :address_verification + + # Address verification status + attr_accessor :address_verification_status + + # Reference ID + attr_accessor :reference_id + + # Recipient email address + attr_accessor :email + + # Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN + attr_accessor :tin_type + + # Recipient Tax ID Number + attr_accessor :tin + + # Recipient name + attr_accessor :recipient_name + + # Recipient second name + attr_accessor :recipient_second_name + + # Address + attr_accessor :address + + # Address line 2 + attr_accessor :address2 + + # City + attr_accessor :city + + # US state + attr_accessor :state + + # Zip/postal code + attr_accessor :zip + + # Foreign province + attr_accessor :foreign_province + + # Country code, as defined at https://www.irs.gov/e-file-providers/country-codes + attr_accessor :country_code + + # Validation errors + attr_accessor :validation_errors + + # Creation time + attr_accessor :created_at + + # Update time + attr_accessor :updated_at + + attr_accessor :state_and_local_withholding + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'rents' => :'rents', + :'royalties' => :'royalties', + :'other_income' => :'otherIncome', + :'fed_income_tax_withheld' => :'fedIncomeTaxWithheld', + :'fishing_boat_proceeds' => :'fishingBoatProceeds', + :'medical_and_health_care' => :'medicalAndHealthCare', + :'substitute_payments' => :'substitutePayments', + :'direct_sales_indicator' => :'directSalesIndicator', + :'crop_insurance_proceeds' => :'cropInsuranceProceeds', + :'excess_golden_parachute' => :'excessGoldenParachute', + :'gross_amount_paid_attorney' => :'grossAmountPaidAttorney', + :'section409_a_deferrals' => :'section409ADeferrals', + :'section409_a_income' => :'section409AIncome', + :'id' => :'id', + :'type' => :'type', + :'issuer_id' => :'issuerId', + :'issuer_reference_id' => :'issuerReferenceId', + :'issuer_tin' => :'issuerTin', + :'tax_year' => :'taxYear', + :'federal_efile' => :'federalEfile', + :'federal_efile_status' => :'federalEfileStatus', + :'state_efile' => :'stateEfile', + :'state_efile_status' => :'stateEfileStatus', + :'postal_mail' => :'postalMail', + :'postal_mail_status' => :'postalMailStatus', + :'tin_match' => :'tinMatch', + :'tin_match_status' => :'tinMatchStatus', + :'address_verification' => :'addressVerification', + :'address_verification_status' => :'addressVerificationStatus', + :'reference_id' => :'referenceId', + :'email' => :'email', + :'tin_type' => :'tinType', + :'tin' => :'tin', + :'recipient_name' => :'recipientName', + :'recipient_second_name' => :'recipientSecondName', + :'address' => :'address', + :'address2' => :'address2', + :'city' => :'city', + :'state' => :'state', + :'zip' => :'zip', + :'foreign_province' => :'foreignProvince', + :'country_code' => :'countryCode', + :'validation_errors' => :'validationErrors', + :'created_at' => :'createdAt', + :'updated_at' => :'updatedAt', + :'state_and_local_withholding' => :'stateAndLocalWithholding' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'rents' => :'Float', + :'royalties' => :'Float', + :'other_income' => :'Float', + :'fed_income_tax_withheld' => :'Float', + :'fishing_boat_proceeds' => :'Float', + :'medical_and_health_care' => :'Float', + :'substitute_payments' => :'Float', + :'direct_sales_indicator' => :'Boolean', + :'crop_insurance_proceeds' => :'Float', + :'excess_golden_parachute' => :'Float', + :'gross_amount_paid_attorney' => :'Float', + :'section409_a_deferrals' => :'Float', + :'section409_a_income' => :'Float', + :'id' => :'String', + :'type' => :'String', + :'issuer_id' => :'Integer', + :'issuer_reference_id' => :'String', + :'issuer_tin' => :'String', + :'tax_year' => :'Integer', + :'federal_efile' => :'Boolean', + :'federal_efile_status' => :'Form1099StatusDetailResponse', + :'state_efile' => :'Boolean', + :'state_efile_status' => :'Array', + :'postal_mail' => :'Boolean', + :'postal_mail_status' => :'Form1099StatusDetailResponse', + :'tin_match' => :'Boolean', + :'tin_match_status' => :'Form1099StatusDetailResponse', + :'address_verification' => :'Boolean', + :'address_verification_status' => :'Form1099StatusDetailResponse', + :'reference_id' => :'String', + :'email' => :'String', + :'tin_type' => :'String', + :'tin' => :'String', + :'recipient_name' => :'String', + :'recipient_second_name' => :'String', + :'address' => :'String', + :'address2' => :'String', + :'city' => :'String', + :'state' => :'String', + :'zip' => :'String', + :'foreign_province' => :'String', + :'country_code' => :'String', + :'validation_errors' => :'Array', + :'created_at' => :'Time', + :'updated_at' => :'Time', + :'state_and_local_withholding' => :'StateAndLocalWithholdingResponse' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'rents', + :'royalties', + :'other_income', + :'fed_income_tax_withheld', + :'fishing_boat_proceeds', + :'medical_and_health_care', + :'substitute_payments', + :'crop_insurance_proceeds', + :'excess_golden_parachute', + :'gross_amount_paid_attorney', + :'section409_a_deferrals', + :'section409_a_income', + :'issuer_reference_id', + :'issuer_tin', + :'state_efile_status', + :'postal_mail_status', + :'tin_match_status', + :'address_verification_status', + :'reference_id', + :'email', + :'tin_type', + :'tin', + :'recipient_name', + :'recipient_second_name', + :'address', + :'address2', + :'city', + :'state', + :'zip', + :'foreign_province', + :'country_code', + :'validation_errors', + :'state_and_local_withholding' + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'Form1099BaseResponse' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::A1099::V2::Form1099MiscListItemResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::A1099::V2::Form1099MiscListItemResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'rents') + self.rents = attributes[:'rents'] + end + + if attributes.key?(:'royalties') + self.royalties = attributes[:'royalties'] + end + + if attributes.key?(:'other_income') + self.other_income = attributes[:'other_income'] + end + + if attributes.key?(:'fed_income_tax_withheld') + self.fed_income_tax_withheld = attributes[:'fed_income_tax_withheld'] + end + + if attributes.key?(:'fishing_boat_proceeds') + self.fishing_boat_proceeds = attributes[:'fishing_boat_proceeds'] + end + + if attributes.key?(:'medical_and_health_care') + self.medical_and_health_care = attributes[:'medical_and_health_care'] + end + + if attributes.key?(:'substitute_payments') + self.substitute_payments = attributes[:'substitute_payments'] + end + + if attributes.key?(:'direct_sales_indicator') + self.direct_sales_indicator = attributes[:'direct_sales_indicator'] + end + + if attributes.key?(:'crop_insurance_proceeds') + self.crop_insurance_proceeds = attributes[:'crop_insurance_proceeds'] + end + + if attributes.key?(:'excess_golden_parachute') + self.excess_golden_parachute = attributes[:'excess_golden_parachute'] + end + + if attributes.key?(:'gross_amount_paid_attorney') + self.gross_amount_paid_attorney = attributes[:'gross_amount_paid_attorney'] + end + + if attributes.key?(:'section409_a_deferrals') + self.section409_a_deferrals = attributes[:'section409_a_deferrals'] + end + + if attributes.key?(:'section409_a_income') + self.section409_a_income = attributes[:'section409_a_income'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + else + self.id = nil + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + else + self.type = nil + end + + if attributes.key?(:'issuer_id') + self.issuer_id = attributes[:'issuer_id'] + else + self.issuer_id = nil + end + + if attributes.key?(:'issuer_reference_id') + self.issuer_reference_id = attributes[:'issuer_reference_id'] + end + + if attributes.key?(:'issuer_tin') + self.issuer_tin = attributes[:'issuer_tin'] + end + + if attributes.key?(:'tax_year') + self.tax_year = attributes[:'tax_year'] + end + + if attributes.key?(:'federal_efile') + self.federal_efile = attributes[:'federal_efile'] + else + self.federal_efile = nil + end + + if attributes.key?(:'federal_efile_status') + self.federal_efile_status = attributes[:'federal_efile_status'] + end + + if attributes.key?(:'state_efile') + self.state_efile = attributes[:'state_efile'] + else + self.state_efile = nil + end + + if attributes.key?(:'state_efile_status') + if (value = attributes[:'state_efile_status']).is_a?(Array) + self.state_efile_status = value + end + end + + if attributes.key?(:'postal_mail') + self.postal_mail = attributes[:'postal_mail'] + else + self.postal_mail = nil + end + + if attributes.key?(:'postal_mail_status') + self.postal_mail_status = attributes[:'postal_mail_status'] + end + + if attributes.key?(:'tin_match') + self.tin_match = attributes[:'tin_match'] + else + self.tin_match = nil + end + + if attributes.key?(:'tin_match_status') + self.tin_match_status = attributes[:'tin_match_status'] + end + + if attributes.key?(:'address_verification') + self.address_verification = attributes[:'address_verification'] + else + self.address_verification = nil + end + + if attributes.key?(:'address_verification_status') + self.address_verification_status = attributes[:'address_verification_status'] + end + + if attributes.key?(:'reference_id') + self.reference_id = attributes[:'reference_id'] + end + + if attributes.key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.key?(:'tin_type') + self.tin_type = attributes[:'tin_type'] + end + + if attributes.key?(:'tin') + self.tin = attributes[:'tin'] + end + + if attributes.key?(:'recipient_name') + self.recipient_name = attributes[:'recipient_name'] + end + + if attributes.key?(:'recipient_second_name') + self.recipient_second_name = attributes[:'recipient_second_name'] + end + + if attributes.key?(:'address') + self.address = attributes[:'address'] + end + + if attributes.key?(:'address2') + self.address2 = attributes[:'address2'] + end + + if attributes.key?(:'city') + self.city = attributes[:'city'] + end + + if attributes.key?(:'state') + self.state = attributes[:'state'] + end + + if attributes.key?(:'zip') + self.zip = attributes[:'zip'] + end + + if attributes.key?(:'foreign_province') + self.foreign_province = attributes[:'foreign_province'] + end + + if attributes.key?(:'country_code') + self.country_code = attributes[:'country_code'] + end + + if attributes.key?(:'validation_errors') + if (value = attributes[:'validation_errors']).is_a?(Array) + self.validation_errors = value + end + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + end + + if attributes.key?(:'state_and_local_withholding') + self.state_and_local_withholding = attributes[:'state_and_local_withholding'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @id.nil? + invalid_properties.push('invalid value for "id", id cannot be nil.') + end + + if @id.to_s.length < 1 + invalid_properties.push('invalid value for "id", the character length must be great than or equal to 1.') + end + + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @type.to_s.length < 1 + invalid_properties.push('invalid value for "type", the character length must be great than or equal to 1.') + end + + if @issuer_id.nil? + invalid_properties.push('invalid value for "issuer_id", issuer_id cannot be nil.') + end + + if @federal_efile.nil? + invalid_properties.push('invalid value for "federal_efile", federal_efile cannot be nil.') + end + + if @state_efile.nil? + invalid_properties.push('invalid value for "state_efile", state_efile cannot be nil.') + end + + if @postal_mail.nil? + invalid_properties.push('invalid value for "postal_mail", postal_mail cannot be nil.') + end + + if @tin_match.nil? + invalid_properties.push('invalid value for "tin_match", tin_match cannot be nil.') + end + + if @address_verification.nil? + invalid_properties.push('invalid value for "address_verification", address_verification cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @id.nil? + return false if @id.to_s.length < 1 + return false if @type.nil? + return false if @type.to_s.length < 1 + return false if @issuer_id.nil? + return false if @federal_efile.nil? + return false if @state_efile.nil? + return false if @postal_mail.nil? + return false if @tin_match.nil? + return false if @address_verification.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + if id.to_s.length < 1 + fail ArgumentError, 'invalid value for "id", the character length must be great than or equal to 1.' + end + + @id = id + end + + # Custom attribute writer method with validation + # @param [Object] type Value to be assigned + def type=(type) + if type.nil? + fail ArgumentError, 'type cannot be nil' + end + + if type.to_s.length < 1 + fail ArgumentError, 'invalid value for "type", the character length must be great than or equal to 1.' + end + + @type = type + end + + # Custom attribute writer method with validation + # @param [Object] state_efile_status Value to be assigned + def state_efile_status=(state_efile_status) + @state_efile_status = state_efile_status + end + + # Custom attribute writer method with validation + # @param [Object] validation_errors Value to be assigned + def validation_errors=(validation_errors) + @validation_errors = validation_errors + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + rents == o.rents && + royalties == o.royalties && + other_income == o.other_income && + fed_income_tax_withheld == o.fed_income_tax_withheld && + fishing_boat_proceeds == o.fishing_boat_proceeds && + medical_and_health_care == o.medical_and_health_care && + substitute_payments == o.substitute_payments && + direct_sales_indicator == o.direct_sales_indicator && + crop_insurance_proceeds == o.crop_insurance_proceeds && + excess_golden_parachute == o.excess_golden_parachute && + gross_amount_paid_attorney == o.gross_amount_paid_attorney && + section409_a_deferrals == o.section409_a_deferrals && + section409_a_income == o.section409_a_income && + id == o.id && + type == o.type && + issuer_id == o.issuer_id && + issuer_reference_id == o.issuer_reference_id && + issuer_tin == o.issuer_tin && + tax_year == o.tax_year && + federal_efile == o.federal_efile && + federal_efile_status == o.federal_efile_status && + state_efile == o.state_efile && + state_efile_status == o.state_efile_status && + postal_mail == o.postal_mail && + postal_mail_status == o.postal_mail_status && + tin_match == o.tin_match && + tin_match_status == o.tin_match_status && + address_verification == o.address_verification && + address_verification_status == o.address_verification_status && + reference_id == o.reference_id && + email == o.email && + tin_type == o.tin_type && + tin == o.tin && + recipient_name == o.recipient_name && + recipient_second_name == o.recipient_second_name && + address == o.address && + address2 == o.address2 && + city == o.city && + state == o.state && + zip == o.zip && + foreign_province == o.foreign_province && + country_code == o.country_code && + validation_errors == o.validation_errors && + created_at == o.created_at && + updated_at == o.updated_at && + state_and_local_withholding == o.state_and_local_withholding + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [rents, royalties, other_income, fed_income_tax_withheld, fishing_boat_proceeds, medical_and_health_care, substitute_payments, direct_sales_indicator, crop_insurance_proceeds, excess_golden_parachute, gross_amount_paid_attorney, section409_a_deferrals, section409_a_income, id, type, issuer_id, issuer_reference_id, issuer_tin, tax_year, federal_efile, federal_efile_status, state_efile, state_efile_status, postal_mail, postal_mail_status, tin_match, tin_match_status, address_verification, address_verification_status, reference_id, email, tin_type, tin, recipient_name, recipient_second_name, address, address2, city, state, zip, foreign_province, country_code, validation_errors, created_at, updated_at, state_and_local_withholding].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::A1099::V2.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/A1099/V2/form1099_misc_request.rb b/lib/avalara_sdk/models/A1099/V2/form1099_misc_request.rb index 7bfa734..39c876e 100644 --- a/lib/avalara_sdk/models/A1099/V2/form1099_misc_request.rb +++ b/lib/avalara_sdk/models/A1099/V2/form1099_misc_request.rb @@ -1,7 +1,7 @@ =begin #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) =end @@ -11,82 +11,120 @@ module AvalaraSdk::A1099::V2 class Form1099MiscRequest + # Second TIN notice attr_accessor :second_tin_notice + # Rents attr_accessor :rents + # Royalties attr_accessor :royalties + # Other income attr_accessor :other_income + # Federal income tax withheld attr_accessor :fed_income_tax_withheld + # Fishing boat proceeds attr_accessor :fishing_boat_proceeds + # Medical and health care payments attr_accessor :medical_health_care_payments - attr_accessor :payer_made_direct_sales + # Payer made direct sales totaling $5,000 or more of consumer products to recipient for resale + attr_accessor :direct_sales_indicator + # Substitute payments in lieu of dividends or interest attr_accessor :substitute_payments + # Crop insurance proceeds attr_accessor :crop_insurance_proceeds + # Gross proceeds paid to an attorney attr_accessor :gross_proceeds_paid_to_attorney + # Fish purchased for resale attr_accessor :fish_purchased_for_resale + # Section 409A deferrals attr_accessor :section409_a_deferrals + # FATCA filing requirement attr_accessor :fatca_filing_requirement + # (Legacy field) Excess golden parachute payments attr_accessor :excess_golden_parachute_payments + # Nonqualified deferred compensation attr_accessor :nonqualified_deferred_compensation attr_accessor :type + # Issuer ID attr_accessor :issuer_id + # Reference ID attr_accessor :reference_id - attr_accessor :recipient_name - + # Recipient Tax ID Number attr_accessor :recipient_tin + # Recipient name + attr_accessor :recipient_name + + # Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN attr_accessor :tin_type + # Recipient second name attr_accessor :recipient_second_name + # Address attr_accessor :address + # Address line 2 attr_accessor :address2 + # City attr_accessor :city + # US state. Required if CountryCode is \"US\". attr_accessor :state + # Zip/postal code attr_accessor :zip + # Recipient email address attr_accessor :recipient_email + # Account number attr_accessor :account_number + # Office code attr_accessor :office_code + # Foreign province attr_accessor :recipient_non_us_province + # Country code, as defined at https://www.irs.gov/e-file-providers/country-codes attr_accessor :country_code + # Boolean indicating that federal e-filing should be scheduled for this form attr_accessor :federal_e_file + # Boolean indicating that postal mailing to the recipient should be scheduled for this form attr_accessor :postal_mail + # Boolean indicating that state e-filing should be scheduled for this form attr_accessor :state_e_file + # Boolean indicating that TIN Matching should be scheduled for this form attr_accessor :tin_match + # Boolean indicating that address verification should be scheduled for this form attr_accessor :address_verification + # State and local withholding information attr_accessor :state_and_local_withholding class EnumAttributeValidator @@ -121,7 +159,7 @@ def self.attribute_map :'fed_income_tax_withheld' => :'fedIncomeTaxWithheld', :'fishing_boat_proceeds' => :'fishingBoatProceeds', :'medical_health_care_payments' => :'medicalHealthCarePayments', - :'payer_made_direct_sales' => :'payerMadeDirectSales', + :'direct_sales_indicator' => :'directSalesIndicator', :'substitute_payments' => :'substitutePayments', :'crop_insurance_proceeds' => :'cropInsuranceProceeds', :'gross_proceeds_paid_to_attorney' => :'grossProceedsPaidToAttorney', @@ -133,8 +171,8 @@ def self.attribute_map :'type' => :'type', :'issuer_id' => :'issuerId', :'reference_id' => :'referenceId', - :'recipient_name' => :'recipientName', :'recipient_tin' => :'recipientTin', + :'recipient_name' => :'recipientName', :'tin_type' => :'tinType', :'recipient_second_name' => :'recipientSecondName', :'address' => :'address', @@ -171,7 +209,7 @@ def self.openapi_types :'fed_income_tax_withheld' => :'Float', :'fishing_boat_proceeds' => :'Float', :'medical_health_care_payments' => :'Float', - :'payer_made_direct_sales' => :'Boolean', + :'direct_sales_indicator' => :'Boolean', :'substitute_payments' => :'Float', :'crop_insurance_proceeds' => :'Float', :'gross_proceeds_paid_to_attorney' => :'Float', @@ -183,8 +221,8 @@ def self.openapi_types :'type' => :'String', :'issuer_id' => :'String', :'reference_id' => :'String', - :'recipient_name' => :'String', :'recipient_tin' => :'String', + :'recipient_name' => :'String', :'tin_type' => :'String', :'recipient_second_name' => :'String', :'address' => :'String', @@ -211,7 +249,7 @@ def self.openapi_nullable Set.new([ :'issuer_id', :'reference_id', - :'recipient_name', + :'recipient_second_name', :'address2', :'recipient_email', :'account_number', @@ -270,8 +308,8 @@ def initialize(attributes = {}) self.medical_health_care_payments = attributes[:'medical_health_care_payments'] end - if attributes.key?(:'payer_made_direct_sales') - self.payer_made_direct_sales = attributes[:'payer_made_direct_sales'] + if attributes.key?(:'direct_sales_indicator') + self.direct_sales_indicator = attributes[:'direct_sales_indicator'] end if attributes.key?(:'substitute_payments') @@ -318,14 +356,16 @@ def initialize(attributes = {}) self.reference_id = attributes[:'reference_id'] end - if attributes.key?(:'recipient_name') - self.recipient_name = attributes[:'recipient_name'] - end - if attributes.key?(:'recipient_tin') self.recipient_tin = attributes[:'recipient_tin'] end + if attributes.key?(:'recipient_name') + self.recipient_name = attributes[:'recipient_name'] + else + self.recipient_name = nil + end + if attributes.key?(:'tin_type') self.tin_type = attributes[:'tin_type'] end @@ -336,6 +376,8 @@ def initialize(attributes = {}) if attributes.key?(:'address') self.address = attributes[:'address'] + else + self.address = nil end if attributes.key?(:'address2') @@ -344,6 +386,8 @@ def initialize(attributes = {}) if attributes.key?(:'city') self.city = attributes[:'city'] + else + self.city = nil end if attributes.key?(:'state') @@ -372,6 +416,8 @@ def initialize(attributes = {}) if attributes.key?(:'country_code') self.country_code = attributes[:'country_code'] + else + self.country_code = nil end if attributes.key?(:'federal_e_file') @@ -404,6 +450,38 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @recipient_name.nil? + invalid_properties.push('invalid value for "recipient_name", recipient_name cannot be nil.') + end + + if @recipient_name.to_s.length < 1 + invalid_properties.push('invalid value for "recipient_name", the character length must be great than or equal to 1.') + end + + if @address.nil? + invalid_properties.push('invalid value for "address", address cannot be nil.') + end + + if @address.to_s.length < 1 + invalid_properties.push('invalid value for "address", the character length must be great than or equal to 1.') + end + + if @city.nil? + invalid_properties.push('invalid value for "city", city cannot be nil.') + end + + if @city.to_s.length < 1 + invalid_properties.push('invalid value for "city", the character length must be great than or equal to 1.') + end + + if @country_code.nil? + invalid_properties.push('invalid value for "country_code", country_code cannot be nil.') + end + + if @country_code.to_s.length < 1 + invalid_properties.push('invalid value for "country_code", the character length must be great than or equal to 1.') + end + invalid_properties end @@ -411,23 +489,45 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - type_validator = EnumAttributeValidator.new('String', ["Form1099Nec", "Form1099Misc", "Form1099Div", "Form1099R", "Form1099K", "Form1095B"]) + type_validator = EnumAttributeValidator.new('String', ["1099-NEC", "1099-MISC", "1099-DIV", "1099-R", "1099-K", "1095-B", "1042-S"]) return false unless type_validator.valid?(@type) + return false if @recipient_name.nil? + return false if @recipient_name.to_s.length < 1 tin_type_validator = EnumAttributeValidator.new('String', ["EIN", "SSN", "ITIN", "ATIN"]) return false unless tin_type_validator.valid?(@tin_type) + return false if @address.nil? + return false if @address.to_s.length < 1 + return false if @city.nil? + return false if @city.to_s.length < 1 + return false if @country_code.nil? + return false if @country_code.to_s.length < 1 true end # Custom attribute writer method checking allowed values (enum). # @param [Object] type Object to be assigned def type=(type) - validator = EnumAttributeValidator.new('String', ["Form1099Nec", "Form1099Misc", "Form1099Div", "Form1099R", "Form1099K", "Form1095B"]) + validator = EnumAttributeValidator.new('String', ["1099-NEC", "1099-MISC", "1099-DIV", "1099-R", "1099-K", "1095-B", "1042-S"]) unless validator.valid?(type) fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." end @type = type end + # Custom attribute writer method with validation + # @param [Object] recipient_name Value to be assigned + def recipient_name=(recipient_name) + if recipient_name.nil? + fail ArgumentError, 'recipient_name cannot be nil' + end + + if recipient_name.to_s.length < 1 + fail ArgumentError, 'invalid value for "recipient_name", the character length must be great than or equal to 1.' + end + + @recipient_name = recipient_name + end + # Custom attribute writer method checking allowed values (enum). # @param [Object] tin_type Object to be assigned def tin_type=(tin_type) @@ -438,6 +538,48 @@ def tin_type=(tin_type) @tin_type = tin_type end + # Custom attribute writer method with validation + # @param [Object] address Value to be assigned + def address=(address) + if address.nil? + fail ArgumentError, 'address cannot be nil' + end + + if address.to_s.length < 1 + fail ArgumentError, 'invalid value for "address", the character length must be great than or equal to 1.' + end + + @address = address + end + + # Custom attribute writer method with validation + # @param [Object] city Value to be assigned + def city=(city) + if city.nil? + fail ArgumentError, 'city cannot be nil' + end + + if city.to_s.length < 1 + fail ArgumentError, 'invalid value for "city", the character length must be great than or equal to 1.' + end + + @city = city + end + + # Custom attribute writer method with validation + # @param [Object] country_code Value to be assigned + def country_code=(country_code) + if country_code.nil? + fail ArgumentError, 'country_code cannot be nil' + end + + if country_code.to_s.length < 1 + fail ArgumentError, 'invalid value for "country_code", the character length must be great than or equal to 1.' + end + + @country_code = country_code + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -450,7 +592,7 @@ def ==(o) fed_income_tax_withheld == o.fed_income_tax_withheld && fishing_boat_proceeds == o.fishing_boat_proceeds && medical_health_care_payments == o.medical_health_care_payments && - payer_made_direct_sales == o.payer_made_direct_sales && + direct_sales_indicator == o.direct_sales_indicator && substitute_payments == o.substitute_payments && crop_insurance_proceeds == o.crop_insurance_proceeds && gross_proceeds_paid_to_attorney == o.gross_proceeds_paid_to_attorney && @@ -462,8 +604,8 @@ def ==(o) type == o.type && issuer_id == o.issuer_id && reference_id == o.reference_id && - recipient_name == o.recipient_name && recipient_tin == o.recipient_tin && + recipient_name == o.recipient_name && tin_type == o.tin_type && recipient_second_name == o.recipient_second_name && address == o.address && @@ -493,7 +635,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [second_tin_notice, rents, royalties, other_income, fed_income_tax_withheld, fishing_boat_proceeds, medical_health_care_payments, payer_made_direct_sales, substitute_payments, crop_insurance_proceeds, gross_proceeds_paid_to_attorney, fish_purchased_for_resale, section409_a_deferrals, fatca_filing_requirement, excess_golden_parachute_payments, nonqualified_deferred_compensation, type, issuer_id, reference_id, recipient_name, recipient_tin, tin_type, recipient_second_name, address, address2, city, state, zip, recipient_email, account_number, office_code, recipient_non_us_province, country_code, federal_e_file, postal_mail, state_e_file, tin_match, address_verification, state_and_local_withholding].hash + [second_tin_notice, rents, royalties, other_income, fed_income_tax_withheld, fishing_boat_proceeds, medical_health_care_payments, direct_sales_indicator, substitute_payments, crop_insurance_proceeds, gross_proceeds_paid_to_attorney, fish_purchased_for_resale, section409_a_deferrals, fatca_filing_requirement, excess_golden_parachute_payments, nonqualified_deferred_compensation, type, issuer_id, reference_id, recipient_tin, recipient_name, tin_type, recipient_second_name, address, address2, city, state, zip, recipient_email, account_number, office_code, recipient_non_us_province, country_code, federal_e_file, postal_mail, state_e_file, tin_match, address_verification, state_and_local_withholding].hash end # Builds the object from hash diff --git a/lib/avalara_sdk/models/A1099/V2/form1099_misc_response.rb b/lib/avalara_sdk/models/A1099/V2/form1099_misc_response.rb index 93b92a4..ca449db 100644 --- a/lib/avalara_sdk/models/A1099/V2/form1099_misc_response.rb +++ b/lib/avalara_sdk/models/A1099/V2/form1099_misc_response.rb @@ -1,7 +1,7 @@ =begin #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) =end @@ -25,7 +25,7 @@ class Form1099MiscResponse attr_accessor :medical_health_care_payments - attr_accessor :payer_made_direct_sales + attr_accessor :direct_sales_indicator attr_accessor :substitute_payments @@ -147,7 +147,7 @@ def self.attribute_map :'fed_income_tax_withheld' => :'fedIncomeTaxWithheld', :'fishing_boat_proceeds' => :'fishingBoatProceeds', :'medical_health_care_payments' => :'medicalHealthCarePayments', - :'payer_made_direct_sales' => :'payerMadeDirectSales', + :'direct_sales_indicator' => :'directSalesIndicator', :'substitute_payments' => :'substitutePayments', :'crop_insurance_proceeds' => :'cropInsuranceProceeds', :'gross_proceeds_paid_to_attorney' => :'grossProceedsPaidToAttorney', @@ -210,7 +210,7 @@ def self.openapi_types :'fed_income_tax_withheld' => :'Float', :'fishing_boat_proceeds' => :'Float', :'medical_health_care_payments' => :'Float', - :'payer_made_direct_sales' => :'Boolean', + :'direct_sales_indicator' => :'Boolean', :'substitute_payments' => :'Float', :'crop_insurance_proceeds' => :'Float', :'gross_proceeds_paid_to_attorney' => :'Float', @@ -250,11 +250,11 @@ def self.openapi_types :'tin_match' => :'Boolean', :'address_verification' => :'Boolean', :'federal_efile_status' => :'StatusDetail', - :'state_efile_status' => :'Array', + :'state_efile_status' => :'Array', :'postal_mail_status' => :'StatusDetail', :'tin_match_status' => :'StatusDetail', :'address_verification_status' => :'StatusDetail', - :'validation_errors' => :'Array' + :'validation_errors' => :'Array' } end @@ -320,8 +320,8 @@ def initialize(attributes = {}) self.medical_health_care_payments = attributes[:'medical_health_care_payments'] end - if attributes.key?(:'payer_made_direct_sales') - self.payer_made_direct_sales = attributes[:'payer_made_direct_sales'] + if attributes.key?(:'direct_sales_indicator') + self.direct_sales_indicator = attributes[:'direct_sales_indicator'] end if attributes.key?(:'substitute_payments') @@ -517,7 +517,7 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - type_validator = EnumAttributeValidator.new('String', ["Form1099Nec", "Form1099Misc", "Form1099Div", "Form1099R", "Form1099K", "Form1095B"]) + type_validator = EnumAttributeValidator.new('String', ["1099-NEC", "1099-MISC", "1099-DIV", "1099-R", "1099-K", "1095-B", "1042-S"]) return false unless type_validator.valid?(@type) tin_type_validator = EnumAttributeValidator.new('String', ["EIN", "SSN", "ITIN", "ATIN"]) return false unless tin_type_validator.valid?(@tin_type) @@ -527,7 +527,7 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] type Object to be assigned def type=(type) - validator = EnumAttributeValidator.new('String', ["Form1099Nec", "Form1099Misc", "Form1099Div", "Form1099R", "Form1099K", "Form1095B"]) + validator = EnumAttributeValidator.new('String', ["1099-NEC", "1099-MISC", "1099-DIV", "1099-R", "1099-K", "1095-B", "1042-S"]) unless validator.valid?(type) fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." end @@ -568,7 +568,7 @@ def ==(o) fed_income_tax_withheld == o.fed_income_tax_withheld && fishing_boat_proceeds == o.fishing_boat_proceeds && medical_health_care_payments == o.medical_health_care_payments && - payer_made_direct_sales == o.payer_made_direct_sales && + direct_sales_indicator == o.direct_sales_indicator && substitute_payments == o.substitute_payments && crop_insurance_proceeds == o.crop_insurance_proceeds && gross_proceeds_paid_to_attorney == o.gross_proceeds_paid_to_attorney && @@ -624,7 +624,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [second_tin_notice, rents, royalties, other_income, fed_income_tax_withheld, fishing_boat_proceeds, medical_health_care_payments, payer_made_direct_sales, substitute_payments, crop_insurance_proceeds, gross_proceeds_paid_to_attorney, fish_purchased_for_resale, section409_a_deferrals, fatca_filing_requirement, excess_golden_parachute_payments, nonqualified_deferred_compensation, type, created_at, updated_at, user_id, state_and_local_withholding, tin_type, id, issuer_id, issuer_reference_id, issuer_tin, tax_year, reference_id, recipient_name, recipient_tin, recipient_second_name, address, address2, city, state, zip, recipient_email, account_number, office_code, recipient_non_us_province, country_code, federal_e_file, postal_mail, state_e_file, tin_match, address_verification, federal_efile_status, state_efile_status, postal_mail_status, tin_match_status, address_verification_status, validation_errors].hash + [second_tin_notice, rents, royalties, other_income, fed_income_tax_withheld, fishing_boat_proceeds, medical_health_care_payments, direct_sales_indicator, substitute_payments, crop_insurance_proceeds, gross_proceeds_paid_to_attorney, fish_purchased_for_resale, section409_a_deferrals, fatca_filing_requirement, excess_golden_parachute_payments, nonqualified_deferred_compensation, type, created_at, updated_at, user_id, state_and_local_withholding, tin_type, id, issuer_id, issuer_reference_id, issuer_tin, tax_year, reference_id, recipient_name, recipient_tin, recipient_second_name, address, address2, city, state, zip, recipient_email, account_number, office_code, recipient_non_us_province, country_code, federal_e_file, postal_mail, state_e_file, tin_match, address_verification, federal_efile_status, state_efile_status, postal_mail_status, tin_match_status, address_verification_status, validation_errors].hash end # Builds the object from hash diff --git a/lib/avalara_sdk/models/A1099/V2/form1099_nec_list.rb b/lib/avalara_sdk/models/A1099/V2/form1099_nec_list.rb index 4a16756..a83d88f 100644 --- a/lib/avalara_sdk/models/A1099/V2/form1099_nec_list.rb +++ b/lib/avalara_sdk/models/A1099/V2/form1099_nec_list.rb @@ -1,7 +1,7 @@ =begin #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) =end diff --git a/lib/avalara_sdk/models/A1099/V2/form1099_nec_list_item.rb b/lib/avalara_sdk/models/A1099/V2/form1099_nec_list_item.rb index ff4825a..d8e5798 100644 --- a/lib/avalara_sdk/models/A1099/V2/form1099_nec_list_item.rb +++ b/lib/avalara_sdk/models/A1099/V2/form1099_nec_list_item.rb @@ -1,7 +1,7 @@ =begin #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) =end @@ -10,63 +10,93 @@ require 'time' module AvalaraSdk::A1099::V2 - class Form1099NecListItem + # 1099-NEC - Nonemployee compensation + class Form1099NecListItem + # Second TIN notice attr_accessor :second_tin_notice + # Nonemployee compensation attr_accessor :nonemployee_compensation - attr_accessor :payer_made_direct_sales + # Payer made direct sales totaling $5,000 or more of consumer products to recipient for resale + attr_accessor :direct_sales_indicator + # Federal income tax withheld attr_accessor :federal_income_tax_withheld + # Issuer Reference ID. One of `issuerReferenceId` or `issuerTin` is required. attr_accessor :issuer_reference_id + # Issuer TIN. One of `issuerReferenceId` or `issuerTin` is required. attr_accessor :issuer_tin + # Tax year attr_accessor :tax_year + # Issuer ID attr_accessor :issuer_id + # Reference ID attr_accessor :reference_id - attr_accessor :recipient_name - + # Recipient Tax ID Number attr_accessor :recipient_tin + # Recipient name + attr_accessor :recipient_name + + # Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN attr_accessor :tin_type + # Recipient second name attr_accessor :recipient_second_name + # Address attr_accessor :address + # Address line 2 attr_accessor :address2 + # City attr_accessor :city + # US state. Required if CountryCode is \"US\". attr_accessor :state + # Zip/postal code attr_accessor :zip + # Recipient email address attr_accessor :recipient_email + # Account number attr_accessor :account_number + # Office code attr_accessor :office_code + # Foreign province attr_accessor :recipient_non_us_province + # Country code, as defined at https://www.irs.gov/e-file-providers/country-codes attr_accessor :country_code + # Boolean indicating that federal e-filing should be scheduled for this form attr_accessor :federal_e_file + # Boolean indicating that postal mailing to the recipient should be scheduled for this form attr_accessor :postal_mail + # Boolean indicating that state e-filing should be scheduled for this form attr_accessor :state_e_file + # Boolean indicating that TIN Matching should be scheduled for this form attr_accessor :tin_match + # Boolean indicating that address verification should be scheduled for this form attr_accessor :address_verification + # State and local withholding information attr_accessor :state_and_local_withholding class EnumAttributeValidator @@ -96,15 +126,15 @@ def self.attribute_map { :'second_tin_notice' => :'secondTinNotice', :'nonemployee_compensation' => :'nonemployeeCompensation', - :'payer_made_direct_sales' => :'payerMadeDirectSales', + :'direct_sales_indicator' => :'directSalesIndicator', :'federal_income_tax_withheld' => :'federalIncomeTaxWithheld', :'issuer_reference_id' => :'issuerReferenceId', :'issuer_tin' => :'issuerTin', :'tax_year' => :'taxYear', :'issuer_id' => :'issuerId', :'reference_id' => :'referenceId', - :'recipient_name' => :'recipientName', :'recipient_tin' => :'recipientTin', + :'recipient_name' => :'recipientName', :'tin_type' => :'tinType', :'recipient_second_name' => :'recipientSecondName', :'address' => :'address', @@ -136,15 +166,15 @@ def self.openapi_types { :'second_tin_notice' => :'Boolean', :'nonemployee_compensation' => :'Float', - :'payer_made_direct_sales' => :'Boolean', + :'direct_sales_indicator' => :'Boolean', :'federal_income_tax_withheld' => :'Float', :'issuer_reference_id' => :'String', :'issuer_tin' => :'String', :'tax_year' => :'Integer', :'issuer_id' => :'String', :'reference_id' => :'String', - :'recipient_name' => :'String', :'recipient_tin' => :'String', + :'recipient_name' => :'String', :'tin_type' => :'String', :'recipient_second_name' => :'String', :'address' => :'String', @@ -171,7 +201,7 @@ def self.openapi_nullable Set.new([ :'issuer_id', :'reference_id', - :'recipient_name', + :'recipient_second_name', :'address2', :'recipient_email', :'account_number', @@ -183,7 +213,7 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'FormRequestCsvBase' + :'FormRequestListItemBase' ] end @@ -208,10 +238,12 @@ def initialize(attributes = {}) if attributes.key?(:'nonemployee_compensation') self.nonemployee_compensation = attributes[:'nonemployee_compensation'] + else + self.nonemployee_compensation = nil end - if attributes.key?(:'payer_made_direct_sales') - self.payer_made_direct_sales = attributes[:'payer_made_direct_sales'] + if attributes.key?(:'direct_sales_indicator') + self.direct_sales_indicator = attributes[:'direct_sales_indicator'] end if attributes.key?(:'federal_income_tax_withheld') @@ -228,6 +260,8 @@ def initialize(attributes = {}) if attributes.key?(:'tax_year') self.tax_year = attributes[:'tax_year'] + else + self.tax_year = nil end if attributes.key?(:'issuer_id') @@ -238,14 +272,16 @@ def initialize(attributes = {}) self.reference_id = attributes[:'reference_id'] end - if attributes.key?(:'recipient_name') - self.recipient_name = attributes[:'recipient_name'] - end - if attributes.key?(:'recipient_tin') self.recipient_tin = attributes[:'recipient_tin'] end + if attributes.key?(:'recipient_name') + self.recipient_name = attributes[:'recipient_name'] + else + self.recipient_name = nil + end + if attributes.key?(:'tin_type') self.tin_type = attributes[:'tin_type'] end @@ -256,6 +292,8 @@ def initialize(attributes = {}) if attributes.key?(:'address') self.address = attributes[:'address'] + else + self.address = nil end if attributes.key?(:'address2') @@ -264,6 +302,8 @@ def initialize(attributes = {}) if attributes.key?(:'city') self.city = attributes[:'city'] + else + self.city = nil end if attributes.key?(:'state') @@ -292,6 +332,8 @@ def initialize(attributes = {}) if attributes.key?(:'country_code') self.country_code = attributes[:'country_code'] + else + self.country_code = nil end if attributes.key?(:'federal_e_file') @@ -324,6 +366,46 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @nonemployee_compensation.nil? + invalid_properties.push('invalid value for "nonemployee_compensation", nonemployee_compensation cannot be nil.') + end + + if @tax_year.nil? + invalid_properties.push('invalid value for "tax_year", tax_year cannot be nil.') + end + + if @recipient_name.nil? + invalid_properties.push('invalid value for "recipient_name", recipient_name cannot be nil.') + end + + if @recipient_name.to_s.length < 1 + invalid_properties.push('invalid value for "recipient_name", the character length must be great than or equal to 1.') + end + + if @address.nil? + invalid_properties.push('invalid value for "address", address cannot be nil.') + end + + if @address.to_s.length < 1 + invalid_properties.push('invalid value for "address", the character length must be great than or equal to 1.') + end + + if @city.nil? + invalid_properties.push('invalid value for "city", city cannot be nil.') + end + + if @city.to_s.length < 1 + invalid_properties.push('invalid value for "city", the character length must be great than or equal to 1.') + end + + if @country_code.nil? + invalid_properties.push('invalid value for "country_code", country_code cannot be nil.') + end + + if @country_code.to_s.length < 1 + invalid_properties.push('invalid value for "country_code", the character length must be great than or equal to 1.') + end + invalid_properties end @@ -331,11 +413,35 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @nonemployee_compensation.nil? + return false if @tax_year.nil? + return false if @recipient_name.nil? + return false if @recipient_name.to_s.length < 1 tin_type_validator = EnumAttributeValidator.new('String', ["EIN", "SSN", "ITIN", "ATIN"]) return false unless tin_type_validator.valid?(@tin_type) + return false if @address.nil? + return false if @address.to_s.length < 1 + return false if @city.nil? + return false if @city.to_s.length < 1 + return false if @country_code.nil? + return false if @country_code.to_s.length < 1 true end + # Custom attribute writer method with validation + # @param [Object] recipient_name Value to be assigned + def recipient_name=(recipient_name) + if recipient_name.nil? + fail ArgumentError, 'recipient_name cannot be nil' + end + + if recipient_name.to_s.length < 1 + fail ArgumentError, 'invalid value for "recipient_name", the character length must be great than or equal to 1.' + end + + @recipient_name = recipient_name + end + # Custom attribute writer method checking allowed values (enum). # @param [Object] tin_type Object to be assigned def tin_type=(tin_type) @@ -346,6 +452,48 @@ def tin_type=(tin_type) @tin_type = tin_type end + # Custom attribute writer method with validation + # @param [Object] address Value to be assigned + def address=(address) + if address.nil? + fail ArgumentError, 'address cannot be nil' + end + + if address.to_s.length < 1 + fail ArgumentError, 'invalid value for "address", the character length must be great than or equal to 1.' + end + + @address = address + end + + # Custom attribute writer method with validation + # @param [Object] city Value to be assigned + def city=(city) + if city.nil? + fail ArgumentError, 'city cannot be nil' + end + + if city.to_s.length < 1 + fail ArgumentError, 'invalid value for "city", the character length must be great than or equal to 1.' + end + + @city = city + end + + # Custom attribute writer method with validation + # @param [Object] country_code Value to be assigned + def country_code=(country_code) + if country_code.nil? + fail ArgumentError, 'country_code cannot be nil' + end + + if country_code.to_s.length < 1 + fail ArgumentError, 'invalid value for "country_code", the character length must be great than or equal to 1.' + end + + @country_code = country_code + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -353,15 +501,15 @@ def ==(o) self.class == o.class && second_tin_notice == o.second_tin_notice && nonemployee_compensation == o.nonemployee_compensation && - payer_made_direct_sales == o.payer_made_direct_sales && + direct_sales_indicator == o.direct_sales_indicator && federal_income_tax_withheld == o.federal_income_tax_withheld && issuer_reference_id == o.issuer_reference_id && issuer_tin == o.issuer_tin && tax_year == o.tax_year && issuer_id == o.issuer_id && reference_id == o.reference_id && - recipient_name == o.recipient_name && recipient_tin == o.recipient_tin && + recipient_name == o.recipient_name && tin_type == o.tin_type && recipient_second_name == o.recipient_second_name && address == o.address && @@ -391,7 +539,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [second_tin_notice, nonemployee_compensation, payer_made_direct_sales, federal_income_tax_withheld, issuer_reference_id, issuer_tin, tax_year, issuer_id, reference_id, recipient_name, recipient_tin, tin_type, recipient_second_name, address, address2, city, state, zip, recipient_email, account_number, office_code, recipient_non_us_province, country_code, federal_e_file, postal_mail, state_e_file, tin_match, address_verification, state_and_local_withholding].hash + [second_tin_notice, nonemployee_compensation, direct_sales_indicator, federal_income_tax_withheld, issuer_reference_id, issuer_tin, tax_year, issuer_id, reference_id, recipient_tin, recipient_name, tin_type, recipient_second_name, address, address2, city, state, zip, recipient_email, account_number, office_code, recipient_non_us_province, country_code, federal_e_file, postal_mail, state_e_file, tin_match, address_verification, state_and_local_withholding].hash end # Builds the object from hash diff --git a/lib/avalara_sdk/models/A1099/V2/form1099_nec_list_item_response.rb b/lib/avalara_sdk/models/A1099/V2/form1099_nec_list_item_response.rb new file mode 100644 index 0000000..2be387b --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/form1099_nec_list_item_response.rb @@ -0,0 +1,700 @@ +=begin +#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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class Form1099NecListItemResponse + # Nonemployee compensation + attr_accessor :nonemployee_compensation + + # Federal income tax withheld + attr_accessor :federal_income_tax_withheld + + # Payer made direct sales totaling $5,000 or more of consumer products to recipient for resale + attr_accessor :direct_sales_indicator + + # ID of the form + attr_accessor :id + + # 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 + attr_accessor :type + + # Issuer ID + attr_accessor :issuer_id + + # Issuer Reference ID + attr_accessor :issuer_reference_id + + # Issuer TIN + attr_accessor :issuer_tin + + # Tax year + attr_accessor :tax_year + + # Boolean indicating that federal e-filing has been scheduled for this form + attr_accessor :federal_efile + + # Federal e-file status + attr_accessor :federal_efile_status + + # Boolean indicating that state e-filing has been scheduled for this form + attr_accessor :state_efile + + # State e-file status + attr_accessor :state_efile_status + + # Boolean indicating that postal mailing to the recipient has been scheduled for this form + attr_accessor :postal_mail + + # Postal mail to recipient status + attr_accessor :postal_mail_status + + # Boolean indicating that TIN Matching has been scheduled for this form + attr_accessor :tin_match + + # TIN Match status + attr_accessor :tin_match_status + + # Boolean indicating that address verification has been scheduled for this form + attr_accessor :address_verification + + # Address verification status + attr_accessor :address_verification_status + + # Reference ID + attr_accessor :reference_id + + # Recipient email address + attr_accessor :email + + # Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN + attr_accessor :tin_type + + # Recipient Tax ID Number + attr_accessor :tin + + # Recipient name + attr_accessor :recipient_name + + # Recipient second name + attr_accessor :recipient_second_name + + # Address + attr_accessor :address + + # Address line 2 + attr_accessor :address2 + + # City + attr_accessor :city + + # US state + attr_accessor :state + + # Zip/postal code + attr_accessor :zip + + # Foreign province + attr_accessor :foreign_province + + # Country code, as defined at https://www.irs.gov/e-file-providers/country-codes + attr_accessor :country_code + + # Validation errors + attr_accessor :validation_errors + + # Creation time + attr_accessor :created_at + + # Update time + attr_accessor :updated_at + + attr_accessor :state_and_local_withholding + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'nonemployee_compensation' => :'nonemployeeCompensation', + :'federal_income_tax_withheld' => :'federalIncomeTaxWithheld', + :'direct_sales_indicator' => :'directSalesIndicator', + :'id' => :'id', + :'type' => :'type', + :'issuer_id' => :'issuerId', + :'issuer_reference_id' => :'issuerReferenceId', + :'issuer_tin' => :'issuerTin', + :'tax_year' => :'taxYear', + :'federal_efile' => :'federalEfile', + :'federal_efile_status' => :'federalEfileStatus', + :'state_efile' => :'stateEfile', + :'state_efile_status' => :'stateEfileStatus', + :'postal_mail' => :'postalMail', + :'postal_mail_status' => :'postalMailStatus', + :'tin_match' => :'tinMatch', + :'tin_match_status' => :'tinMatchStatus', + :'address_verification' => :'addressVerification', + :'address_verification_status' => :'addressVerificationStatus', + :'reference_id' => :'referenceId', + :'email' => :'email', + :'tin_type' => :'tinType', + :'tin' => :'tin', + :'recipient_name' => :'recipientName', + :'recipient_second_name' => :'recipientSecondName', + :'address' => :'address', + :'address2' => :'address2', + :'city' => :'city', + :'state' => :'state', + :'zip' => :'zip', + :'foreign_province' => :'foreignProvince', + :'country_code' => :'countryCode', + :'validation_errors' => :'validationErrors', + :'created_at' => :'createdAt', + :'updated_at' => :'updatedAt', + :'state_and_local_withholding' => :'stateAndLocalWithholding' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'nonemployee_compensation' => :'Float', + :'federal_income_tax_withheld' => :'Float', + :'direct_sales_indicator' => :'Boolean', + :'id' => :'String', + :'type' => :'String', + :'issuer_id' => :'Integer', + :'issuer_reference_id' => :'String', + :'issuer_tin' => :'String', + :'tax_year' => :'Integer', + :'federal_efile' => :'Boolean', + :'federal_efile_status' => :'Form1099StatusDetailResponse', + :'state_efile' => :'Boolean', + :'state_efile_status' => :'Array', + :'postal_mail' => :'Boolean', + :'postal_mail_status' => :'Form1099StatusDetailResponse', + :'tin_match' => :'Boolean', + :'tin_match_status' => :'Form1099StatusDetailResponse', + :'address_verification' => :'Boolean', + :'address_verification_status' => :'Form1099StatusDetailResponse', + :'reference_id' => :'String', + :'email' => :'String', + :'tin_type' => :'String', + :'tin' => :'String', + :'recipient_name' => :'String', + :'recipient_second_name' => :'String', + :'address' => :'String', + :'address2' => :'String', + :'city' => :'String', + :'state' => :'String', + :'zip' => :'String', + :'foreign_province' => :'String', + :'country_code' => :'String', + :'validation_errors' => :'Array', + :'created_at' => :'Time', + :'updated_at' => :'Time', + :'state_and_local_withholding' => :'StateAndLocalWithholdingResponse' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'nonemployee_compensation', + :'federal_income_tax_withheld', + :'issuer_reference_id', + :'issuer_tin', + :'state_efile_status', + :'postal_mail_status', + :'tin_match_status', + :'address_verification_status', + :'reference_id', + :'email', + :'tin_type', + :'tin', + :'recipient_name', + :'recipient_second_name', + :'address', + :'address2', + :'city', + :'state', + :'zip', + :'foreign_province', + :'country_code', + :'validation_errors', + :'state_and_local_withholding' + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'Form1099BaseResponse' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::A1099::V2::Form1099NecListItemResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::A1099::V2::Form1099NecListItemResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'nonemployee_compensation') + self.nonemployee_compensation = attributes[:'nonemployee_compensation'] + end + + if attributes.key?(:'federal_income_tax_withheld') + self.federal_income_tax_withheld = attributes[:'federal_income_tax_withheld'] + end + + if attributes.key?(:'direct_sales_indicator') + self.direct_sales_indicator = attributes[:'direct_sales_indicator'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + else + self.id = nil + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + else + self.type = nil + end + + if attributes.key?(:'issuer_id') + self.issuer_id = attributes[:'issuer_id'] + else + self.issuer_id = nil + end + + if attributes.key?(:'issuer_reference_id') + self.issuer_reference_id = attributes[:'issuer_reference_id'] + end + + if attributes.key?(:'issuer_tin') + self.issuer_tin = attributes[:'issuer_tin'] + end + + if attributes.key?(:'tax_year') + self.tax_year = attributes[:'tax_year'] + end + + if attributes.key?(:'federal_efile') + self.federal_efile = attributes[:'federal_efile'] + else + self.federal_efile = nil + end + + if attributes.key?(:'federal_efile_status') + self.federal_efile_status = attributes[:'federal_efile_status'] + end + + if attributes.key?(:'state_efile') + self.state_efile = attributes[:'state_efile'] + else + self.state_efile = nil + end + + if attributes.key?(:'state_efile_status') + if (value = attributes[:'state_efile_status']).is_a?(Array) + self.state_efile_status = value + end + end + + if attributes.key?(:'postal_mail') + self.postal_mail = attributes[:'postal_mail'] + else + self.postal_mail = nil + end + + if attributes.key?(:'postal_mail_status') + self.postal_mail_status = attributes[:'postal_mail_status'] + end + + if attributes.key?(:'tin_match') + self.tin_match = attributes[:'tin_match'] + else + self.tin_match = nil + end + + if attributes.key?(:'tin_match_status') + self.tin_match_status = attributes[:'tin_match_status'] + end + + if attributes.key?(:'address_verification') + self.address_verification = attributes[:'address_verification'] + else + self.address_verification = nil + end + + if attributes.key?(:'address_verification_status') + self.address_verification_status = attributes[:'address_verification_status'] + end + + if attributes.key?(:'reference_id') + self.reference_id = attributes[:'reference_id'] + end + + if attributes.key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.key?(:'tin_type') + self.tin_type = attributes[:'tin_type'] + end + + if attributes.key?(:'tin') + self.tin = attributes[:'tin'] + end + + if attributes.key?(:'recipient_name') + self.recipient_name = attributes[:'recipient_name'] + end + + if attributes.key?(:'recipient_second_name') + self.recipient_second_name = attributes[:'recipient_second_name'] + end + + if attributes.key?(:'address') + self.address = attributes[:'address'] + end + + if attributes.key?(:'address2') + self.address2 = attributes[:'address2'] + end + + if attributes.key?(:'city') + self.city = attributes[:'city'] + end + + if attributes.key?(:'state') + self.state = attributes[:'state'] + end + + if attributes.key?(:'zip') + self.zip = attributes[:'zip'] + end + + if attributes.key?(:'foreign_province') + self.foreign_province = attributes[:'foreign_province'] + end + + if attributes.key?(:'country_code') + self.country_code = attributes[:'country_code'] + end + + if attributes.key?(:'validation_errors') + if (value = attributes[:'validation_errors']).is_a?(Array) + self.validation_errors = value + end + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + end + + if attributes.key?(:'state_and_local_withholding') + self.state_and_local_withholding = attributes[:'state_and_local_withholding'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @id.nil? + invalid_properties.push('invalid value for "id", id cannot be nil.') + end + + if @id.to_s.length < 1 + invalid_properties.push('invalid value for "id", the character length must be great than or equal to 1.') + end + + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @type.to_s.length < 1 + invalid_properties.push('invalid value for "type", the character length must be great than or equal to 1.') + end + + if @issuer_id.nil? + invalid_properties.push('invalid value for "issuer_id", issuer_id cannot be nil.') + end + + if @federal_efile.nil? + invalid_properties.push('invalid value for "federal_efile", federal_efile cannot be nil.') + end + + if @state_efile.nil? + invalid_properties.push('invalid value for "state_efile", state_efile cannot be nil.') + end + + if @postal_mail.nil? + invalid_properties.push('invalid value for "postal_mail", postal_mail cannot be nil.') + end + + if @tin_match.nil? + invalid_properties.push('invalid value for "tin_match", tin_match cannot be nil.') + end + + if @address_verification.nil? + invalid_properties.push('invalid value for "address_verification", address_verification cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @id.nil? + return false if @id.to_s.length < 1 + return false if @type.nil? + return false if @type.to_s.length < 1 + return false if @issuer_id.nil? + return false if @federal_efile.nil? + return false if @state_efile.nil? + return false if @postal_mail.nil? + return false if @tin_match.nil? + return false if @address_verification.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + if id.to_s.length < 1 + fail ArgumentError, 'invalid value for "id", the character length must be great than or equal to 1.' + end + + @id = id + end + + # Custom attribute writer method with validation + # @param [Object] type Value to be assigned + def type=(type) + if type.nil? + fail ArgumentError, 'type cannot be nil' + end + + if type.to_s.length < 1 + fail ArgumentError, 'invalid value for "type", the character length must be great than or equal to 1.' + end + + @type = type + end + + # Custom attribute writer method with validation + # @param [Object] state_efile_status Value to be assigned + def state_efile_status=(state_efile_status) + @state_efile_status = state_efile_status + end + + # Custom attribute writer method with validation + # @param [Object] validation_errors Value to be assigned + def validation_errors=(validation_errors) + @validation_errors = validation_errors + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + nonemployee_compensation == o.nonemployee_compensation && + federal_income_tax_withheld == o.federal_income_tax_withheld && + direct_sales_indicator == o.direct_sales_indicator && + id == o.id && + type == o.type && + issuer_id == o.issuer_id && + issuer_reference_id == o.issuer_reference_id && + issuer_tin == o.issuer_tin && + tax_year == o.tax_year && + federal_efile == o.federal_efile && + federal_efile_status == o.federal_efile_status && + state_efile == o.state_efile && + state_efile_status == o.state_efile_status && + postal_mail == o.postal_mail && + postal_mail_status == o.postal_mail_status && + tin_match == o.tin_match && + tin_match_status == o.tin_match_status && + address_verification == o.address_verification && + address_verification_status == o.address_verification_status && + reference_id == o.reference_id && + email == o.email && + tin_type == o.tin_type && + tin == o.tin && + recipient_name == o.recipient_name && + recipient_second_name == o.recipient_second_name && + address == o.address && + address2 == o.address2 && + city == o.city && + state == o.state && + zip == o.zip && + foreign_province == o.foreign_province && + country_code == o.country_code && + validation_errors == o.validation_errors && + created_at == o.created_at && + updated_at == o.updated_at && + state_and_local_withholding == o.state_and_local_withholding + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [nonemployee_compensation, federal_income_tax_withheld, direct_sales_indicator, id, type, issuer_id, issuer_reference_id, issuer_tin, tax_year, federal_efile, federal_efile_status, state_efile, state_efile_status, postal_mail, postal_mail_status, tin_match, tin_match_status, address_verification, address_verification_status, reference_id, email, tin_type, tin, recipient_name, recipient_second_name, address, address2, city, state, zip, foreign_province, country_code, validation_errors, created_at, updated_at, state_and_local_withholding].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::A1099::V2.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/A1099/V2/form1099_nec_request.rb b/lib/avalara_sdk/models/A1099/V2/form1099_nec_request.rb index 064733a..5215fdf 100644 --- a/lib/avalara_sdk/models/A1099/V2/form1099_nec_request.rb +++ b/lib/avalara_sdk/models/A1099/V2/form1099_nec_request.rb @@ -1,7 +1,7 @@ =begin #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) =end @@ -11,58 +11,84 @@ module AvalaraSdk::A1099::V2 class Form1099NecRequest + # Second TIN notice attr_accessor :second_tin_notice + # Nonemployee compensation attr_accessor :nonemployee_compensation - attr_accessor :payer_made_direct_sales + # Payer made direct sales totaling $5,000 or more of consumer products to recipient for resale + attr_accessor :direct_sales_indicator + # Federal income tax withheld attr_accessor :federal_income_tax_withheld attr_accessor :type + # Issuer ID attr_accessor :issuer_id + # Reference ID attr_accessor :reference_id - attr_accessor :recipient_name - + # Recipient Tax ID Number attr_accessor :recipient_tin + # Recipient name + attr_accessor :recipient_name + + # Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN attr_accessor :tin_type + # Recipient second name attr_accessor :recipient_second_name + # Address attr_accessor :address + # Address line 2 attr_accessor :address2 + # City attr_accessor :city + # US state. Required if CountryCode is \"US\". attr_accessor :state + # Zip/postal code attr_accessor :zip + # Recipient email address attr_accessor :recipient_email + # Account number attr_accessor :account_number + # Office code attr_accessor :office_code + # Foreign province attr_accessor :recipient_non_us_province + # Country code, as defined at https://www.irs.gov/e-file-providers/country-codes attr_accessor :country_code + # Boolean indicating that federal e-filing should be scheduled for this form attr_accessor :federal_e_file + # Boolean indicating that postal mailing to the recipient should be scheduled for this form attr_accessor :postal_mail + # Boolean indicating that state e-filing should be scheduled for this form attr_accessor :state_e_file + # Boolean indicating that TIN Matching should be scheduled for this form attr_accessor :tin_match + # Boolean indicating that address verification should be scheduled for this form attr_accessor :address_verification + # State and local withholding information attr_accessor :state_and_local_withholding class EnumAttributeValidator @@ -92,13 +118,13 @@ def self.attribute_map { :'second_tin_notice' => :'secondTinNotice', :'nonemployee_compensation' => :'nonemployeeCompensation', - :'payer_made_direct_sales' => :'payerMadeDirectSales', + :'direct_sales_indicator' => :'directSalesIndicator', :'federal_income_tax_withheld' => :'federalIncomeTaxWithheld', :'type' => :'type', :'issuer_id' => :'issuerId', :'reference_id' => :'referenceId', - :'recipient_name' => :'recipientName', :'recipient_tin' => :'recipientTin', + :'recipient_name' => :'recipientName', :'tin_type' => :'tinType', :'recipient_second_name' => :'recipientSecondName', :'address' => :'address', @@ -130,13 +156,13 @@ def self.openapi_types { :'second_tin_notice' => :'Boolean', :'nonemployee_compensation' => :'Float', - :'payer_made_direct_sales' => :'Boolean', + :'direct_sales_indicator' => :'Boolean', :'federal_income_tax_withheld' => :'Float', :'type' => :'String', :'issuer_id' => :'String', :'reference_id' => :'String', - :'recipient_name' => :'String', :'recipient_tin' => :'String', + :'recipient_name' => :'String', :'tin_type' => :'String', :'recipient_second_name' => :'String', :'address' => :'String', @@ -163,7 +189,7 @@ def self.openapi_nullable Set.new([ :'issuer_id', :'reference_id', - :'recipient_name', + :'recipient_second_name', :'address2', :'recipient_email', :'account_number', @@ -200,10 +226,12 @@ def initialize(attributes = {}) if attributes.key?(:'nonemployee_compensation') self.nonemployee_compensation = attributes[:'nonemployee_compensation'] + else + self.nonemployee_compensation = nil end - if attributes.key?(:'payer_made_direct_sales') - self.payer_made_direct_sales = attributes[:'payer_made_direct_sales'] + if attributes.key?(:'direct_sales_indicator') + self.direct_sales_indicator = attributes[:'direct_sales_indicator'] end if attributes.key?(:'federal_income_tax_withheld') @@ -222,14 +250,16 @@ def initialize(attributes = {}) self.reference_id = attributes[:'reference_id'] end - if attributes.key?(:'recipient_name') - self.recipient_name = attributes[:'recipient_name'] - end - if attributes.key?(:'recipient_tin') self.recipient_tin = attributes[:'recipient_tin'] end + if attributes.key?(:'recipient_name') + self.recipient_name = attributes[:'recipient_name'] + else + self.recipient_name = nil + end + if attributes.key?(:'tin_type') self.tin_type = attributes[:'tin_type'] end @@ -240,6 +270,8 @@ def initialize(attributes = {}) if attributes.key?(:'address') self.address = attributes[:'address'] + else + self.address = nil end if attributes.key?(:'address2') @@ -248,6 +280,8 @@ def initialize(attributes = {}) if attributes.key?(:'city') self.city = attributes[:'city'] + else + self.city = nil end if attributes.key?(:'state') @@ -276,6 +310,8 @@ def initialize(attributes = {}) if attributes.key?(:'country_code') self.country_code = attributes[:'country_code'] + else + self.country_code = nil end if attributes.key?(:'federal_e_file') @@ -308,6 +344,42 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @nonemployee_compensation.nil? + invalid_properties.push('invalid value for "nonemployee_compensation", nonemployee_compensation cannot be nil.') + end + + if @recipient_name.nil? + invalid_properties.push('invalid value for "recipient_name", recipient_name cannot be nil.') + end + + if @recipient_name.to_s.length < 1 + invalid_properties.push('invalid value for "recipient_name", the character length must be great than or equal to 1.') + end + + if @address.nil? + invalid_properties.push('invalid value for "address", address cannot be nil.') + end + + if @address.to_s.length < 1 + invalid_properties.push('invalid value for "address", the character length must be great than or equal to 1.') + end + + if @city.nil? + invalid_properties.push('invalid value for "city", city cannot be nil.') + end + + if @city.to_s.length < 1 + invalid_properties.push('invalid value for "city", the character length must be great than or equal to 1.') + end + + if @country_code.nil? + invalid_properties.push('invalid value for "country_code", country_code cannot be nil.') + end + + if @country_code.to_s.length < 1 + invalid_properties.push('invalid value for "country_code", the character length must be great than or equal to 1.') + end + invalid_properties end @@ -315,23 +387,46 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - type_validator = EnumAttributeValidator.new('String', ["Form1099Nec", "Form1099Misc", "Form1099Div", "Form1099R", "Form1099K", "Form1095B"]) + return false if @nonemployee_compensation.nil? + type_validator = EnumAttributeValidator.new('String', ["1099-NEC", "1099-MISC", "1099-DIV", "1099-R", "1099-K", "1095-B", "1042-S"]) return false unless type_validator.valid?(@type) + return false if @recipient_name.nil? + return false if @recipient_name.to_s.length < 1 tin_type_validator = EnumAttributeValidator.new('String', ["EIN", "SSN", "ITIN", "ATIN"]) return false unless tin_type_validator.valid?(@tin_type) + return false if @address.nil? + return false if @address.to_s.length < 1 + return false if @city.nil? + return false if @city.to_s.length < 1 + return false if @country_code.nil? + return false if @country_code.to_s.length < 1 true end # Custom attribute writer method checking allowed values (enum). # @param [Object] type Object to be assigned def type=(type) - validator = EnumAttributeValidator.new('String', ["Form1099Nec", "Form1099Misc", "Form1099Div", "Form1099R", "Form1099K", "Form1095B"]) + validator = EnumAttributeValidator.new('String', ["1099-NEC", "1099-MISC", "1099-DIV", "1099-R", "1099-K", "1095-B", "1042-S"]) unless validator.valid?(type) fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." end @type = type end + # Custom attribute writer method with validation + # @param [Object] recipient_name Value to be assigned + def recipient_name=(recipient_name) + if recipient_name.nil? + fail ArgumentError, 'recipient_name cannot be nil' + end + + if recipient_name.to_s.length < 1 + fail ArgumentError, 'invalid value for "recipient_name", the character length must be great than or equal to 1.' + end + + @recipient_name = recipient_name + end + # Custom attribute writer method checking allowed values (enum). # @param [Object] tin_type Object to be assigned def tin_type=(tin_type) @@ -342,6 +437,48 @@ def tin_type=(tin_type) @tin_type = tin_type end + # Custom attribute writer method with validation + # @param [Object] address Value to be assigned + def address=(address) + if address.nil? + fail ArgumentError, 'address cannot be nil' + end + + if address.to_s.length < 1 + fail ArgumentError, 'invalid value for "address", the character length must be great than or equal to 1.' + end + + @address = address + end + + # Custom attribute writer method with validation + # @param [Object] city Value to be assigned + def city=(city) + if city.nil? + fail ArgumentError, 'city cannot be nil' + end + + if city.to_s.length < 1 + fail ArgumentError, 'invalid value for "city", the character length must be great than or equal to 1.' + end + + @city = city + end + + # Custom attribute writer method with validation + # @param [Object] country_code Value to be assigned + def country_code=(country_code) + if country_code.nil? + fail ArgumentError, 'country_code cannot be nil' + end + + if country_code.to_s.length < 1 + fail ArgumentError, 'invalid value for "country_code", the character length must be great than or equal to 1.' + end + + @country_code = country_code + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -349,13 +486,13 @@ def ==(o) self.class == o.class && second_tin_notice == o.second_tin_notice && nonemployee_compensation == o.nonemployee_compensation && - payer_made_direct_sales == o.payer_made_direct_sales && + direct_sales_indicator == o.direct_sales_indicator && federal_income_tax_withheld == o.federal_income_tax_withheld && type == o.type && issuer_id == o.issuer_id && reference_id == o.reference_id && - recipient_name == o.recipient_name && recipient_tin == o.recipient_tin && + recipient_name == o.recipient_name && tin_type == o.tin_type && recipient_second_name == o.recipient_second_name && address == o.address && @@ -385,7 +522,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [second_tin_notice, nonemployee_compensation, payer_made_direct_sales, federal_income_tax_withheld, type, issuer_id, reference_id, recipient_name, recipient_tin, tin_type, recipient_second_name, address, address2, city, state, zip, recipient_email, account_number, office_code, recipient_non_us_province, country_code, federal_e_file, postal_mail, state_e_file, tin_match, address_verification, state_and_local_withholding].hash + [second_tin_notice, nonemployee_compensation, direct_sales_indicator, federal_income_tax_withheld, type, issuer_id, reference_id, recipient_tin, recipient_name, tin_type, recipient_second_name, address, address2, city, state, zip, recipient_email, account_number, office_code, recipient_non_us_province, country_code, federal_e_file, postal_mail, state_e_file, tin_match, address_verification, state_and_local_withholding].hash end # Builds the object from hash diff --git a/lib/avalara_sdk/models/A1099/V2/form1099_nec_response.rb b/lib/avalara_sdk/models/A1099/V2/form1099_nec_response.rb index f11d84e..b37be12 100644 --- a/lib/avalara_sdk/models/A1099/V2/form1099_nec_response.rb +++ b/lib/avalara_sdk/models/A1099/V2/form1099_nec_response.rb @@ -1,7 +1,7 @@ =begin #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) =end @@ -15,7 +15,7 @@ class Form1099NecResponse attr_accessor :nonemployee_compensation - attr_accessor :payer_made_direct_sales + attr_accessor :direct_sales_indicator attr_accessor :federal_income_tax_withheld @@ -118,7 +118,7 @@ def self.attribute_map { :'second_tin_notice' => :'secondTinNotice', :'nonemployee_compensation' => :'nonemployeeCompensation', - :'payer_made_direct_sales' => :'payerMadeDirectSales', + :'direct_sales_indicator' => :'directSalesIndicator', :'federal_income_tax_withheld' => :'federalIncomeTaxWithheld', :'type' => :'type', :'created_at' => :'createdAt', @@ -169,7 +169,7 @@ def self.openapi_types { :'second_tin_notice' => :'Boolean', :'nonemployee_compensation' => :'Float', - :'payer_made_direct_sales' => :'Boolean', + :'direct_sales_indicator' => :'Boolean', :'federal_income_tax_withheld' => :'Float', :'type' => :'String', :'created_at' => :'Time', @@ -202,11 +202,11 @@ def self.openapi_types :'tin_match' => :'Boolean', :'address_verification' => :'Boolean', :'federal_efile_status' => :'StatusDetail', - :'state_efile_status' => :'Array', + :'state_efile_status' => :'Array', :'postal_mail_status' => :'StatusDetail', :'tin_match_status' => :'StatusDetail', :'address_verification_status' => :'StatusDetail', - :'validation_errors' => :'Array' + :'validation_errors' => :'Array' } end @@ -252,8 +252,8 @@ def initialize(attributes = {}) self.nonemployee_compensation = attributes[:'nonemployee_compensation'] end - if attributes.key?(:'payer_made_direct_sales') - self.payer_made_direct_sales = attributes[:'payer_made_direct_sales'] + if attributes.key?(:'direct_sales_indicator') + self.direct_sales_indicator = attributes[:'direct_sales_indicator'] end if attributes.key?(:'federal_income_tax_withheld') @@ -421,7 +421,7 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - type_validator = EnumAttributeValidator.new('String', ["Form1099Nec", "Form1099Misc", "Form1099Div", "Form1099R", "Form1099K", "Form1095B"]) + type_validator = EnumAttributeValidator.new('String', ["1099-NEC", "1099-MISC", "1099-DIV", "1099-R", "1099-K", "1095-B", "1042-S"]) return false unless type_validator.valid?(@type) tin_type_validator = EnumAttributeValidator.new('String', ["EIN", "SSN", "ITIN", "ATIN"]) return false unless tin_type_validator.valid?(@tin_type) @@ -431,7 +431,7 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] type Object to be assigned def type=(type) - validator = EnumAttributeValidator.new('String', ["Form1099Nec", "Form1099Misc", "Form1099Div", "Form1099R", "Form1099K", "Form1095B"]) + validator = EnumAttributeValidator.new('String', ["1099-NEC", "1099-MISC", "1099-DIV", "1099-R", "1099-K", "1095-B", "1042-S"]) unless validator.valid?(type) fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." end @@ -467,7 +467,7 @@ def ==(o) self.class == o.class && second_tin_notice == o.second_tin_notice && nonemployee_compensation == o.nonemployee_compensation && - payer_made_direct_sales == o.payer_made_direct_sales && + direct_sales_indicator == o.direct_sales_indicator && federal_income_tax_withheld == o.federal_income_tax_withheld && type == o.type && created_at == o.created_at && @@ -516,7 +516,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [second_tin_notice, nonemployee_compensation, payer_made_direct_sales, federal_income_tax_withheld, type, created_at, updated_at, user_id, state_and_local_withholding, tin_type, id, issuer_id, issuer_reference_id, issuer_tin, tax_year, reference_id, recipient_name, recipient_tin, recipient_second_name, address, address2, city, state, zip, recipient_email, account_number, office_code, recipient_non_us_province, country_code, federal_e_file, postal_mail, state_e_file, tin_match, address_verification, federal_efile_status, state_efile_status, postal_mail_status, tin_match_status, address_verification_status, validation_errors].hash + [second_tin_notice, nonemployee_compensation, direct_sales_indicator, federal_income_tax_withheld, type, created_at, updated_at, user_id, state_and_local_withholding, tin_type, id, issuer_id, issuer_reference_id, issuer_tin, tax_year, reference_id, recipient_name, recipient_tin, recipient_second_name, address, address2, city, state, zip, recipient_email, account_number, office_code, recipient_non_us_province, country_code, federal_e_file, postal_mail, state_e_file, tin_match, address_verification, federal_efile_status, state_efile_status, postal_mail_status, tin_match_status, address_verification_status, validation_errors].hash end # Builds the object from hash diff --git a/lib/avalara_sdk/models/A1099/V2/form1099_proccess_result.rb b/lib/avalara_sdk/models/A1099/V2/form1099_proccess_result.rb index 9ba21d7..4f02dac 100644 --- a/lib/avalara_sdk/models/A1099/V2/form1099_proccess_result.rb +++ b/lib/avalara_sdk/models/A1099/V2/form1099_proccess_result.rb @@ -1,7 +1,7 @@ =begin #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) =end diff --git a/lib/avalara_sdk/models/A1099/V2/form1099_r_list.rb b/lib/avalara_sdk/models/A1099/V2/form1099_r_list.rb index fa7aac5..77edc05 100644 --- a/lib/avalara_sdk/models/A1099/V2/form1099_r_list.rb +++ b/lib/avalara_sdk/models/A1099/V2/form1099_r_list.rb @@ -1,7 +1,7 @@ =begin #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) =end diff --git a/lib/avalara_sdk/models/A1099/V2/form1099_r_list_item.rb b/lib/avalara_sdk/models/A1099/V2/form1099_r_list_item.rb index ca23f20..c808fa5 100644 --- a/lib/avalara_sdk/models/A1099/V2/form1099_r_list_item.rb +++ b/lib/avalara_sdk/models/A1099/V2/form1099_r_list_item.rb @@ -1,7 +1,7 @@ =begin #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) =end @@ -11,94 +11,139 @@ module AvalaraSdk::A1099::V2 class Form1099RListItem + # Gross distribution attr_accessor :gross_distribution + # Taxable amount attr_accessor :taxable_amount + # Taxable amount not determined attr_accessor :taxable_amount_not_determined + # Total distribution attr_accessor :total_distribution_determined + # Capital gain (included in Box 2a) attr_accessor :capital_gain + # Federal income tax withheld attr_accessor :federal_income_tax_withheld + # Employee contributions/Designated Roth contributions or insurance premiums attr_accessor :employee_contributions_or_designated_roth_or_insurance_premiums + # Net unrealized appreciation in employer's securities attr_accessor :net_unrealized_appreciation_in_employer_securities + # Distribution code attr_accessor :distribution_code + # Second distribution code attr_accessor :second_distribution_code + # IRA/SEP/SIMPLE attr_accessor :ira_sep_simple + # Traditional IRA/SEP/SIMPLE or Roth conversion amount attr_accessor :traditional_ira_sep_simple_or_roth_conversion_amount + # Other amount attr_accessor :other_amount + # Other percentage attr_accessor :other_percentage + # Total distribution percentage attr_accessor :total_distribution_percentage + # Total employee contributions attr_accessor :total_employee_contributions + # Amount allocable to IRR within 5 years attr_accessor :amount_allocable_to_irr_within5_years + # First year of designated Roth contribution attr_accessor :first_year_of_designated_roth_contribution + # FATCA filing requirement attr_accessor :fatca_filing_requirement + # Date of payment attr_accessor :date_of_payment + # Issuer Reference ID. One of `issuerReferenceId` or `issuerTin` is required. attr_accessor :issuer_reference_id + # Issuer TIN. One of `issuerReferenceId` or `issuerTin` is required. attr_accessor :issuer_tin + # Tax year attr_accessor :tax_year + # Issuer ID attr_accessor :issuer_id + # Reference ID attr_accessor :reference_id - attr_accessor :recipient_name - + # Recipient Tax ID Number attr_accessor :recipient_tin + # Recipient name + attr_accessor :recipient_name + + # Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN attr_accessor :tin_type + # Recipient second name attr_accessor :recipient_second_name + # Address attr_accessor :address + # Address line 2 attr_accessor :address2 + # City attr_accessor :city + # US state. Required if CountryCode is \"US\". attr_accessor :state + # Zip/postal code attr_accessor :zip + # Recipient email address attr_accessor :recipient_email + # Account number attr_accessor :account_number + # Office code attr_accessor :office_code + # Foreign province attr_accessor :recipient_non_us_province + # Country code, as defined at https://www.irs.gov/e-file-providers/country-codes attr_accessor :country_code + # Boolean indicating that federal e-filing should be scheduled for this form attr_accessor :federal_e_file + # Boolean indicating that postal mailing to the recipient should be scheduled for this form attr_accessor :postal_mail + # Boolean indicating that state e-filing should be scheduled for this form attr_accessor :state_e_file + # Boolean indicating that TIN Matching should be scheduled for this form attr_accessor :tin_match + # Boolean indicating that address verification should be scheduled for this form attr_accessor :address_verification + # State and local withholding information attr_accessor :state_and_local_withholding class EnumAttributeValidator @@ -151,8 +196,8 @@ def self.attribute_map :'tax_year' => :'taxYear', :'issuer_id' => :'issuerId', :'reference_id' => :'referenceId', - :'recipient_name' => :'recipientName', :'recipient_tin' => :'recipientTin', + :'recipient_name' => :'recipientName', :'tin_type' => :'tinType', :'recipient_second_name' => :'recipientSecondName', :'address' => :'address', @@ -207,8 +252,8 @@ def self.openapi_types :'tax_year' => :'Integer', :'issuer_id' => :'String', :'reference_id' => :'String', - :'recipient_name' => :'String', :'recipient_tin' => :'String', + :'recipient_name' => :'String', :'tin_type' => :'String', :'recipient_second_name' => :'String', :'address' => :'String', @@ -236,7 +281,7 @@ def self.openapi_nullable :'second_distribution_code', :'issuer_id', :'reference_id', - :'recipient_name', + :'recipient_second_name', :'address2', :'recipient_email', :'account_number', @@ -248,7 +293,7 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'FormRequestCsvBase' + :'FormRequestListItemBase' ] end @@ -357,6 +402,8 @@ def initialize(attributes = {}) if attributes.key?(:'tax_year') self.tax_year = attributes[:'tax_year'] + else + self.tax_year = nil end if attributes.key?(:'issuer_id') @@ -367,14 +414,16 @@ def initialize(attributes = {}) self.reference_id = attributes[:'reference_id'] end - if attributes.key?(:'recipient_name') - self.recipient_name = attributes[:'recipient_name'] - end - if attributes.key?(:'recipient_tin') self.recipient_tin = attributes[:'recipient_tin'] end + if attributes.key?(:'recipient_name') + self.recipient_name = attributes[:'recipient_name'] + else + self.recipient_name = nil + end + if attributes.key?(:'tin_type') self.tin_type = attributes[:'tin_type'] end @@ -385,6 +434,8 @@ def initialize(attributes = {}) if attributes.key?(:'address') self.address = attributes[:'address'] + else + self.address = nil end if attributes.key?(:'address2') @@ -393,6 +444,8 @@ def initialize(attributes = {}) if attributes.key?(:'city') self.city = attributes[:'city'] + else + self.city = nil end if attributes.key?(:'state') @@ -421,6 +474,8 @@ def initialize(attributes = {}) if attributes.key?(:'country_code') self.country_code = attributes[:'country_code'] + else + self.country_code = nil end if attributes.key?(:'federal_e_file') @@ -453,6 +508,42 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @tax_year.nil? + invalid_properties.push('invalid value for "tax_year", tax_year cannot be nil.') + end + + if @recipient_name.nil? + invalid_properties.push('invalid value for "recipient_name", recipient_name cannot be nil.') + end + + if @recipient_name.to_s.length < 1 + invalid_properties.push('invalid value for "recipient_name", the character length must be great than or equal to 1.') + end + + if @address.nil? + invalid_properties.push('invalid value for "address", address cannot be nil.') + end + + if @address.to_s.length < 1 + invalid_properties.push('invalid value for "address", the character length must be great than or equal to 1.') + end + + if @city.nil? + invalid_properties.push('invalid value for "city", city cannot be nil.') + end + + if @city.to_s.length < 1 + invalid_properties.push('invalid value for "city", the character length must be great than or equal to 1.') + end + + if @country_code.nil? + invalid_properties.push('invalid value for "country_code", country_code cannot be nil.') + end + + if @country_code.to_s.length < 1 + invalid_properties.push('invalid value for "country_code", the character length must be great than or equal to 1.') + end + invalid_properties end @@ -460,19 +551,28 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - distribution_code_validator = EnumAttributeValidator.new('String', ["EarlyDistributionNoException", "EarlyDistributionWithException", "Disability", "Death", "ProhibitedTransaction", "Section1035Exchange", "NormalDistribution", "ExcessContributionsCurrentYear", "CurrentLifeInsuranceProtectionCost", "TenYearTaxOption", "DesignatedRothDistribution", "ReportableDeathBenefits", "NonqualifiedAnnuityPayments", "EPCRSDistribution", "CharitableGiftAnnuity", "DirectRollover", "RothAccountToIRADirectRollover", "EarlyRothIRADistribution", "IRAAssetsNoFMV", "LoansDeemedDistributions", "QualifiedPlanLoanOffsets", "RecharacterizedIRANextYear", "ExcessContributionsPreviousYear", "QualifiedRothIRADistribution", "RecharacterizedIRAPreviousYear", "EarlySimpleIRADistribution", "RothIRADistributionException", "ESOPDistribution", "LongTermCareInsurance"]) + distribution_code_validator = EnumAttributeValidator.new('String', ["1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "J", "K", "L", "M", "N", "P", "Q", "R", "S", "T", "U", "W"]) return false unless distribution_code_validator.valid?(@distribution_code) second_distribution_code_validator = EnumAttributeValidator.new('String', ["EarlyDistributionNoException", "EarlyDistributionWithException", "Disability", "Death", "ProhibitedTransaction", "Section1035Exchange", "NormalDistribution", "ExcessContributionsCurrentYear", "CurrentLifeInsuranceProtectionCost", "TenYearTaxOption", "DesignatedRothDistribution", "ReportableDeathBenefits", "NonqualifiedAnnuityPayments", "EPCRSDistribution", "CharitableGiftAnnuity", "DirectRollover", "RothAccountToIRADirectRollover", "EarlyRothIRADistribution", "IRAAssetsNoFMV", "LoansDeemedDistributions", "QualifiedPlanLoanOffsets", "RecharacterizedIRANextYear", "ExcessContributionsPreviousYear", "QualifiedRothIRADistribution", "RecharacterizedIRAPreviousYear", "EarlySimpleIRADistribution", "RothIRADistributionException", "ESOPDistribution", "LongTermCareInsurance"]) return false unless second_distribution_code_validator.valid?(@second_distribution_code) + return false if @tax_year.nil? + return false if @recipient_name.nil? + return false if @recipient_name.to_s.length < 1 tin_type_validator = EnumAttributeValidator.new('String', ["EIN", "SSN", "ITIN", "ATIN"]) return false unless tin_type_validator.valid?(@tin_type) + return false if @address.nil? + return false if @address.to_s.length < 1 + return false if @city.nil? + return false if @city.to_s.length < 1 + return false if @country_code.nil? + return false if @country_code.to_s.length < 1 true end # Custom attribute writer method checking allowed values (enum). # @param [Object] distribution_code Object to be assigned def distribution_code=(distribution_code) - validator = EnumAttributeValidator.new('String', ["EarlyDistributionNoException", "EarlyDistributionWithException", "Disability", "Death", "ProhibitedTransaction", "Section1035Exchange", "NormalDistribution", "ExcessContributionsCurrentYear", "CurrentLifeInsuranceProtectionCost", "TenYearTaxOption", "DesignatedRothDistribution", "ReportableDeathBenefits", "NonqualifiedAnnuityPayments", "EPCRSDistribution", "CharitableGiftAnnuity", "DirectRollover", "RothAccountToIRADirectRollover", "EarlyRothIRADistribution", "IRAAssetsNoFMV", "LoansDeemedDistributions", "QualifiedPlanLoanOffsets", "RecharacterizedIRANextYear", "ExcessContributionsPreviousYear", "QualifiedRothIRADistribution", "RecharacterizedIRAPreviousYear", "EarlySimpleIRADistribution", "RothIRADistributionException", "ESOPDistribution", "LongTermCareInsurance"]) + validator = EnumAttributeValidator.new('String', ["1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "J", "K", "L", "M", "N", "P", "Q", "R", "S", "T", "U", "W"]) unless validator.valid?(distribution_code) fail ArgumentError, "invalid value for \"distribution_code\", must be one of #{validator.allowable_values}." end @@ -489,6 +589,20 @@ def second_distribution_code=(second_distribution_code) @second_distribution_code = second_distribution_code end + # Custom attribute writer method with validation + # @param [Object] recipient_name Value to be assigned + def recipient_name=(recipient_name) + if recipient_name.nil? + fail ArgumentError, 'recipient_name cannot be nil' + end + + if recipient_name.to_s.length < 1 + fail ArgumentError, 'invalid value for "recipient_name", the character length must be great than or equal to 1.' + end + + @recipient_name = recipient_name + end + # Custom attribute writer method checking allowed values (enum). # @param [Object] tin_type Object to be assigned def tin_type=(tin_type) @@ -499,6 +613,48 @@ def tin_type=(tin_type) @tin_type = tin_type end + # Custom attribute writer method with validation + # @param [Object] address Value to be assigned + def address=(address) + if address.nil? + fail ArgumentError, 'address cannot be nil' + end + + if address.to_s.length < 1 + fail ArgumentError, 'invalid value for "address", the character length must be great than or equal to 1.' + end + + @address = address + end + + # Custom attribute writer method with validation + # @param [Object] city Value to be assigned + def city=(city) + if city.nil? + fail ArgumentError, 'city cannot be nil' + end + + if city.to_s.length < 1 + fail ArgumentError, 'invalid value for "city", the character length must be great than or equal to 1.' + end + + @city = city + end + + # Custom attribute writer method with validation + # @param [Object] country_code Value to be assigned + def country_code=(country_code) + if country_code.nil? + fail ArgumentError, 'country_code cannot be nil' + end + + if country_code.to_s.length < 1 + fail ArgumentError, 'invalid value for "country_code", the character length must be great than or equal to 1.' + end + + @country_code = country_code + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -529,8 +685,8 @@ def ==(o) tax_year == o.tax_year && issuer_id == o.issuer_id && reference_id == o.reference_id && - recipient_name == o.recipient_name && recipient_tin == o.recipient_tin && + recipient_name == o.recipient_name && tin_type == o.tin_type && recipient_second_name == o.recipient_second_name && address == o.address && @@ -560,7 +716,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [gross_distribution, taxable_amount, taxable_amount_not_determined, total_distribution_determined, capital_gain, federal_income_tax_withheld, employee_contributions_or_designated_roth_or_insurance_premiums, net_unrealized_appreciation_in_employer_securities, distribution_code, second_distribution_code, ira_sep_simple, traditional_ira_sep_simple_or_roth_conversion_amount, other_amount, other_percentage, total_distribution_percentage, total_employee_contributions, amount_allocable_to_irr_within5_years, first_year_of_designated_roth_contribution, fatca_filing_requirement, date_of_payment, issuer_reference_id, issuer_tin, tax_year, issuer_id, reference_id, recipient_name, recipient_tin, tin_type, recipient_second_name, address, address2, city, state, zip, recipient_email, account_number, office_code, recipient_non_us_province, country_code, federal_e_file, postal_mail, state_e_file, tin_match, address_verification, state_and_local_withholding].hash + [gross_distribution, taxable_amount, taxable_amount_not_determined, total_distribution_determined, capital_gain, federal_income_tax_withheld, employee_contributions_or_designated_roth_or_insurance_premiums, net_unrealized_appreciation_in_employer_securities, distribution_code, second_distribution_code, ira_sep_simple, traditional_ira_sep_simple_or_roth_conversion_amount, other_amount, other_percentage, total_distribution_percentage, total_employee_contributions, amount_allocable_to_irr_within5_years, first_year_of_designated_roth_contribution, fatca_filing_requirement, date_of_payment, issuer_reference_id, issuer_tin, tax_year, issuer_id, reference_id, recipient_tin, recipient_name, tin_type, recipient_second_name, address, address2, city, state, zip, recipient_email, account_number, office_code, recipient_non_us_province, country_code, federal_e_file, postal_mail, state_e_file, tin_match, address_verification, state_and_local_withholding].hash end # Builds the object from hash diff --git a/lib/avalara_sdk/models/A1099/V2/form1099_r_list_item_response.rb b/lib/avalara_sdk/models/A1099/V2/form1099_r_list_item_response.rb new file mode 100644 index 0000000..626bd72 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/form1099_r_list_item_response.rb @@ -0,0 +1,888 @@ +=begin +#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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class Form1099RListItemResponse + # Gross distribution + attr_accessor :gross_distributions + + # Taxable amount + attr_accessor :taxable_amount + + # Taxable amount not determined + attr_accessor :taxable_amount_not_determined + + # Total distribution + attr_accessor :total_distribution_indicator + + # Capital gain (included in Box 2a) + attr_accessor :capital_gain + + # Federal income tax withheld + attr_accessor :fed_income_tax_withheld + + # Employee contributions/Designated Roth contributions or insurance premiums + attr_accessor :employee_contributions + + # Net unrealized appreciation in employer's securities + attr_accessor :net_unrealized_appreciation + + # Distribution code + attr_accessor :distribution_code_required + + # Second distribution code + attr_accessor :distribution_code_optional + + # IRA/SEP/SIMPLE + attr_accessor :ira_sep_simple_indicator + + # Traditional IRA/SEP/SIMPLE or Roth conversion amount + attr_accessor :total_ira_sep_simple_distribution + + # Other amount + attr_accessor :other + + # Other percentage + attr_accessor :other_percent + + # Total distribution percentage + attr_accessor :percentage_total_distribution + + # Total employee contributions + attr_accessor :total_employee_contributions + + # Amount allocable to IRR within 5 years + attr_accessor :amount_allocable_to_irr + + # First year of designated Roth contribution + attr_accessor :first_year_designated_roth_contrib + + # FATCA filing requirement + attr_accessor :fatca_requirement_indicator + + # Date of payment + attr_accessor :date_of_payment + + # ID of the form + attr_accessor :id + + # 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 + attr_accessor :type + + # Issuer ID + attr_accessor :issuer_id + + # Issuer Reference ID + attr_accessor :issuer_reference_id + + # Issuer TIN + attr_accessor :issuer_tin + + # Tax year + attr_accessor :tax_year + + # Boolean indicating that federal e-filing has been scheduled for this form + attr_accessor :federal_efile + + # Federal e-file status + attr_accessor :federal_efile_status + + # Boolean indicating that state e-filing has been scheduled for this form + attr_accessor :state_efile + + # State e-file status + attr_accessor :state_efile_status + + # Boolean indicating that postal mailing to the recipient has been scheduled for this form + attr_accessor :postal_mail + + # Postal mail to recipient status + attr_accessor :postal_mail_status + + # Boolean indicating that TIN Matching has been scheduled for this form + attr_accessor :tin_match + + # TIN Match status + attr_accessor :tin_match_status + + # Boolean indicating that address verification has been scheduled for this form + attr_accessor :address_verification + + # Address verification status + attr_accessor :address_verification_status + + # Reference ID + attr_accessor :reference_id + + # Recipient email address + attr_accessor :email + + # Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN + attr_accessor :tin_type + + # Recipient Tax ID Number + attr_accessor :tin + + # Recipient name + attr_accessor :recipient_name + + # Recipient second name + attr_accessor :recipient_second_name + + # Address + attr_accessor :address + + # Address line 2 + attr_accessor :address2 + + # City + attr_accessor :city + + # US state + attr_accessor :state + + # Zip/postal code + attr_accessor :zip + + # Foreign province + attr_accessor :foreign_province + + # Country code, as defined at https://www.irs.gov/e-file-providers/country-codes + attr_accessor :country_code + + # Validation errors + attr_accessor :validation_errors + + # Creation time + attr_accessor :created_at + + # Update time + attr_accessor :updated_at + + attr_accessor :state_and_local_withholding + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'gross_distributions' => :'grossDistributions', + :'taxable_amount' => :'taxableAmount', + :'taxable_amount_not_determined' => :'taxableAmountNotDetermined', + :'total_distribution_indicator' => :'totalDistributionIndicator', + :'capital_gain' => :'capitalGain', + :'fed_income_tax_withheld' => :'fedIncomeTaxWithheld', + :'employee_contributions' => :'employeeContributions', + :'net_unrealized_appreciation' => :'netUnrealizedAppreciation', + :'distribution_code_required' => :'distributionCodeRequired', + :'distribution_code_optional' => :'distributionCodeOptional', + :'ira_sep_simple_indicator' => :'iraSepSimpleIndicator', + :'total_ira_sep_simple_distribution' => :'totalIraSepSimpleDistribution', + :'other' => :'other', + :'other_percent' => :'otherPercent', + :'percentage_total_distribution' => :'percentageTotalDistribution', + :'total_employee_contributions' => :'totalEmployeeContributions', + :'amount_allocable_to_irr' => :'amountAllocableToIrr', + :'first_year_designated_roth_contrib' => :'firstYearDesignatedRothContrib', + :'fatca_requirement_indicator' => :'fatcaRequirementIndicator', + :'date_of_payment' => :'dateOfPayment', + :'id' => :'id', + :'type' => :'type', + :'issuer_id' => :'issuerId', + :'issuer_reference_id' => :'issuerReferenceId', + :'issuer_tin' => :'issuerTin', + :'tax_year' => :'taxYear', + :'federal_efile' => :'federalEfile', + :'federal_efile_status' => :'federalEfileStatus', + :'state_efile' => :'stateEfile', + :'state_efile_status' => :'stateEfileStatus', + :'postal_mail' => :'postalMail', + :'postal_mail_status' => :'postalMailStatus', + :'tin_match' => :'tinMatch', + :'tin_match_status' => :'tinMatchStatus', + :'address_verification' => :'addressVerification', + :'address_verification_status' => :'addressVerificationStatus', + :'reference_id' => :'referenceId', + :'email' => :'email', + :'tin_type' => :'tinType', + :'tin' => :'tin', + :'recipient_name' => :'recipientName', + :'recipient_second_name' => :'recipientSecondName', + :'address' => :'address', + :'address2' => :'address2', + :'city' => :'city', + :'state' => :'state', + :'zip' => :'zip', + :'foreign_province' => :'foreignProvince', + :'country_code' => :'countryCode', + :'validation_errors' => :'validationErrors', + :'created_at' => :'createdAt', + :'updated_at' => :'updatedAt', + :'state_and_local_withholding' => :'stateAndLocalWithholding' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'gross_distributions' => :'Float', + :'taxable_amount' => :'Float', + :'taxable_amount_not_determined' => :'Boolean', + :'total_distribution_indicator' => :'Boolean', + :'capital_gain' => :'Float', + :'fed_income_tax_withheld' => :'Float', + :'employee_contributions' => :'Float', + :'net_unrealized_appreciation' => :'Float', + :'distribution_code_required' => :'String', + :'distribution_code_optional' => :'String', + :'ira_sep_simple_indicator' => :'Boolean', + :'total_ira_sep_simple_distribution' => :'Float', + :'other' => :'Float', + :'other_percent' => :'String', + :'percentage_total_distribution' => :'String', + :'total_employee_contributions' => :'Float', + :'amount_allocable_to_irr' => :'Float', + :'first_year_designated_roth_contrib' => :'String', + :'fatca_requirement_indicator' => :'Boolean', + :'date_of_payment' => :'String', + :'id' => :'String', + :'type' => :'String', + :'issuer_id' => :'Integer', + :'issuer_reference_id' => :'String', + :'issuer_tin' => :'String', + :'tax_year' => :'Integer', + :'federal_efile' => :'Boolean', + :'federal_efile_status' => :'Form1099StatusDetailResponse', + :'state_efile' => :'Boolean', + :'state_efile_status' => :'Array', + :'postal_mail' => :'Boolean', + :'postal_mail_status' => :'Form1099StatusDetailResponse', + :'tin_match' => :'Boolean', + :'tin_match_status' => :'Form1099StatusDetailResponse', + :'address_verification' => :'Boolean', + :'address_verification_status' => :'Form1099StatusDetailResponse', + :'reference_id' => :'String', + :'email' => :'String', + :'tin_type' => :'String', + :'tin' => :'String', + :'recipient_name' => :'String', + :'recipient_second_name' => :'String', + :'address' => :'String', + :'address2' => :'String', + :'city' => :'String', + :'state' => :'String', + :'zip' => :'String', + :'foreign_province' => :'String', + :'country_code' => :'String', + :'validation_errors' => :'Array', + :'created_at' => :'Time', + :'updated_at' => :'Time', + :'state_and_local_withholding' => :'StateAndLocalWithholdingResponse' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'gross_distributions', + :'taxable_amount', + :'taxable_amount_not_determined', + :'total_distribution_indicator', + :'capital_gain', + :'fed_income_tax_withheld', + :'employee_contributions', + :'net_unrealized_appreciation', + :'distribution_code_required', + :'distribution_code_optional', + :'ira_sep_simple_indicator', + :'total_ira_sep_simple_distribution', + :'other', + :'other_percent', + :'percentage_total_distribution', + :'total_employee_contributions', + :'amount_allocable_to_irr', + :'first_year_designated_roth_contrib', + :'fatca_requirement_indicator', + :'date_of_payment', + :'issuer_reference_id', + :'issuer_tin', + :'state_efile_status', + :'postal_mail_status', + :'tin_match_status', + :'address_verification_status', + :'reference_id', + :'email', + :'tin_type', + :'tin', + :'recipient_name', + :'recipient_second_name', + :'address', + :'address2', + :'city', + :'state', + :'zip', + :'foreign_province', + :'country_code', + :'validation_errors', + :'state_and_local_withholding' + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'Form1099BaseResponse' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::A1099::V2::Form1099RListItemResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::A1099::V2::Form1099RListItemResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'gross_distributions') + self.gross_distributions = attributes[:'gross_distributions'] + end + + if attributes.key?(:'taxable_amount') + self.taxable_amount = attributes[:'taxable_amount'] + end + + if attributes.key?(:'taxable_amount_not_determined') + self.taxable_amount_not_determined = attributes[:'taxable_amount_not_determined'] + end + + if attributes.key?(:'total_distribution_indicator') + self.total_distribution_indicator = attributes[:'total_distribution_indicator'] + end + + if attributes.key?(:'capital_gain') + self.capital_gain = attributes[:'capital_gain'] + end + + if attributes.key?(:'fed_income_tax_withheld') + self.fed_income_tax_withheld = attributes[:'fed_income_tax_withheld'] + end + + if attributes.key?(:'employee_contributions') + self.employee_contributions = attributes[:'employee_contributions'] + end + + if attributes.key?(:'net_unrealized_appreciation') + self.net_unrealized_appreciation = attributes[:'net_unrealized_appreciation'] + end + + if attributes.key?(:'distribution_code_required') + self.distribution_code_required = attributes[:'distribution_code_required'] + end + + if attributes.key?(:'distribution_code_optional') + self.distribution_code_optional = attributes[:'distribution_code_optional'] + end + + if attributes.key?(:'ira_sep_simple_indicator') + self.ira_sep_simple_indicator = attributes[:'ira_sep_simple_indicator'] + end + + if attributes.key?(:'total_ira_sep_simple_distribution') + self.total_ira_sep_simple_distribution = attributes[:'total_ira_sep_simple_distribution'] + end + + if attributes.key?(:'other') + self.other = attributes[:'other'] + end + + if attributes.key?(:'other_percent') + self.other_percent = attributes[:'other_percent'] + end + + if attributes.key?(:'percentage_total_distribution') + self.percentage_total_distribution = attributes[:'percentage_total_distribution'] + end + + if attributes.key?(:'total_employee_contributions') + self.total_employee_contributions = attributes[:'total_employee_contributions'] + end + + if attributes.key?(:'amount_allocable_to_irr') + self.amount_allocable_to_irr = attributes[:'amount_allocable_to_irr'] + end + + if attributes.key?(:'first_year_designated_roth_contrib') + self.first_year_designated_roth_contrib = attributes[:'first_year_designated_roth_contrib'] + end + + if attributes.key?(:'fatca_requirement_indicator') + self.fatca_requirement_indicator = attributes[:'fatca_requirement_indicator'] + end + + if attributes.key?(:'date_of_payment') + self.date_of_payment = attributes[:'date_of_payment'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + else + self.id = nil + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + else + self.type = nil + end + + if attributes.key?(:'issuer_id') + self.issuer_id = attributes[:'issuer_id'] + else + self.issuer_id = nil + end + + if attributes.key?(:'issuer_reference_id') + self.issuer_reference_id = attributes[:'issuer_reference_id'] + end + + if attributes.key?(:'issuer_tin') + self.issuer_tin = attributes[:'issuer_tin'] + end + + if attributes.key?(:'tax_year') + self.tax_year = attributes[:'tax_year'] + end + + if attributes.key?(:'federal_efile') + self.federal_efile = attributes[:'federal_efile'] + else + self.federal_efile = nil + end + + if attributes.key?(:'federal_efile_status') + self.federal_efile_status = attributes[:'federal_efile_status'] + end + + if attributes.key?(:'state_efile') + self.state_efile = attributes[:'state_efile'] + else + self.state_efile = nil + end + + if attributes.key?(:'state_efile_status') + if (value = attributes[:'state_efile_status']).is_a?(Array) + self.state_efile_status = value + end + end + + if attributes.key?(:'postal_mail') + self.postal_mail = attributes[:'postal_mail'] + else + self.postal_mail = nil + end + + if attributes.key?(:'postal_mail_status') + self.postal_mail_status = attributes[:'postal_mail_status'] + end + + if attributes.key?(:'tin_match') + self.tin_match = attributes[:'tin_match'] + else + self.tin_match = nil + end + + if attributes.key?(:'tin_match_status') + self.tin_match_status = attributes[:'tin_match_status'] + end + + if attributes.key?(:'address_verification') + self.address_verification = attributes[:'address_verification'] + else + self.address_verification = nil + end + + if attributes.key?(:'address_verification_status') + self.address_verification_status = attributes[:'address_verification_status'] + end + + if attributes.key?(:'reference_id') + self.reference_id = attributes[:'reference_id'] + end + + if attributes.key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.key?(:'tin_type') + self.tin_type = attributes[:'tin_type'] + end + + if attributes.key?(:'tin') + self.tin = attributes[:'tin'] + end + + if attributes.key?(:'recipient_name') + self.recipient_name = attributes[:'recipient_name'] + end + + if attributes.key?(:'recipient_second_name') + self.recipient_second_name = attributes[:'recipient_second_name'] + end + + if attributes.key?(:'address') + self.address = attributes[:'address'] + end + + if attributes.key?(:'address2') + self.address2 = attributes[:'address2'] + end + + if attributes.key?(:'city') + self.city = attributes[:'city'] + end + + if attributes.key?(:'state') + self.state = attributes[:'state'] + end + + if attributes.key?(:'zip') + self.zip = attributes[:'zip'] + end + + if attributes.key?(:'foreign_province') + self.foreign_province = attributes[:'foreign_province'] + end + + if attributes.key?(:'country_code') + self.country_code = attributes[:'country_code'] + end + + if attributes.key?(:'validation_errors') + if (value = attributes[:'validation_errors']).is_a?(Array) + self.validation_errors = value + end + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + end + + if attributes.key?(:'state_and_local_withholding') + self.state_and_local_withholding = attributes[:'state_and_local_withholding'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @id.nil? + invalid_properties.push('invalid value for "id", id cannot be nil.') + end + + if @id.to_s.length < 1 + invalid_properties.push('invalid value for "id", the character length must be great than or equal to 1.') + end + + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @type.to_s.length < 1 + invalid_properties.push('invalid value for "type", the character length must be great than or equal to 1.') + end + + if @issuer_id.nil? + invalid_properties.push('invalid value for "issuer_id", issuer_id cannot be nil.') + end + + if @federal_efile.nil? + invalid_properties.push('invalid value for "federal_efile", federal_efile cannot be nil.') + end + + if @state_efile.nil? + invalid_properties.push('invalid value for "state_efile", state_efile cannot be nil.') + end + + if @postal_mail.nil? + invalid_properties.push('invalid value for "postal_mail", postal_mail cannot be nil.') + end + + if @tin_match.nil? + invalid_properties.push('invalid value for "tin_match", tin_match cannot be nil.') + end + + if @address_verification.nil? + invalid_properties.push('invalid value for "address_verification", address_verification cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @id.nil? + return false if @id.to_s.length < 1 + return false if @type.nil? + return false if @type.to_s.length < 1 + return false if @issuer_id.nil? + return false if @federal_efile.nil? + return false if @state_efile.nil? + return false if @postal_mail.nil? + return false if @tin_match.nil? + return false if @address_verification.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] id Value to be assigned + def id=(id) + if id.nil? + fail ArgumentError, 'id cannot be nil' + end + + if id.to_s.length < 1 + fail ArgumentError, 'invalid value for "id", the character length must be great than or equal to 1.' + end + + @id = id + end + + # Custom attribute writer method with validation + # @param [Object] type Value to be assigned + def type=(type) + if type.nil? + fail ArgumentError, 'type cannot be nil' + end + + if type.to_s.length < 1 + fail ArgumentError, 'invalid value for "type", the character length must be great than or equal to 1.' + end + + @type = type + end + + # Custom attribute writer method with validation + # @param [Object] state_efile_status Value to be assigned + def state_efile_status=(state_efile_status) + @state_efile_status = state_efile_status + end + + # Custom attribute writer method with validation + # @param [Object] validation_errors Value to be assigned + def validation_errors=(validation_errors) + @validation_errors = validation_errors + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + gross_distributions == o.gross_distributions && + taxable_amount == o.taxable_amount && + taxable_amount_not_determined == o.taxable_amount_not_determined && + total_distribution_indicator == o.total_distribution_indicator && + capital_gain == o.capital_gain && + fed_income_tax_withheld == o.fed_income_tax_withheld && + employee_contributions == o.employee_contributions && + net_unrealized_appreciation == o.net_unrealized_appreciation && + distribution_code_required == o.distribution_code_required && + distribution_code_optional == o.distribution_code_optional && + ira_sep_simple_indicator == o.ira_sep_simple_indicator && + total_ira_sep_simple_distribution == o.total_ira_sep_simple_distribution && + other == o.other && + other_percent == o.other_percent && + percentage_total_distribution == o.percentage_total_distribution && + total_employee_contributions == o.total_employee_contributions && + amount_allocable_to_irr == o.amount_allocable_to_irr && + first_year_designated_roth_contrib == o.first_year_designated_roth_contrib && + fatca_requirement_indicator == o.fatca_requirement_indicator && + date_of_payment == o.date_of_payment && + id == o.id && + type == o.type && + issuer_id == o.issuer_id && + issuer_reference_id == o.issuer_reference_id && + issuer_tin == o.issuer_tin && + tax_year == o.tax_year && + federal_efile == o.federal_efile && + federal_efile_status == o.federal_efile_status && + state_efile == o.state_efile && + state_efile_status == o.state_efile_status && + postal_mail == o.postal_mail && + postal_mail_status == o.postal_mail_status && + tin_match == o.tin_match && + tin_match_status == o.tin_match_status && + address_verification == o.address_verification && + address_verification_status == o.address_verification_status && + reference_id == o.reference_id && + email == o.email && + tin_type == o.tin_type && + tin == o.tin && + recipient_name == o.recipient_name && + recipient_second_name == o.recipient_second_name && + address == o.address && + address2 == o.address2 && + city == o.city && + state == o.state && + zip == o.zip && + foreign_province == o.foreign_province && + country_code == o.country_code && + validation_errors == o.validation_errors && + created_at == o.created_at && + updated_at == o.updated_at && + state_and_local_withholding == o.state_and_local_withholding + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [gross_distributions, taxable_amount, taxable_amount_not_determined, total_distribution_indicator, capital_gain, fed_income_tax_withheld, employee_contributions, net_unrealized_appreciation, distribution_code_required, distribution_code_optional, ira_sep_simple_indicator, total_ira_sep_simple_distribution, other, other_percent, percentage_total_distribution, total_employee_contributions, amount_allocable_to_irr, first_year_designated_roth_contrib, fatca_requirement_indicator, date_of_payment, id, type, issuer_id, issuer_reference_id, issuer_tin, tax_year, federal_efile, federal_efile_status, state_efile, state_efile_status, postal_mail, postal_mail_status, tin_match, tin_match_status, address_verification, address_verification_status, reference_id, email, tin_type, tin, recipient_name, recipient_second_name, address, address2, city, state, zip, foreign_province, country_code, validation_errors, created_at, updated_at, state_and_local_withholding].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::A1099::V2.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/A1099/V2/form1099_r_request.rb b/lib/avalara_sdk/models/A1099/V2/form1099_r_request.rb index a02983b..5930ff2 100644 --- a/lib/avalara_sdk/models/A1099/V2/form1099_r_request.rb +++ b/lib/avalara_sdk/models/A1099/V2/form1099_r_request.rb @@ -1,7 +1,7 @@ =begin #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) =end @@ -11,90 +11,132 @@ module AvalaraSdk::A1099::V2 class Form1099RRequest + # Gross distribution attr_accessor :gross_distribution + # Taxable amount attr_accessor :taxable_amount + # Taxable amount not determined attr_accessor :taxable_amount_not_determined + # Total distribution attr_accessor :total_distribution_determined + # Capital gain (included in Box 2a) attr_accessor :capital_gain + # Federal income tax withheld attr_accessor :federal_income_tax_withheld + # Employee contributions/Designated Roth contributions or insurance premiums attr_accessor :employee_contributions_or_designated_roth_or_insurance_premiums + # Net unrealized appreciation in employer's securities attr_accessor :net_unrealized_appreciation_in_employer_securities + # Distribution code attr_accessor :distribution_code + # Second distribution code attr_accessor :second_distribution_code + # IRA/SEP/SIMPLE attr_accessor :ira_sep_simple + # Traditional IRA/SEP/SIMPLE or Roth conversion amount attr_accessor :traditional_ira_sep_simple_or_roth_conversion_amount + # Other amount attr_accessor :other_amount + # Other percentage attr_accessor :other_percentage + # Total distribution percentage attr_accessor :total_distribution_percentage + # Total employee contributions attr_accessor :total_employee_contributions + # Amount allocable to IRR within 5 years attr_accessor :amount_allocable_to_irr_within5_years + # First year of designated Roth contribution attr_accessor :first_year_of_designated_roth_contribution + # FATCA filing requirement attr_accessor :fatca_filing_requirement + # Date of payment attr_accessor :date_of_payment attr_accessor :type + # Issuer ID attr_accessor :issuer_id + # Reference ID attr_accessor :reference_id - attr_accessor :recipient_name - + # Recipient Tax ID Number attr_accessor :recipient_tin + # Recipient name + attr_accessor :recipient_name + + # Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN attr_accessor :tin_type + # Recipient second name attr_accessor :recipient_second_name + # Address attr_accessor :address + # Address line 2 attr_accessor :address2 + # City attr_accessor :city + # US state. Required if CountryCode is \"US\". attr_accessor :state + # Zip/postal code attr_accessor :zip + # Recipient email address attr_accessor :recipient_email + # Account number attr_accessor :account_number + # Office code attr_accessor :office_code + # Foreign province attr_accessor :recipient_non_us_province + # Country code, as defined at https://www.irs.gov/e-file-providers/country-codes attr_accessor :country_code + # Boolean indicating that federal e-filing should be scheduled for this form attr_accessor :federal_e_file + # Boolean indicating that postal mailing to the recipient should be scheduled for this form attr_accessor :postal_mail + # Boolean indicating that state e-filing should be scheduled for this form attr_accessor :state_e_file + # Boolean indicating that TIN Matching should be scheduled for this form attr_accessor :tin_match + # Boolean indicating that address verification should be scheduled for this form attr_accessor :address_verification + # State and local withholding information attr_accessor :state_and_local_withholding class EnumAttributeValidator @@ -145,8 +187,8 @@ def self.attribute_map :'type' => :'type', :'issuer_id' => :'issuerId', :'reference_id' => :'referenceId', - :'recipient_name' => :'recipientName', :'recipient_tin' => :'recipientTin', + :'recipient_name' => :'recipientName', :'tin_type' => :'tinType', :'recipient_second_name' => :'recipientSecondName', :'address' => :'address', @@ -199,8 +241,8 @@ def self.openapi_types :'type' => :'String', :'issuer_id' => :'String', :'reference_id' => :'String', - :'recipient_name' => :'String', :'recipient_tin' => :'String', + :'recipient_name' => :'String', :'tin_type' => :'String', :'recipient_second_name' => :'String', :'address' => :'String', @@ -227,7 +269,7 @@ def self.openapi_nullable Set.new([ :'issuer_id', :'reference_id', - :'recipient_name', + :'recipient_second_name', :'address2', :'recipient_email', :'account_number', @@ -350,14 +392,16 @@ def initialize(attributes = {}) self.reference_id = attributes[:'reference_id'] end - if attributes.key?(:'recipient_name') - self.recipient_name = attributes[:'recipient_name'] - end - if attributes.key?(:'recipient_tin') self.recipient_tin = attributes[:'recipient_tin'] end + if attributes.key?(:'recipient_name') + self.recipient_name = attributes[:'recipient_name'] + else + self.recipient_name = nil + end + if attributes.key?(:'tin_type') self.tin_type = attributes[:'tin_type'] end @@ -368,6 +412,8 @@ def initialize(attributes = {}) if attributes.key?(:'address') self.address = attributes[:'address'] + else + self.address = nil end if attributes.key?(:'address2') @@ -376,6 +422,8 @@ def initialize(attributes = {}) if attributes.key?(:'city') self.city = attributes[:'city'] + else + self.city = nil end if attributes.key?(:'state') @@ -404,6 +452,8 @@ def initialize(attributes = {}) if attributes.key?(:'country_code') self.country_code = attributes[:'country_code'] + else + self.country_code = nil end if attributes.key?(:'federal_e_file') @@ -436,6 +486,38 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @recipient_name.nil? + invalid_properties.push('invalid value for "recipient_name", recipient_name cannot be nil.') + end + + if @recipient_name.to_s.length < 1 + invalid_properties.push('invalid value for "recipient_name", the character length must be great than or equal to 1.') + end + + if @address.nil? + invalid_properties.push('invalid value for "address", address cannot be nil.') + end + + if @address.to_s.length < 1 + invalid_properties.push('invalid value for "address", the character length must be great than or equal to 1.') + end + + if @city.nil? + invalid_properties.push('invalid value for "city", city cannot be nil.') + end + + if @city.to_s.length < 1 + invalid_properties.push('invalid value for "city", the character length must be great than or equal to 1.') + end + + if @country_code.nil? + invalid_properties.push('invalid value for "country_code", country_code cannot be nil.') + end + + if @country_code.to_s.length < 1 + invalid_properties.push('invalid value for "country_code", the character length must be great than or equal to 1.') + end + invalid_properties end @@ -443,23 +525,45 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - type_validator = EnumAttributeValidator.new('String', ["Form1099Nec", "Form1099Misc", "Form1099Div", "Form1099R", "Form1099K", "Form1095B"]) + type_validator = EnumAttributeValidator.new('String', ["1099-NEC", "1099-MISC", "1099-DIV", "1099-R", "1099-K", "1095-B", "1042-S"]) return false unless type_validator.valid?(@type) + return false if @recipient_name.nil? + return false if @recipient_name.to_s.length < 1 tin_type_validator = EnumAttributeValidator.new('String', ["EIN", "SSN", "ITIN", "ATIN"]) return false unless tin_type_validator.valid?(@tin_type) + return false if @address.nil? + return false if @address.to_s.length < 1 + return false if @city.nil? + return false if @city.to_s.length < 1 + return false if @country_code.nil? + return false if @country_code.to_s.length < 1 true end # Custom attribute writer method checking allowed values (enum). # @param [Object] type Object to be assigned def type=(type) - validator = EnumAttributeValidator.new('String', ["Form1099Nec", "Form1099Misc", "Form1099Div", "Form1099R", "Form1099K", "Form1095B"]) + validator = EnumAttributeValidator.new('String', ["1099-NEC", "1099-MISC", "1099-DIV", "1099-R", "1099-K", "1095-B", "1042-S"]) unless validator.valid?(type) fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." end @type = type end + # Custom attribute writer method with validation + # @param [Object] recipient_name Value to be assigned + def recipient_name=(recipient_name) + if recipient_name.nil? + fail ArgumentError, 'recipient_name cannot be nil' + end + + if recipient_name.to_s.length < 1 + fail ArgumentError, 'invalid value for "recipient_name", the character length must be great than or equal to 1.' + end + + @recipient_name = recipient_name + end + # Custom attribute writer method checking allowed values (enum). # @param [Object] tin_type Object to be assigned def tin_type=(tin_type) @@ -470,6 +574,48 @@ def tin_type=(tin_type) @tin_type = tin_type end + # Custom attribute writer method with validation + # @param [Object] address Value to be assigned + def address=(address) + if address.nil? + fail ArgumentError, 'address cannot be nil' + end + + if address.to_s.length < 1 + fail ArgumentError, 'invalid value for "address", the character length must be great than or equal to 1.' + end + + @address = address + end + + # Custom attribute writer method with validation + # @param [Object] city Value to be assigned + def city=(city) + if city.nil? + fail ArgumentError, 'city cannot be nil' + end + + if city.to_s.length < 1 + fail ArgumentError, 'invalid value for "city", the character length must be great than or equal to 1.' + end + + @city = city + end + + # Custom attribute writer method with validation + # @param [Object] country_code Value to be assigned + def country_code=(country_code) + if country_code.nil? + fail ArgumentError, 'country_code cannot be nil' + end + + if country_code.to_s.length < 1 + fail ArgumentError, 'invalid value for "country_code", the character length must be great than or equal to 1.' + end + + @country_code = country_code + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -498,8 +644,8 @@ def ==(o) type == o.type && issuer_id == o.issuer_id && reference_id == o.reference_id && - recipient_name == o.recipient_name && recipient_tin == o.recipient_tin && + recipient_name == o.recipient_name && tin_type == o.tin_type && recipient_second_name == o.recipient_second_name && address == o.address && @@ -529,7 +675,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [gross_distribution, taxable_amount, taxable_amount_not_determined, total_distribution_determined, capital_gain, federal_income_tax_withheld, employee_contributions_or_designated_roth_or_insurance_premiums, net_unrealized_appreciation_in_employer_securities, distribution_code, second_distribution_code, ira_sep_simple, traditional_ira_sep_simple_or_roth_conversion_amount, other_amount, other_percentage, total_distribution_percentage, total_employee_contributions, amount_allocable_to_irr_within5_years, first_year_of_designated_roth_contribution, fatca_filing_requirement, date_of_payment, type, issuer_id, reference_id, recipient_name, recipient_tin, tin_type, recipient_second_name, address, address2, city, state, zip, recipient_email, account_number, office_code, recipient_non_us_province, country_code, federal_e_file, postal_mail, state_e_file, tin_match, address_verification, state_and_local_withholding].hash + [gross_distribution, taxable_amount, taxable_amount_not_determined, total_distribution_determined, capital_gain, federal_income_tax_withheld, employee_contributions_or_designated_roth_or_insurance_premiums, net_unrealized_appreciation_in_employer_securities, distribution_code, second_distribution_code, ira_sep_simple, traditional_ira_sep_simple_or_roth_conversion_amount, other_amount, other_percentage, total_distribution_percentage, total_employee_contributions, amount_allocable_to_irr_within5_years, first_year_of_designated_roth_contribution, fatca_filing_requirement, date_of_payment, type, issuer_id, reference_id, recipient_tin, recipient_name, tin_type, recipient_second_name, address, address2, city, state, zip, recipient_email, account_number, office_code, recipient_non_us_province, country_code, federal_e_file, postal_mail, state_e_file, tin_match, address_verification, state_and_local_withholding].hash end # Builds the object from hash diff --git a/lib/avalara_sdk/models/A1099/V2/form1099_status_detail_response.rb b/lib/avalara_sdk/models/A1099/V2/form1099_status_detail_response.rb new file mode 100644 index 0000000..328ce59 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/form1099_status_detail_response.rb @@ -0,0 +1,223 @@ +=begin +#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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class Form1099StatusDetailResponse + # The date the form is scheduled for or the time the status last changed + attr_accessor :time + + # The status of the form. Will be one of: * unsent * scheduled * sent * corrected_scheduled * accepted * corrected * corrected_accepted * held * pending * delivered * bad_verify * bad_verify_limit * bounced * verified * incomplete * failed * unchanged * unknown + attr_accessor :status + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'time' => :'time', + :'status' => :'status' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'time' => :'String', + :'status' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'time', + :'status' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::A1099::V2::Form1099StatusDetailResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::A1099::V2::Form1099StatusDetailResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'time') + self.time = attributes[:'time'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + time == o.time && + status == o.status + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [time, status].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::A1099::V2.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/A1099/V2/form_request_base.rb b/lib/avalara_sdk/models/A1099/V2/form_request_base.rb index c48a8d5..a925a9e 100644 --- a/lib/avalara_sdk/models/A1099/V2/form_request_base.rb +++ b/lib/avalara_sdk/models/A1099/V2/form_request_base.rb @@ -1,7 +1,7 @@ =begin #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) =end @@ -11,48 +11,70 @@ module AvalaraSdk::A1099::V2 class FormRequestBase + # Issuer ID attr_accessor :issuer_id + # Reference ID attr_accessor :reference_id - attr_accessor :recipient_name - + # Recipient Tax ID Number attr_accessor :recipient_tin + # Recipient name + attr_accessor :recipient_name + + # Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN attr_accessor :tin_type + # Recipient second name attr_accessor :recipient_second_name + # Address attr_accessor :address + # Address line 2 attr_accessor :address2 + # City attr_accessor :city + # US state. Required if CountryCode is \"US\". attr_accessor :state + # Zip/postal code attr_accessor :zip + # Recipient email address attr_accessor :recipient_email + # Account number attr_accessor :account_number + # Office code attr_accessor :office_code + # Foreign province attr_accessor :recipient_non_us_province + # Country code, as defined at https://www.irs.gov/e-file-providers/country-codes attr_accessor :country_code + # Boolean indicating that federal e-filing should be scheduled for this form attr_accessor :federal_e_file + # Boolean indicating that postal mailing to the recipient should be scheduled for this form attr_accessor :postal_mail + # Boolean indicating that state e-filing should be scheduled for this form attr_accessor :state_e_file + # Boolean indicating that TIN Matching should be scheduled for this form attr_accessor :tin_match + # Boolean indicating that address verification should be scheduled for this form attr_accessor :address_verification + # State and local withholding information attr_accessor :state_and_local_withholding class EnumAttributeValidator @@ -82,8 +104,8 @@ def self.attribute_map { :'issuer_id' => :'issuerId', :'reference_id' => :'referenceId', - :'recipient_name' => :'recipientName', :'recipient_tin' => :'recipientTin', + :'recipient_name' => :'recipientName', :'tin_type' => :'tinType', :'recipient_second_name' => :'recipientSecondName', :'address' => :'address', @@ -115,8 +137,8 @@ def self.openapi_types { :'issuer_id' => :'String', :'reference_id' => :'String', - :'recipient_name' => :'String', :'recipient_tin' => :'String', + :'recipient_name' => :'String', :'tin_type' => :'String', :'recipient_second_name' => :'String', :'address' => :'String', @@ -143,7 +165,7 @@ def self.openapi_nullable Set.new([ :'issuer_id', :'reference_id', - :'recipient_name', + :'recipient_second_name', :'address2', :'recipient_email', :'account_number', @@ -175,14 +197,16 @@ def initialize(attributes = {}) self.reference_id = attributes[:'reference_id'] end - if attributes.key?(:'recipient_name') - self.recipient_name = attributes[:'recipient_name'] - end - if attributes.key?(:'recipient_tin') self.recipient_tin = attributes[:'recipient_tin'] end + if attributes.key?(:'recipient_name') + self.recipient_name = attributes[:'recipient_name'] + else + self.recipient_name = nil + end + if attributes.key?(:'tin_type') self.tin_type = attributes[:'tin_type'] end @@ -193,6 +217,8 @@ def initialize(attributes = {}) if attributes.key?(:'address') self.address = attributes[:'address'] + else + self.address = nil end if attributes.key?(:'address2') @@ -201,6 +227,8 @@ def initialize(attributes = {}) if attributes.key?(:'city') self.city = attributes[:'city'] + else + self.city = nil end if attributes.key?(:'state') @@ -229,6 +257,8 @@ def initialize(attributes = {}) if attributes.key?(:'country_code') self.country_code = attributes[:'country_code'] + else + self.country_code = nil end if attributes.key?(:'federal_e_file') @@ -261,6 +291,38 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @recipient_name.nil? + invalid_properties.push('invalid value for "recipient_name", recipient_name cannot be nil.') + end + + if @recipient_name.to_s.length < 1 + invalid_properties.push('invalid value for "recipient_name", the character length must be great than or equal to 1.') + end + + if @address.nil? + invalid_properties.push('invalid value for "address", address cannot be nil.') + end + + if @address.to_s.length < 1 + invalid_properties.push('invalid value for "address", the character length must be great than or equal to 1.') + end + + if @city.nil? + invalid_properties.push('invalid value for "city", city cannot be nil.') + end + + if @city.to_s.length < 1 + invalid_properties.push('invalid value for "city", the character length must be great than or equal to 1.') + end + + if @country_code.nil? + invalid_properties.push('invalid value for "country_code", country_code cannot be nil.') + end + + if @country_code.to_s.length < 1 + invalid_properties.push('invalid value for "country_code", the character length must be great than or equal to 1.') + end + invalid_properties end @@ -268,11 +330,33 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @recipient_name.nil? + return false if @recipient_name.to_s.length < 1 tin_type_validator = EnumAttributeValidator.new('String', ["EIN", "SSN", "ITIN", "ATIN"]) return false unless tin_type_validator.valid?(@tin_type) + return false if @address.nil? + return false if @address.to_s.length < 1 + return false if @city.nil? + return false if @city.to_s.length < 1 + return false if @country_code.nil? + return false if @country_code.to_s.length < 1 true end + # Custom attribute writer method with validation + # @param [Object] recipient_name Value to be assigned + def recipient_name=(recipient_name) + if recipient_name.nil? + fail ArgumentError, 'recipient_name cannot be nil' + end + + if recipient_name.to_s.length < 1 + fail ArgumentError, 'invalid value for "recipient_name", the character length must be great than or equal to 1.' + end + + @recipient_name = recipient_name + end + # Custom attribute writer method checking allowed values (enum). # @param [Object] tin_type Object to be assigned def tin_type=(tin_type) @@ -283,6 +367,48 @@ def tin_type=(tin_type) @tin_type = tin_type end + # Custom attribute writer method with validation + # @param [Object] address Value to be assigned + def address=(address) + if address.nil? + fail ArgumentError, 'address cannot be nil' + end + + if address.to_s.length < 1 + fail ArgumentError, 'invalid value for "address", the character length must be great than or equal to 1.' + end + + @address = address + end + + # Custom attribute writer method with validation + # @param [Object] city Value to be assigned + def city=(city) + if city.nil? + fail ArgumentError, 'city cannot be nil' + end + + if city.to_s.length < 1 + fail ArgumentError, 'invalid value for "city", the character length must be great than or equal to 1.' + end + + @city = city + end + + # Custom attribute writer method with validation + # @param [Object] country_code Value to be assigned + def country_code=(country_code) + if country_code.nil? + fail ArgumentError, 'country_code cannot be nil' + end + + if country_code.to_s.length < 1 + fail ArgumentError, 'invalid value for "country_code", the character length must be great than or equal to 1.' + end + + @country_code = country_code + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -290,8 +416,8 @@ def ==(o) self.class == o.class && issuer_id == o.issuer_id && reference_id == o.reference_id && - recipient_name == o.recipient_name && recipient_tin == o.recipient_tin && + recipient_name == o.recipient_name && tin_type == o.tin_type && recipient_second_name == o.recipient_second_name && address == o.address && @@ -321,7 +447,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [issuer_id, reference_id, recipient_name, recipient_tin, tin_type, recipient_second_name, address, address2, city, state, zip, recipient_email, account_number, office_code, recipient_non_us_province, country_code, federal_e_file, postal_mail, state_e_file, tin_match, address_verification, state_and_local_withholding].hash + [issuer_id, reference_id, recipient_tin, recipient_name, tin_type, recipient_second_name, address, address2, city, state, zip, recipient_email, account_number, office_code, recipient_non_us_province, country_code, federal_e_file, postal_mail, state_e_file, tin_match, address_verification, state_and_local_withholding].hash end # Builds the object from hash diff --git a/lib/avalara_sdk/models/A1099/V2/form_request_list_item_base.rb b/lib/avalara_sdk/models/A1099/V2/form_request_list_item_base.rb new file mode 100644 index 0000000..590b28c --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/form_request_list_item_base.rb @@ -0,0 +1,611 @@ +=begin +#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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class FormRequestListItemBase + # Issuer Reference ID. One of `issuerReferenceId` or `issuerTin` is required. + attr_accessor :issuer_reference_id + + # Issuer TIN. One of `issuerReferenceId` or `issuerTin` is required. + attr_accessor :issuer_tin + + # Tax year + attr_accessor :tax_year + + # Issuer ID + attr_accessor :issuer_id + + # Reference ID + attr_accessor :reference_id + + # Recipient Tax ID Number + attr_accessor :recipient_tin + + # Recipient name + attr_accessor :recipient_name + + # Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN + attr_accessor :tin_type + + # Recipient second name + attr_accessor :recipient_second_name + + # Address + attr_accessor :address + + # Address line 2 + attr_accessor :address2 + + # City + attr_accessor :city + + # US state. Required if CountryCode is \"US\". + attr_accessor :state + + # Zip/postal code + attr_accessor :zip + + # Recipient email address + attr_accessor :recipient_email + + # Account number + attr_accessor :account_number + + # Office code + attr_accessor :office_code + + # Foreign province + attr_accessor :recipient_non_us_province + + # Country code, as defined at https://www.irs.gov/e-file-providers/country-codes + attr_accessor :country_code + + # Boolean indicating that federal e-filing should be scheduled for this form + attr_accessor :federal_e_file + + # Boolean indicating that postal mailing to the recipient should be scheduled for this form + attr_accessor :postal_mail + + # Boolean indicating that state e-filing should be scheduled for this form + attr_accessor :state_e_file + + # Boolean indicating that TIN Matching should be scheduled for this form + attr_accessor :tin_match + + # Boolean indicating that address verification should be scheduled for this form + attr_accessor :address_verification + + # State and local withholding information + attr_accessor :state_and_local_withholding + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'issuer_reference_id' => :'issuerReferenceId', + :'issuer_tin' => :'issuerTin', + :'tax_year' => :'taxYear', + :'issuer_id' => :'issuerId', + :'reference_id' => :'referenceId', + :'recipient_tin' => :'recipientTin', + :'recipient_name' => :'recipientName', + :'tin_type' => :'tinType', + :'recipient_second_name' => :'recipientSecondName', + :'address' => :'address', + :'address2' => :'address2', + :'city' => :'city', + :'state' => :'state', + :'zip' => :'zip', + :'recipient_email' => :'recipientEmail', + :'account_number' => :'accountNumber', + :'office_code' => :'officeCode', + :'recipient_non_us_province' => :'recipientNonUsProvince', + :'country_code' => :'countryCode', + :'federal_e_file' => :'federalEFile', + :'postal_mail' => :'postalMail', + :'state_e_file' => :'stateEFile', + :'tin_match' => :'tinMatch', + :'address_verification' => :'addressVerification', + :'state_and_local_withholding' => :'stateAndLocalWithholding' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'issuer_reference_id' => :'String', + :'issuer_tin' => :'String', + :'tax_year' => :'Integer', + :'issuer_id' => :'String', + :'reference_id' => :'String', + :'recipient_tin' => :'String', + :'recipient_name' => :'String', + :'tin_type' => :'String', + :'recipient_second_name' => :'String', + :'address' => :'String', + :'address2' => :'String', + :'city' => :'String', + :'state' => :'String', + :'zip' => :'String', + :'recipient_email' => :'String', + :'account_number' => :'String', + :'office_code' => :'String', + :'recipient_non_us_province' => :'String', + :'country_code' => :'String', + :'federal_e_file' => :'Boolean', + :'postal_mail' => :'Boolean', + :'state_e_file' => :'Boolean', + :'tin_match' => :'Boolean', + :'address_verification' => :'Boolean', + :'state_and_local_withholding' => :'StateAndLocalWithholdingRequest' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'issuer_id', + :'reference_id', + :'recipient_second_name', + :'address2', + :'recipient_email', + :'account_number', + :'office_code', + :'recipient_non_us_province', + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'FormRequestBase' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::A1099::V2::FormRequestListItemBase` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::A1099::V2::FormRequestListItemBase`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'issuer_reference_id') + self.issuer_reference_id = attributes[:'issuer_reference_id'] + end + + if attributes.key?(:'issuer_tin') + self.issuer_tin = attributes[:'issuer_tin'] + end + + if attributes.key?(:'tax_year') + self.tax_year = attributes[:'tax_year'] + else + self.tax_year = nil + end + + if attributes.key?(:'issuer_id') + self.issuer_id = attributes[:'issuer_id'] + end + + if attributes.key?(:'reference_id') + self.reference_id = attributes[:'reference_id'] + end + + if attributes.key?(:'recipient_tin') + self.recipient_tin = attributes[:'recipient_tin'] + end + + if attributes.key?(:'recipient_name') + self.recipient_name = attributes[:'recipient_name'] + else + self.recipient_name = nil + end + + if attributes.key?(:'tin_type') + self.tin_type = attributes[:'tin_type'] + end + + if attributes.key?(:'recipient_second_name') + self.recipient_second_name = attributes[:'recipient_second_name'] + end + + if attributes.key?(:'address') + self.address = attributes[:'address'] + else + self.address = nil + end + + if attributes.key?(:'address2') + self.address2 = attributes[:'address2'] + end + + if attributes.key?(:'city') + self.city = attributes[:'city'] + else + self.city = nil + end + + if attributes.key?(:'state') + self.state = attributes[:'state'] + end + + if attributes.key?(:'zip') + self.zip = attributes[:'zip'] + end + + if attributes.key?(:'recipient_email') + self.recipient_email = attributes[:'recipient_email'] + end + + if attributes.key?(:'account_number') + self.account_number = attributes[:'account_number'] + end + + if attributes.key?(:'office_code') + self.office_code = attributes[:'office_code'] + end + + if attributes.key?(:'recipient_non_us_province') + self.recipient_non_us_province = attributes[:'recipient_non_us_province'] + end + + if attributes.key?(:'country_code') + self.country_code = attributes[:'country_code'] + else + self.country_code = nil + end + + if attributes.key?(:'federal_e_file') + self.federal_e_file = attributes[:'federal_e_file'] + end + + if attributes.key?(:'postal_mail') + self.postal_mail = attributes[:'postal_mail'] + end + + if attributes.key?(:'state_e_file') + self.state_e_file = attributes[:'state_e_file'] + end + + if attributes.key?(:'tin_match') + self.tin_match = attributes[:'tin_match'] + end + + if attributes.key?(:'address_verification') + self.address_verification = attributes[:'address_verification'] + end + + if attributes.key?(:'state_and_local_withholding') + self.state_and_local_withholding = attributes[:'state_and_local_withholding'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @tax_year.nil? + invalid_properties.push('invalid value for "tax_year", tax_year cannot be nil.') + end + + if @recipient_name.nil? + invalid_properties.push('invalid value for "recipient_name", recipient_name cannot be nil.') + end + + if @recipient_name.to_s.length < 1 + invalid_properties.push('invalid value for "recipient_name", the character length must be great than or equal to 1.') + end + + if @address.nil? + invalid_properties.push('invalid value for "address", address cannot be nil.') + end + + if @address.to_s.length < 1 + invalid_properties.push('invalid value for "address", the character length must be great than or equal to 1.') + end + + if @city.nil? + invalid_properties.push('invalid value for "city", city cannot be nil.') + end + + if @city.to_s.length < 1 + invalid_properties.push('invalid value for "city", the character length must be great than or equal to 1.') + end + + if @country_code.nil? + invalid_properties.push('invalid value for "country_code", country_code cannot be nil.') + end + + if @country_code.to_s.length < 1 + invalid_properties.push('invalid value for "country_code", the character length must be great than or equal to 1.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @tax_year.nil? + return false if @recipient_name.nil? + return false if @recipient_name.to_s.length < 1 + tin_type_validator = EnumAttributeValidator.new('String', ["EIN", "SSN", "ITIN", "ATIN"]) + return false unless tin_type_validator.valid?(@tin_type) + return false if @address.nil? + return false if @address.to_s.length < 1 + return false if @city.nil? + return false if @city.to_s.length < 1 + return false if @country_code.nil? + return false if @country_code.to_s.length < 1 + true + end + + # Custom attribute writer method with validation + # @param [Object] recipient_name Value to be assigned + def recipient_name=(recipient_name) + if recipient_name.nil? + fail ArgumentError, 'recipient_name cannot be nil' + end + + if recipient_name.to_s.length < 1 + fail ArgumentError, 'invalid value for "recipient_name", the character length must be great than or equal to 1.' + end + + @recipient_name = recipient_name + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] tin_type Object to be assigned + def tin_type=(tin_type) + validator = EnumAttributeValidator.new('String', ["EIN", "SSN", "ITIN", "ATIN"]) + unless validator.valid?(tin_type) + fail ArgumentError, "invalid value for \"tin_type\", must be one of #{validator.allowable_values}." + end + @tin_type = tin_type + end + + # Custom attribute writer method with validation + # @param [Object] address Value to be assigned + def address=(address) + if address.nil? + fail ArgumentError, 'address cannot be nil' + end + + if address.to_s.length < 1 + fail ArgumentError, 'invalid value for "address", the character length must be great than or equal to 1.' + end + + @address = address + end + + # Custom attribute writer method with validation + # @param [Object] city Value to be assigned + def city=(city) + if city.nil? + fail ArgumentError, 'city cannot be nil' + end + + if city.to_s.length < 1 + fail ArgumentError, 'invalid value for "city", the character length must be great than or equal to 1.' + end + + @city = city + end + + # Custom attribute writer method with validation + # @param [Object] country_code Value to be assigned + def country_code=(country_code) + if country_code.nil? + fail ArgumentError, 'country_code cannot be nil' + end + + if country_code.to_s.length < 1 + fail ArgumentError, 'invalid value for "country_code", the character length must be great than or equal to 1.' + end + + @country_code = country_code + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + issuer_reference_id == o.issuer_reference_id && + issuer_tin == o.issuer_tin && + tax_year == o.tax_year && + issuer_id == o.issuer_id && + reference_id == o.reference_id && + recipient_tin == o.recipient_tin && + recipient_name == o.recipient_name && + tin_type == o.tin_type && + recipient_second_name == o.recipient_second_name && + address == o.address && + address2 == o.address2 && + city == o.city && + state == o.state && + zip == o.zip && + recipient_email == o.recipient_email && + account_number == o.account_number && + office_code == o.office_code && + recipient_non_us_province == o.recipient_non_us_province && + country_code == o.country_code && + federal_e_file == o.federal_e_file && + postal_mail == o.postal_mail && + state_e_file == o.state_e_file && + tin_match == o.tin_match && + address_verification == o.address_verification && + state_and_local_withholding == o.state_and_local_withholding + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [issuer_reference_id, issuer_tin, tax_year, issuer_id, reference_id, recipient_tin, recipient_name, tin_type, recipient_second_name, address, address2, city, state, zip, recipient_email, account_number, office_code, recipient_non_us_province, country_code, federal_e_file, postal_mail, state_e_file, tin_match, address_verification, state_and_local_withholding].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::A1099::V2.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/A1099/V2/form_response_base.rb b/lib/avalara_sdk/models/A1099/V2/form_response_base.rb index 0488885..0f6de3e 100644 --- a/lib/avalara_sdk/models/A1099/V2/form_response_base.rb +++ b/lib/avalara_sdk/models/A1099/V2/form_response_base.rb @@ -1,7 +1,7 @@ =begin #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) =end @@ -186,11 +186,11 @@ def self.openapi_types :'tin_match' => :'Boolean', :'address_verification' => :'Boolean', :'federal_efile_status' => :'StatusDetail', - :'state_efile_status' => :'Array', + :'state_efile_status' => :'Array', :'postal_mail_status' => :'StatusDetail', :'tin_match_status' => :'StatusDetail', :'address_verification_status' => :'StatusDetail', - :'validation_errors' => :'Array' + :'validation_errors' => :'Array' } end @@ -382,7 +382,7 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - type_validator = EnumAttributeValidator.new('String', ["Form1099Nec", "Form1099Misc", "Form1099Div", "Form1099R", "Form1099K", "Form1095B"]) + type_validator = EnumAttributeValidator.new('String', ["1099-NEC", "1099-MISC", "1099-DIV", "1099-R", "1099-K", "1095-B", "1042-S"]) return false unless type_validator.valid?(@type) tin_type_validator = EnumAttributeValidator.new('String', ["EIN", "SSN", "ITIN", "ATIN"]) return false unless tin_type_validator.valid?(@tin_type) @@ -392,7 +392,7 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] type Object to be assigned def type=(type) - validator = EnumAttributeValidator.new('String', ["Form1099Nec", "Form1099Misc", "Form1099Div", "Form1099R", "Form1099K", "Form1095B"]) + validator = EnumAttributeValidator.new('String', ["1099-NEC", "1099-MISC", "1099-DIV", "1099-R", "1099-K", "1095-B", "1042-S"]) unless validator.valid?(type) fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." end diff --git a/lib/avalara_sdk/models/A1099/V2/form_single_request_base.rb b/lib/avalara_sdk/models/A1099/V2/form_single_request_base.rb index 19108a2..72809e9 100644 --- a/lib/avalara_sdk/models/A1099/V2/form_single_request_base.rb +++ b/lib/avalara_sdk/models/A1099/V2/form_single_request_base.rb @@ -1,7 +1,7 @@ =begin #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) =end @@ -13,48 +13,70 @@ module AvalaraSdk::A1099::V2 class FormSingleRequestBase attr_accessor :type + # Issuer ID attr_accessor :issuer_id + # Reference ID attr_accessor :reference_id - attr_accessor :recipient_name - + # Recipient Tax ID Number attr_accessor :recipient_tin + # Recipient name + attr_accessor :recipient_name + + # Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN attr_accessor :tin_type + # Recipient second name attr_accessor :recipient_second_name + # Address attr_accessor :address + # Address line 2 attr_accessor :address2 + # City attr_accessor :city + # US state. Required if CountryCode is \"US\". attr_accessor :state + # Zip/postal code attr_accessor :zip + # Recipient email address attr_accessor :recipient_email + # Account number attr_accessor :account_number + # Office code attr_accessor :office_code + # Foreign province attr_accessor :recipient_non_us_province + # Country code, as defined at https://www.irs.gov/e-file-providers/country-codes attr_accessor :country_code + # Boolean indicating that federal e-filing should be scheduled for this form attr_accessor :federal_e_file + # Boolean indicating that postal mailing to the recipient should be scheduled for this form attr_accessor :postal_mail + # Boolean indicating that state e-filing should be scheduled for this form attr_accessor :state_e_file + # Boolean indicating that TIN Matching should be scheduled for this form attr_accessor :tin_match + # Boolean indicating that address verification should be scheduled for this form attr_accessor :address_verification + # State and local withholding information attr_accessor :state_and_local_withholding class EnumAttributeValidator @@ -85,8 +107,8 @@ def self.attribute_map :'type' => :'type', :'issuer_id' => :'issuerId', :'reference_id' => :'referenceId', - :'recipient_name' => :'recipientName', :'recipient_tin' => :'recipientTin', + :'recipient_name' => :'recipientName', :'tin_type' => :'tinType', :'recipient_second_name' => :'recipientSecondName', :'address' => :'address', @@ -119,8 +141,8 @@ def self.openapi_types :'type' => :'String', :'issuer_id' => :'String', :'reference_id' => :'String', - :'recipient_name' => :'String', :'recipient_tin' => :'String', + :'recipient_name' => :'String', :'tin_type' => :'String', :'recipient_second_name' => :'String', :'address' => :'String', @@ -147,7 +169,7 @@ def self.openapi_nullable Set.new([ :'issuer_id', :'reference_id', - :'recipient_name', + :'recipient_second_name', :'address2', :'recipient_email', :'account_number', @@ -190,14 +212,16 @@ def initialize(attributes = {}) self.reference_id = attributes[:'reference_id'] end - if attributes.key?(:'recipient_name') - self.recipient_name = attributes[:'recipient_name'] - end - if attributes.key?(:'recipient_tin') self.recipient_tin = attributes[:'recipient_tin'] end + if attributes.key?(:'recipient_name') + self.recipient_name = attributes[:'recipient_name'] + else + self.recipient_name = nil + end + if attributes.key?(:'tin_type') self.tin_type = attributes[:'tin_type'] end @@ -208,6 +232,8 @@ def initialize(attributes = {}) if attributes.key?(:'address') self.address = attributes[:'address'] + else + self.address = nil end if attributes.key?(:'address2') @@ -216,6 +242,8 @@ def initialize(attributes = {}) if attributes.key?(:'city') self.city = attributes[:'city'] + else + self.city = nil end if attributes.key?(:'state') @@ -244,6 +272,8 @@ def initialize(attributes = {}) if attributes.key?(:'country_code') self.country_code = attributes[:'country_code'] + else + self.country_code = nil end if attributes.key?(:'federal_e_file') @@ -276,6 +306,38 @@ def initialize(attributes = {}) def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new + if @recipient_name.nil? + invalid_properties.push('invalid value for "recipient_name", recipient_name cannot be nil.') + end + + if @recipient_name.to_s.length < 1 + invalid_properties.push('invalid value for "recipient_name", the character length must be great than or equal to 1.') + end + + if @address.nil? + invalid_properties.push('invalid value for "address", address cannot be nil.') + end + + if @address.to_s.length < 1 + invalid_properties.push('invalid value for "address", the character length must be great than or equal to 1.') + end + + if @city.nil? + invalid_properties.push('invalid value for "city", city cannot be nil.') + end + + if @city.to_s.length < 1 + invalid_properties.push('invalid value for "city", the character length must be great than or equal to 1.') + end + + if @country_code.nil? + invalid_properties.push('invalid value for "country_code", country_code cannot be nil.') + end + + if @country_code.to_s.length < 1 + invalid_properties.push('invalid value for "country_code", the character length must be great than or equal to 1.') + end + invalid_properties end @@ -283,23 +345,45 @@ def list_invalid_properties # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' - type_validator = EnumAttributeValidator.new('String', ["Form1099Nec", "Form1099Misc", "Form1099Div", "Form1099R", "Form1099K", "Form1095B"]) + type_validator = EnumAttributeValidator.new('String', ["1099-NEC", "1099-MISC", "1099-DIV", "1099-R", "1099-K", "1095-B", "1042-S"]) return false unless type_validator.valid?(@type) + return false if @recipient_name.nil? + return false if @recipient_name.to_s.length < 1 tin_type_validator = EnumAttributeValidator.new('String', ["EIN", "SSN", "ITIN", "ATIN"]) return false unless tin_type_validator.valid?(@tin_type) + return false if @address.nil? + return false if @address.to_s.length < 1 + return false if @city.nil? + return false if @city.to_s.length < 1 + return false if @country_code.nil? + return false if @country_code.to_s.length < 1 true end # Custom attribute writer method checking allowed values (enum). # @param [Object] type Object to be assigned def type=(type) - validator = EnumAttributeValidator.new('String', ["Form1099Nec", "Form1099Misc", "Form1099Div", "Form1099R", "Form1099K", "Form1095B"]) + validator = EnumAttributeValidator.new('String', ["1099-NEC", "1099-MISC", "1099-DIV", "1099-R", "1099-K", "1095-B", "1042-S"]) unless validator.valid?(type) fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." end @type = type end + # Custom attribute writer method with validation + # @param [Object] recipient_name Value to be assigned + def recipient_name=(recipient_name) + if recipient_name.nil? + fail ArgumentError, 'recipient_name cannot be nil' + end + + if recipient_name.to_s.length < 1 + fail ArgumentError, 'invalid value for "recipient_name", the character length must be great than or equal to 1.' + end + + @recipient_name = recipient_name + end + # Custom attribute writer method checking allowed values (enum). # @param [Object] tin_type Object to be assigned def tin_type=(tin_type) @@ -310,6 +394,48 @@ def tin_type=(tin_type) @tin_type = tin_type end + # Custom attribute writer method with validation + # @param [Object] address Value to be assigned + def address=(address) + if address.nil? + fail ArgumentError, 'address cannot be nil' + end + + if address.to_s.length < 1 + fail ArgumentError, 'invalid value for "address", the character length must be great than or equal to 1.' + end + + @address = address + end + + # Custom attribute writer method with validation + # @param [Object] city Value to be assigned + def city=(city) + if city.nil? + fail ArgumentError, 'city cannot be nil' + end + + if city.to_s.length < 1 + fail ArgumentError, 'invalid value for "city", the character length must be great than or equal to 1.' + end + + @city = city + end + + # Custom attribute writer method with validation + # @param [Object] country_code Value to be assigned + def country_code=(country_code) + if country_code.nil? + fail ArgumentError, 'country_code cannot be nil' + end + + if country_code.to_s.length < 1 + fail ArgumentError, 'invalid value for "country_code", the character length must be great than or equal to 1.' + end + + @country_code = country_code + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -318,8 +444,8 @@ def ==(o) type == o.type && issuer_id == o.issuer_id && reference_id == o.reference_id && - recipient_name == o.recipient_name && recipient_tin == o.recipient_tin && + recipient_name == o.recipient_name && tin_type == o.tin_type && recipient_second_name == o.recipient_second_name && address == o.address && @@ -349,7 +475,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [type, issuer_id, reference_id, recipient_name, recipient_tin, tin_type, recipient_second_name, address, address2, city, state, zip, recipient_email, account_number, office_code, recipient_non_us_province, country_code, federal_e_file, postal_mail, state_e_file, tin_match, address_verification, state_and_local_withholding].hash + [type, issuer_id, reference_id, recipient_tin, recipient_name, tin_type, recipient_second_name, address, address2, city, state, zip, recipient_email, account_number, office_code, recipient_non_us_province, country_code, federal_e_file, postal_mail, state_e_file, tin_match, address_verification, state_and_local_withholding].hash end # Builds the object from hash diff --git a/lib/avalara_sdk/models/A1099/V2/get1099_form200_response.rb b/lib/avalara_sdk/models/A1099/V2/get1099_form200_response.rb index ba02157..6b6072d 100644 --- a/lib/avalara_sdk/models/A1099/V2/get1099_form200_response.rb +++ b/lib/avalara_sdk/models/A1099/V2/get1099_form200_response.rb @@ -1,7 +1,7 @@ =begin #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) =end @@ -15,11 +15,13 @@ class << self # List of class defined in oneOf (OpenAPI v3) def openapi_one_of [ - :'Form1095B', - :'Form1099K', - :'Form1099Misc', - :'Form1099Nec', - :'Form1099R' + :'Form1042SListItemResponse', + :'Form1095BListItemResponse', + :'Form1099BaseResponse', + :'Form1099KListItemResponse', + :'Form1099MiscListItemResponse', + :'Form1099NecListItemResponse', + :'Form1099RListItemResponse' ] end diff --git a/lib/avalara_sdk/models/A1099/V2/http_validation_problem_details.rb b/lib/avalara_sdk/models/A1099/V2/http_validation_problem_details.rb index 210d8c3..f16c1aa 100644 --- a/lib/avalara_sdk/models/A1099/V2/http_validation_problem_details.rb +++ b/lib/avalara_sdk/models/A1099/V2/http_validation_problem_details.rb @@ -1,7 +1,7 @@ =begin #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) =end diff --git a/lib/avalara_sdk/models/A1099/V2/i_create_form1099_request.rb b/lib/avalara_sdk/models/A1099/V2/i_create_form1099_request.rb index 708a0a5..e786505 100644 --- a/lib/avalara_sdk/models/A1099/V2/i_create_form1099_request.rb +++ b/lib/avalara_sdk/models/A1099/V2/i_create_form1099_request.rb @@ -1,7 +1,7 @@ =begin #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) =end diff --git a/lib/avalara_sdk/models/A1099/V2/i_update_form1099_request.rb b/lib/avalara_sdk/models/A1099/V2/i_update_form1099_request.rb index 4766bcc..572f5c0 100644 --- a/lib/avalara_sdk/models/A1099/V2/i_update_form1099_request.rb +++ b/lib/avalara_sdk/models/A1099/V2/i_update_form1099_request.rb @@ -1,7 +1,7 @@ =begin #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) =end diff --git a/lib/avalara_sdk/models/A1099/V2/intermediary_or_flow_through.rb b/lib/avalara_sdk/models/A1099/V2/intermediary_or_flow_through.rb new file mode 100644 index 0000000..8fa7792 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/intermediary_or_flow_through.rb @@ -0,0 +1,311 @@ +=begin +#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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class IntermediaryOrFlowThrough + attr_accessor :ein + + attr_accessor :chap3_status_code + + attr_accessor :chap4_status_code + + attr_accessor :name + + attr_accessor :giin + + attr_accessor :country_code + + attr_accessor :foreign_tin + + attr_accessor :address + + attr_accessor :city + + attr_accessor :state + + attr_accessor :zip + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'ein' => :'ein', + :'chap3_status_code' => :'chap3StatusCode', + :'chap4_status_code' => :'chap4StatusCode', + :'name' => :'name', + :'giin' => :'giin', + :'country_code' => :'countryCode', + :'foreign_tin' => :'foreignTin', + :'address' => :'address', + :'city' => :'city', + :'state' => :'state', + :'zip' => :'zip' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'ein' => :'String', + :'chap3_status_code' => :'String', + :'chap4_status_code' => :'String', + :'name' => :'String', + :'giin' => :'String', + :'country_code' => :'String', + :'foreign_tin' => :'String', + :'address' => :'String', + :'city' => :'String', + :'state' => :'String', + :'zip' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'ein', + :'chap3_status_code', + :'chap4_status_code', + :'name', + :'giin', + :'country_code', + :'foreign_tin', + :'address', + :'city', + :'state', + :'zip' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::A1099::V2::IntermediaryOrFlowThrough` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::A1099::V2::IntermediaryOrFlowThrough`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'ein') + self.ein = attributes[:'ein'] + end + + if attributes.key?(:'chap3_status_code') + self.chap3_status_code = attributes[:'chap3_status_code'] + end + + if attributes.key?(:'chap4_status_code') + self.chap4_status_code = attributes[:'chap4_status_code'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'giin') + self.giin = attributes[:'giin'] + end + + if attributes.key?(:'country_code') + self.country_code = attributes[:'country_code'] + end + + if attributes.key?(:'foreign_tin') + self.foreign_tin = attributes[:'foreign_tin'] + end + + if attributes.key?(:'address') + self.address = attributes[:'address'] + end + + if attributes.key?(:'city') + self.city = attributes[:'city'] + end + + if attributes.key?(:'state') + self.state = attributes[:'state'] + end + + if attributes.key?(:'zip') + self.zip = attributes[:'zip'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + ein == o.ein && + chap3_status_code == o.chap3_status_code && + chap4_status_code == o.chap4_status_code && + name == o.name && + giin == o.giin && + country_code == o.country_code && + foreign_tin == o.foreign_tin && + address == o.address && + city == o.city && + state == o.state && + zip == o.zip + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [ein, chap3_status_code, chap4_status_code, name, giin, country_code, foreign_tin, address, city, state, zip].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::A1099::V2.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/A1099/V2/intermediary_or_flow_through_request.rb b/lib/avalara_sdk/models/A1099/V2/intermediary_or_flow_through_request.rb new file mode 100644 index 0000000..b5aac3a --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/intermediary_or_flow_through_request.rb @@ -0,0 +1,311 @@ +=begin +#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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class IntermediaryOrFlowThroughRequest + attr_accessor :ein + + attr_accessor :chap3_status_code + + attr_accessor :chap4_status_code + + attr_accessor :name + + attr_accessor :giin + + attr_accessor :country_code + + attr_accessor :foreign_tin + + attr_accessor :address + + attr_accessor :city + + attr_accessor :state + + attr_accessor :zip + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'ein' => :'ein', + :'chap3_status_code' => :'chap3StatusCode', + :'chap4_status_code' => :'chap4StatusCode', + :'name' => :'name', + :'giin' => :'giin', + :'country_code' => :'countryCode', + :'foreign_tin' => :'foreignTin', + :'address' => :'address', + :'city' => :'city', + :'state' => :'state', + :'zip' => :'zip' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'ein' => :'String', + :'chap3_status_code' => :'String', + :'chap4_status_code' => :'String', + :'name' => :'String', + :'giin' => :'String', + :'country_code' => :'String', + :'foreign_tin' => :'String', + :'address' => :'String', + :'city' => :'String', + :'state' => :'String', + :'zip' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'ein', + :'chap3_status_code', + :'chap4_status_code', + :'name', + :'giin', + :'country_code', + :'foreign_tin', + :'address', + :'city', + :'state', + :'zip' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::A1099::V2::IntermediaryOrFlowThroughRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::A1099::V2::IntermediaryOrFlowThroughRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'ein') + self.ein = attributes[:'ein'] + end + + if attributes.key?(:'chap3_status_code') + self.chap3_status_code = attributes[:'chap3_status_code'] + end + + if attributes.key?(:'chap4_status_code') + self.chap4_status_code = attributes[:'chap4_status_code'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'giin') + self.giin = attributes[:'giin'] + end + + if attributes.key?(:'country_code') + self.country_code = attributes[:'country_code'] + end + + if attributes.key?(:'foreign_tin') + self.foreign_tin = attributes[:'foreign_tin'] + end + + if attributes.key?(:'address') + self.address = attributes[:'address'] + end + + if attributes.key?(:'city') + self.city = attributes[:'city'] + end + + if attributes.key?(:'state') + self.state = attributes[:'state'] + end + + if attributes.key?(:'zip') + self.zip = attributes[:'zip'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + ein == o.ein && + chap3_status_code == o.chap3_status_code && + chap4_status_code == o.chap4_status_code && + name == o.name && + giin == o.giin && + country_code == o.country_code && + foreign_tin == o.foreign_tin && + address == o.address && + city == o.city && + state == o.state && + zip == o.zip + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [ein, chap3_status_code, chap4_status_code, name, giin, country_code, foreign_tin, address, city, state, zip].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::A1099::V2.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/A1099/V2/intermediary_or_flow_through_response.rb b/lib/avalara_sdk/models/A1099/V2/intermediary_or_flow_through_response.rb new file mode 100644 index 0000000..2fad9fd --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/intermediary_or_flow_through_response.rb @@ -0,0 +1,311 @@ +=begin +#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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class IntermediaryOrFlowThroughResponse + attr_accessor :ein + + attr_accessor :chap3_status_code + + attr_accessor :chap4_status_code + + attr_accessor :name + + attr_accessor :giin + + attr_accessor :country_code + + attr_accessor :foreign_tin + + attr_accessor :address + + attr_accessor :city + + attr_accessor :state + + attr_accessor :zip + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'ein' => :'ein', + :'chap3_status_code' => :'chap3StatusCode', + :'chap4_status_code' => :'chap4StatusCode', + :'name' => :'name', + :'giin' => :'giin', + :'country_code' => :'countryCode', + :'foreign_tin' => :'foreignTin', + :'address' => :'address', + :'city' => :'city', + :'state' => :'state', + :'zip' => :'zip' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'ein' => :'String', + :'chap3_status_code' => :'String', + :'chap4_status_code' => :'String', + :'name' => :'String', + :'giin' => :'String', + :'country_code' => :'String', + :'foreign_tin' => :'String', + :'address' => :'String', + :'city' => :'String', + :'state' => :'String', + :'zip' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'ein', + :'chap3_status_code', + :'chap4_status_code', + :'name', + :'giin', + :'country_code', + :'foreign_tin', + :'address', + :'city', + :'state', + :'zip' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::A1099::V2::IntermediaryOrFlowThroughResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::A1099::V2::IntermediaryOrFlowThroughResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'ein') + self.ein = attributes[:'ein'] + end + + if attributes.key?(:'chap3_status_code') + self.chap3_status_code = attributes[:'chap3_status_code'] + end + + if attributes.key?(:'chap4_status_code') + self.chap4_status_code = attributes[:'chap4_status_code'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'giin') + self.giin = attributes[:'giin'] + end + + if attributes.key?(:'country_code') + self.country_code = attributes[:'country_code'] + end + + if attributes.key?(:'foreign_tin') + self.foreign_tin = attributes[:'foreign_tin'] + end + + if attributes.key?(:'address') + self.address = attributes[:'address'] + end + + if attributes.key?(:'city') + self.city = attributes[:'city'] + end + + if attributes.key?(:'state') + self.state = attributes[:'state'] + end + + if attributes.key?(:'zip') + self.zip = attributes[:'zip'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + ein == o.ein && + chap3_status_code == o.chap3_status_code && + chap4_status_code == o.chap4_status_code && + name == o.name && + giin == o.giin && + country_code == o.country_code && + foreign_tin == o.foreign_tin && + address == o.address && + city == o.city && + state == o.state && + zip == o.zip + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [ein, chap3_status_code, chap4_status_code, name, giin, country_code, foreign_tin, address, city, state, zip].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::A1099::V2.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/A1099/V2/issuer_command.rb b/lib/avalara_sdk/models/A1099/V2/issuer_command.rb index 5833721..2cdd70f 100644 --- a/lib/avalara_sdk/models/A1099/V2/issuer_command.rb +++ b/lib/avalara_sdk/models/A1099/V2/issuer_command.rb @@ -1,7 +1,7 @@ =begin #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) =end diff --git a/lib/avalara_sdk/models/A1099/V2/issuer_response.rb b/lib/avalara_sdk/models/A1099/V2/issuer_response.rb index eb9bc6d..6d70d20 100644 --- a/lib/avalara_sdk/models/A1099/V2/issuer_response.rb +++ b/lib/avalara_sdk/models/A1099/V2/issuer_response.rb @@ -1,7 +1,7 @@ =begin #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) =end diff --git a/lib/avalara_sdk/models/A1099/V2/iw9_form_data_models_one_of.rb b/lib/avalara_sdk/models/A1099/V2/iw9_form_data_models_one_of.rb index de971e6..a15378f 100644 --- a/lib/avalara_sdk/models/A1099/V2/iw9_form_data_models_one_of.rb +++ b/lib/avalara_sdk/models/A1099/V2/iw9_form_data_models_one_of.rb @@ -1,7 +1,7 @@ =begin #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) =end diff --git a/lib/avalara_sdk/models/A1099/V2/job_result.rb b/lib/avalara_sdk/models/A1099/V2/job_result.rb index 9c0fb3f..a8686aa 100644 --- a/lib/avalara_sdk/models/A1099/V2/job_result.rb +++ b/lib/avalara_sdk/models/A1099/V2/job_result.rb @@ -1,7 +1,7 @@ =begin #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) =end @@ -15,36 +15,51 @@ class JobResult attr_accessor :type + # Dry run. If `true`, this job only simulates the changes but doesn't actually persist them. attr_accessor :dry_run + # 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 attr_accessor :upsert + # Status of the job attr_accessor :status attr_accessor :error_message + # Total number of forms processed attr_accessor :total_processed + # Total number of forms in the request attr_accessor :total_rows + # Number of forms updated and valid for e-filing and e-delivery attr_accessor :updated_valid + # Number of forms updated and valid for e-filing but missing email or email is undeliverable attr_accessor :updated_no_email + # Number of forms updated but invalid for e-filing attr_accessor :updated_invalid + # Number of forms skipped because they would have updated a record already updated once in the request attr_accessor :skipped_duplicate + # Number of forms skipped because they would have made a form invalid and the form is already e-filed or scheduled for e-filing attr_accessor :skipped_invalid + # Number of forms skipped because they matched multiple forms attr_accessor :skipped_multiple_matches + # Number of forms skipped because no matching form or issuer could be found attr_accessor :not_found + # Number of new forms created because no matching form could be found (and `upsert` was true) - with errors attr_accessor :created_invalid + # 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 attr_accessor :created_no_email + # Number of new forms created because no matching form could be found (and `upsert` was true) - valid for e-filing and e-delivery attr_accessor :created_valid # Attribute mapping from ruby-style variable name to JSON key. diff --git a/lib/avalara_sdk/models/A1099/V2/link.rb b/lib/avalara_sdk/models/A1099/V2/link.rb index b7c52e1..9615b58 100644 --- a/lib/avalara_sdk/models/A1099/V2/link.rb +++ b/lib/avalara_sdk/models/A1099/V2/link.rb @@ -1,7 +1,7 @@ =begin #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) =end diff --git a/lib/avalara_sdk/models/A1099/V2/paginated_query_result_model.rb b/lib/avalara_sdk/models/A1099/V2/paginated_query_result_model.rb index 4148c31..c423b84 100644 --- a/lib/avalara_sdk/models/A1099/V2/paginated_query_result_model.rb +++ b/lib/avalara_sdk/models/A1099/V2/paginated_query_result_model.rb @@ -1,7 +1,7 @@ =begin #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) =end diff --git a/lib/avalara_sdk/models/A1099/V2/paginated_query_result_model_company_response.rb b/lib/avalara_sdk/models/A1099/V2/paginated_query_result_model_company_response.rb index 77aeaef..0a631f6 100644 --- a/lib/avalara_sdk/models/A1099/V2/paginated_query_result_model_company_response.rb +++ b/lib/avalara_sdk/models/A1099/V2/paginated_query_result_model_company_response.rb @@ -1,7 +1,7 @@ =begin #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) =end diff --git a/lib/avalara_sdk/models/A1099/V2/paginated_query_result_model_issuer_response.rb b/lib/avalara_sdk/models/A1099/V2/paginated_query_result_model_issuer_response.rb index e3fe876..b95372f 100644 --- a/lib/avalara_sdk/models/A1099/V2/paginated_query_result_model_issuer_response.rb +++ b/lib/avalara_sdk/models/A1099/V2/paginated_query_result_model_issuer_response.rb @@ -1,7 +1,7 @@ =begin #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) =end diff --git a/lib/avalara_sdk/models/A1099/V2/paginated_w9_forms_model.rb b/lib/avalara_sdk/models/A1099/V2/paginated_w9_forms_model.rb index 3a7f5a5..51cdc45 100644 --- a/lib/avalara_sdk/models/A1099/V2/paginated_w9_forms_model.rb +++ b/lib/avalara_sdk/models/A1099/V2/paginated_w9_forms_model.rb @@ -1,7 +1,7 @@ =begin #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) =end diff --git a/lib/avalara_sdk/models/A1099/V2/primary_withholding_agent.rb b/lib/avalara_sdk/models/A1099/V2/primary_withholding_agent.rb new file mode 100644 index 0000000..ebeeedb --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/primary_withholding_agent.rb @@ -0,0 +1,221 @@ +=begin +#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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class PrimaryWithholdingAgent + attr_accessor :primary_withholding_agent_name + + attr_accessor :primary_withholding_agent_ein + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'primary_withholding_agent_name' => :'primaryWithholdingAgentName', + :'primary_withholding_agent_ein' => :'primaryWithholdingAgentEin' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'primary_withholding_agent_name' => :'String', + :'primary_withholding_agent_ein' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'primary_withholding_agent_name', + :'primary_withholding_agent_ein' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::A1099::V2::PrimaryWithholdingAgent` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::A1099::V2::PrimaryWithholdingAgent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'primary_withholding_agent_name') + self.primary_withholding_agent_name = attributes[:'primary_withholding_agent_name'] + end + + if attributes.key?(:'primary_withholding_agent_ein') + self.primary_withholding_agent_ein = attributes[:'primary_withholding_agent_ein'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + primary_withholding_agent_name == o.primary_withholding_agent_name && + primary_withholding_agent_ein == o.primary_withholding_agent_ein + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [primary_withholding_agent_name, primary_withholding_agent_ein].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::A1099::V2.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/A1099/V2/primary_withholding_agent_request.rb b/lib/avalara_sdk/models/A1099/V2/primary_withholding_agent_request.rb new file mode 100644 index 0000000..1d42cd9 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/primary_withholding_agent_request.rb @@ -0,0 +1,221 @@ +=begin +#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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class PrimaryWithholdingAgentRequest + attr_accessor :primary_withholding_agent_name + + attr_accessor :primary_withholding_agent_ein + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'primary_withholding_agent_name' => :'primaryWithholdingAgentName', + :'primary_withholding_agent_ein' => :'primaryWithholdingAgentEin' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'primary_withholding_agent_name' => :'String', + :'primary_withholding_agent_ein' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'primary_withholding_agent_name', + :'primary_withholding_agent_ein' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::A1099::V2::PrimaryWithholdingAgentRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::A1099::V2::PrimaryWithholdingAgentRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'primary_withholding_agent_name') + self.primary_withholding_agent_name = attributes[:'primary_withholding_agent_name'] + end + + if attributes.key?(:'primary_withholding_agent_ein') + self.primary_withholding_agent_ein = attributes[:'primary_withholding_agent_ein'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + primary_withholding_agent_name == o.primary_withholding_agent_name && + primary_withholding_agent_ein == o.primary_withholding_agent_ein + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [primary_withholding_agent_name, primary_withholding_agent_ein].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::A1099::V2.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/A1099/V2/primary_withholding_agent_response.rb b/lib/avalara_sdk/models/A1099/V2/primary_withholding_agent_response.rb new file mode 100644 index 0000000..19b909b --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/primary_withholding_agent_response.rb @@ -0,0 +1,221 @@ +=begin +#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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class PrimaryWithholdingAgentResponse + attr_accessor :primary_withholding_agent_name + + attr_accessor :primary_withholding_agent_ein + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'primary_withholding_agent_name' => :'primaryWithholdingAgentName', + :'primary_withholding_agent_ein' => :'primaryWithholdingAgentEin' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'primary_withholding_agent_name' => :'String', + :'primary_withholding_agent_ein' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'primary_withholding_agent_name', + :'primary_withholding_agent_ein' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::A1099::V2::PrimaryWithholdingAgentResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::A1099::V2::PrimaryWithholdingAgentResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'primary_withholding_agent_name') + self.primary_withholding_agent_name = attributes[:'primary_withholding_agent_name'] + end + + if attributes.key?(:'primary_withholding_agent_ein') + self.primary_withholding_agent_ein = attributes[:'primary_withholding_agent_ein'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + primary_withholding_agent_name == o.primary_withholding_agent_name && + primary_withholding_agent_ein == o.primary_withholding_agent_ein + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [primary_withholding_agent_name, primary_withholding_agent_ein].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::A1099::V2.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/A1099/V2/problem_details.rb b/lib/avalara_sdk/models/A1099/V2/problem_details.rb index 739cadd..9abbd34 100644 --- a/lib/avalara_sdk/models/A1099/V2/problem_details.rb +++ b/lib/avalara_sdk/models/A1099/V2/problem_details.rb @@ -1,7 +1,7 @@ =begin #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) =end diff --git a/lib/avalara_sdk/models/A1099/V2/state_and_local_withholding_request.rb b/lib/avalara_sdk/models/A1099/V2/state_and_local_withholding_request.rb index cc741e2..f626c7f 100644 --- a/lib/avalara_sdk/models/A1099/V2/state_and_local_withholding_request.rb +++ b/lib/avalara_sdk/models/A1099/V2/state_and_local_withholding_request.rb @@ -1,7 +1,7 @@ =begin #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) =end @@ -63,7 +63,11 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'state_income', + :'local_tax_withheld', + :'locality', :'locality_id_number', + :'local_income' ]) end diff --git a/lib/avalara_sdk/models/A1099/V2/state_and_local_withholding_response.rb b/lib/avalara_sdk/models/A1099/V2/state_and_local_withholding_response.rb index c3df7ba..e571b42 100644 --- a/lib/avalara_sdk/models/A1099/V2/state_and_local_withholding_response.rb +++ b/lib/avalara_sdk/models/A1099/V2/state_and_local_withholding_response.rb @@ -1,7 +1,7 @@ =begin #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) =end @@ -11,20 +11,28 @@ module AvalaraSdk::A1099::V2 class StateAndLocalWithholdingResponse + # Amount of state tax that was withheld attr_accessor :state_tax_withheld + # US state attr_accessor :state + # State ID number of the entity issuing the form attr_accessor :state_id_number + # Amount of state income attr_accessor :state_income + # Amount of local tax that was withheld attr_accessor :local_tax_withheld + # Locality name attr_accessor :locality + # Locality ID number of the entity issuing the form attr_accessor :locality_id_number + # Amount of local income attr_accessor :local_income # Attribute mapping from ruby-style variable name to JSON key. diff --git a/lib/avalara_sdk/models/A1099/V2/state_efile_status_detail_response.rb b/lib/avalara_sdk/models/A1099/V2/state_efile_status_detail_response.rb new file mode 100644 index 0000000..3667644 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/state_efile_status_detail_response.rb @@ -0,0 +1,231 @@ +=begin +#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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class StateEfileStatusDetailResponse + attr_accessor :status + + attr_accessor :time + + attr_accessor :jurisdiction + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'status' => :'status', + :'time' => :'time', + :'jurisdiction' => :'jurisdiction' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'status' => :'String', + :'time' => :'String', + :'jurisdiction' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'status', + :'time', + :'jurisdiction' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::A1099::V2::StateEfileStatusDetailResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::A1099::V2::StateEfileStatusDetailResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'time') + self.time = attributes[:'time'] + end + + if attributes.key?(:'jurisdiction') + self.jurisdiction = attributes[:'jurisdiction'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + status == o.status && + time == o.time && + jurisdiction == o.jurisdiction + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [status, time, jurisdiction].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::A1099::V2.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/A1099/V2/status_detail.rb b/lib/avalara_sdk/models/A1099/V2/status_detail.rb index 0a1f229..b809ece 100644 --- a/lib/avalara_sdk/models/A1099/V2/status_detail.rb +++ b/lib/avalara_sdk/models/A1099/V2/status_detail.rb @@ -1,7 +1,7 @@ =begin #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) =end diff --git a/lib/avalara_sdk/models/A1099/V2/substantial_us_owner_request.rb b/lib/avalara_sdk/models/A1099/V2/substantial_us_owner_request.rb new file mode 100644 index 0000000..5f03e6c --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/substantial_us_owner_request.rb @@ -0,0 +1,233 @@ +=begin +#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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class SubstantialUsOwnerRequest + # The name of the substantial U.S. owner of the NFFE. + attr_accessor :name + + # The address of the substantial U.S. owner of the NFFE. + attr_accessor :address + + # The taxpayer identification number (TIN) of the substantial U.S. owner of the NFFE. + attr_accessor :tin + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'address' => :'address', + :'tin' => :'tin' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'String', + :'address' => :'String', + :'tin' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'address', + :'tin' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::A1099::V2::SubstantialUsOwnerRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::A1099::V2::SubstantialUsOwnerRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'address') + self.address = attributes[:'address'] + end + + if attributes.key?(:'tin') + self.tin = attributes[:'tin'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + address == o.address && + tin == o.tin + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name, address, tin].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::A1099::V2.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/A1099/V2/substantial_us_owner_response.rb b/lib/avalara_sdk/models/A1099/V2/substantial_us_owner_response.rb index 805bac1..da0d749 100644 --- a/lib/avalara_sdk/models/A1099/V2/substantial_us_owner_response.rb +++ b/lib/avalara_sdk/models/A1099/V2/substantial_us_owner_response.rb @@ -1,7 +1,7 @@ =begin #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) =end diff --git a/lib/avalara_sdk/models/A1099/V2/update1099_form200_response.rb b/lib/avalara_sdk/models/A1099/V2/update1099_form200_response.rb index d1aa231..8c2c5b9 100644 --- a/lib/avalara_sdk/models/A1099/V2/update1099_form200_response.rb +++ b/lib/avalara_sdk/models/A1099/V2/update1099_form200_response.rb @@ -1,7 +1,7 @@ =begin #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) =end @@ -15,6 +15,7 @@ class << self # List of class defined in oneOf (OpenAPI v3) def openapi_one_of [ + :'Form1042SResponse', :'Form1099DivResponse', :'Form1099MiscResponse', :'Form1099NecResponse', diff --git a/lib/avalara_sdk/models/A1099/V2/validation_error_response.rb b/lib/avalara_sdk/models/A1099/V2/validation_error_response.rb new file mode 100644 index 0000000..de7bf12 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/validation_error_response.rb @@ -0,0 +1,231 @@ +=begin +#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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class ValidationErrorResponse + # The field containing the error + attr_accessor :field + + # The list of error messages + attr_accessor :errors + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'field' => :'field', + :'errors' => :'errors' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'field' => :'String', + :'errors' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'field', + :'errors' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::A1099::V2::ValidationErrorResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::A1099::V2::ValidationErrorResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'field') + self.field = attributes[:'field'] + end + + if attributes.key?(:'errors') + if (value = attributes[:'errors']).is_a?(Array) + self.errors = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Custom attribute writer method with validation + # @param [Object] errors Value to be assigned + def errors=(errors) + @errors = errors + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + field == o.field && + errors == o.errors + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [field, errors].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::A1099::V2.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/A1099/V2/w4_form_data_model.rb b/lib/avalara_sdk/models/A1099/V2/w4_form_data_model.rb index 17878e9..65bdec1 100644 --- a/lib/avalara_sdk/models/A1099/V2/w4_form_data_model.rb +++ b/lib/avalara_sdk/models/A1099/V2/w4_form_data_model.rb @@ -1,7 +1,7 @@ =begin #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) =end @@ -971,9 +971,9 @@ def self.openapi_types :'certify_box41' => :'Boolean', :'certify_box43' => :'Boolean', :'certify_part29_signature' => :'Boolean', - :'part19_formation_or_resolution_date' => :'Time', - :'part20_filing_date' => :'Time', - :'part21_determination_date' => :'Time', + :'part19_formation_or_resolution_date' => :'Date', + :'part20_filing_date' => :'Date', + :'part21_determination_date' => :'Date', :'substantial_us_owners' => :'Array', :'birthday' => :'String', :'foreign_tin_not_required' => :'Boolean', @@ -1052,8 +1052,8 @@ def self.openapi_types :'certify_box40' => :'Boolean', :'box41_sponsoring_entity' => :'String', :'certify_box42' => :'Boolean', - :'box35_formed_on_date' => :'Time', - :'box36_filed_on_date' => :'Time', + :'box35_formed_on_date' => :'Date', + :'box36_filed_on_date' => :'Date', :'tin_match_status' => :'String', :'signature' => :'String', :'business_classification' => :'String', diff --git a/lib/avalara_sdk/models/A1099/V2/w4_form_request.rb b/lib/avalara_sdk/models/A1099/V2/w4_form_request.rb new file mode 100644 index 0000000..beaade6 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/w4_form_request.rb @@ -0,0 +1,509 @@ +=begin +#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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class W4FormRequest + # The form type (always \"w4\" for this model). + attr_accessor :type + + # The first name of the employee. + attr_accessor :employee_first_name + + # The middle name of the employee. + attr_accessor :employee_middle_name + + # The last name of the employee. + attr_accessor :employee_last_name + + # The name suffix of the employee. + attr_accessor :employee_name_suffix + + # The type of TIN provided. + attr_accessor :tin_type + + # The taxpayer identification number (TIN). + attr_accessor :tin + + # The address of the employee. + attr_accessor :address + + # The city of residence of the employee. + attr_accessor :city + + # The state of residence of the employee. + attr_accessor :state + + # The ZIP code of residence of the employee. + attr_accessor :zip + + # The marital status of the employee. + attr_accessor :marital_status + + # Indicates whether the last name differs from prior records. + attr_accessor :last_name_differs + + # The number of allowances claimed by the employee. + attr_accessor :num_allowances + + # The number of dependents other than allowances. + attr_accessor :other_dependents + + # The amount of non-job income. + attr_accessor :non_job_income + + # The amount of deductions claimed. + attr_accessor :deductions + + # The additional amount withheld. + attr_accessor :additional_withheld + + # Indicates whether the employee is exempt from withholding. + attr_accessor :exempt_from_withholding + + # The office code associated with the form. + attr_accessor :office_code + + # The ID of the associated company. + attr_accessor :company_id + + # A reference identifier for the form. + attr_accessor :reference_id + + # The email address of the individual associated with the form. + attr_accessor :email + + # The date when e-delivery was consented. + attr_accessor :e_delivery_consented_at + + # The signature of the form. + attr_accessor :signature + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'employee_first_name' => :'employeeFirstName', + :'employee_middle_name' => :'employeeMiddleName', + :'employee_last_name' => :'employeeLastName', + :'employee_name_suffix' => :'employeeNameSuffix', + :'tin_type' => :'tinType', + :'tin' => :'tin', + :'address' => :'address', + :'city' => :'city', + :'state' => :'state', + :'zip' => :'zip', + :'marital_status' => :'maritalStatus', + :'last_name_differs' => :'lastNameDiffers', + :'num_allowances' => :'numAllowances', + :'other_dependents' => :'otherDependents', + :'non_job_income' => :'nonJobIncome', + :'deductions' => :'deductions', + :'additional_withheld' => :'additionalWithheld', + :'exempt_from_withholding' => :'exemptFromWithholding', + :'office_code' => :'officeCode', + :'company_id' => :'companyId', + :'reference_id' => :'referenceId', + :'email' => :'email', + :'e_delivery_consented_at' => :'eDeliveryConsentedAt', + :'signature' => :'signature' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'String', + :'employee_first_name' => :'String', + :'employee_middle_name' => :'String', + :'employee_last_name' => :'String', + :'employee_name_suffix' => :'String', + :'tin_type' => :'String', + :'tin' => :'String', + :'address' => :'String', + :'city' => :'String', + :'state' => :'String', + :'zip' => :'String', + :'marital_status' => :'String', + :'last_name_differs' => :'Boolean', + :'num_allowances' => :'Integer', + :'other_dependents' => :'Integer', + :'non_job_income' => :'Float', + :'deductions' => :'Float', + :'additional_withheld' => :'Float', + :'exempt_from_withholding' => :'Boolean', + :'office_code' => :'String', + :'company_id' => :'String', + :'reference_id' => :'String', + :'email' => :'String', + :'e_delivery_consented_at' => :'Time', + :'signature' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'employee_middle_name', + :'employee_name_suffix', + :'address', + :'city', + :'state', + :'zip', + :'marital_status', + :'num_allowances', + :'other_dependents', + :'non_job_income', + :'deductions', + :'additional_withheld', + :'office_code', + :'reference_id', + :'email', + :'e_delivery_consented_at', + :'signature' + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'W9FormBaseRequest' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::A1099::V2::W4FormRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::A1099::V2::W4FormRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'employee_first_name') + self.employee_first_name = attributes[:'employee_first_name'] + end + + if attributes.key?(:'employee_middle_name') + self.employee_middle_name = attributes[:'employee_middle_name'] + end + + if attributes.key?(:'employee_last_name') + self.employee_last_name = attributes[:'employee_last_name'] + end + + if attributes.key?(:'employee_name_suffix') + self.employee_name_suffix = attributes[:'employee_name_suffix'] + end + + if attributes.key?(:'tin_type') + self.tin_type = attributes[:'tin_type'] + end + + if attributes.key?(:'tin') + self.tin = attributes[:'tin'] + end + + if attributes.key?(:'address') + self.address = attributes[:'address'] + end + + if attributes.key?(:'city') + self.city = attributes[:'city'] + end + + if attributes.key?(:'state') + self.state = attributes[:'state'] + end + + if attributes.key?(:'zip') + self.zip = attributes[:'zip'] + end + + if attributes.key?(:'marital_status') + self.marital_status = attributes[:'marital_status'] + end + + if attributes.key?(:'last_name_differs') + self.last_name_differs = attributes[:'last_name_differs'] + end + + if attributes.key?(:'num_allowances') + self.num_allowances = attributes[:'num_allowances'] + end + + if attributes.key?(:'other_dependents') + self.other_dependents = attributes[:'other_dependents'] + end + + if attributes.key?(:'non_job_income') + self.non_job_income = attributes[:'non_job_income'] + end + + if attributes.key?(:'deductions') + self.deductions = attributes[:'deductions'] + end + + if attributes.key?(:'additional_withheld') + self.additional_withheld = attributes[:'additional_withheld'] + end + + if attributes.key?(:'exempt_from_withholding') + self.exempt_from_withholding = attributes[:'exempt_from_withholding'] + end + + if attributes.key?(:'office_code') + self.office_code = attributes[:'office_code'] + end + + if attributes.key?(:'company_id') + self.company_id = attributes[:'company_id'] + end + + if attributes.key?(:'reference_id') + self.reference_id = attributes[:'reference_id'] + end + + if attributes.key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.key?(:'e_delivery_consented_at') + self.e_delivery_consented_at = attributes[:'e_delivery_consented_at'] + end + + if attributes.key?(:'signature') + self.signature = attributes[:'signature'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + type_validator = EnumAttributeValidator.new('String', ["W4", "W8Ben", "W8BenE", "W8Imy", "W9"]) + return false unless type_validator.valid?(@type) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["W4", "W8Ben", "W8BenE", "W8Imy", "W9"]) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + employee_first_name == o.employee_first_name && + employee_middle_name == o.employee_middle_name && + employee_last_name == o.employee_last_name && + employee_name_suffix == o.employee_name_suffix && + tin_type == o.tin_type && + tin == o.tin && + address == o.address && + city == o.city && + state == o.state && + zip == o.zip && + marital_status == o.marital_status && + last_name_differs == o.last_name_differs && + num_allowances == o.num_allowances && + other_dependents == o.other_dependents && + non_job_income == o.non_job_income && + deductions == o.deductions && + additional_withheld == o.additional_withheld && + exempt_from_withholding == o.exempt_from_withholding && + office_code == o.office_code && + company_id == o.company_id && + reference_id == o.reference_id && + email == o.email && + e_delivery_consented_at == o.e_delivery_consented_at && + signature == o.signature + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, employee_first_name, employee_middle_name, employee_last_name, employee_name_suffix, tin_type, tin, address, city, state, zip, marital_status, last_name_differs, num_allowances, other_dependents, non_job_income, deductions, additional_withheld, exempt_from_withholding, office_code, company_id, reference_id, email, e_delivery_consented_at, signature].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::A1099::V2.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/A1099/V2/w4_form_response.rb b/lib/avalara_sdk/models/A1099/V2/w4_form_response.rb index e437c9f..f691318 100644 --- a/lib/avalara_sdk/models/A1099/V2/w4_form_response.rb +++ b/lib/avalara_sdk/models/A1099/V2/w4_form_response.rb @@ -1,7 +1,7 @@ =begin #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) =end diff --git a/lib/avalara_sdk/models/A1099/V2/w8_ben_e_form_request.rb b/lib/avalara_sdk/models/A1099/V2/w8_ben_e_form_request.rb new file mode 100644 index 0000000..34f1915 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/w8_ben_e_form_request.rb @@ -0,0 +1,1343 @@ +=begin +#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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class W8BenEFormRequest + # The form type (always \"w8bene\" for this model). + attr_accessor :type + + # The name of the individual or entity associated with the form. + attr_accessor :name + + # The country of citizenship. + attr_accessor :citizenship_country + + # The name of the disregarded entity receiving the payment (if applicable). + attr_accessor :disregarded_entity + + # The entity type. + attr_accessor :entity_type + + # Indicates whether the entity is making a treaty claim. + attr_accessor :making_treaty_claim + + # The FATCA status. + attr_accessor :fatca_status + + # The residential address of the individual or entity. + attr_accessor :residence_address + + # The city of residence. + attr_accessor :residence_city + + # The state of residence. + attr_accessor :residence_state + + # The ZIP code of the residence. + attr_accessor :residence_zip + + # The country of residence. + attr_accessor :residence_country + + # Indicates whether the residence address is also the mailing address. + attr_accessor :residence_is_mailing + + # The mailing address. + attr_accessor :mailing_address + + # The city of the mailing address. + attr_accessor :mailing_city + + # The state of the mailing address. + attr_accessor :mailing_state + + # The ZIP code of the mailing address. + attr_accessor :mailing_zip + + # The country of the mailing address. + attr_accessor :mailing_country + + # The taxpayer identification number (TIN). + attr_accessor :tin + + # The global intermediary identification number (GIIN). + attr_accessor :giin + + # Indicates whether a foreign TIN is not required. + attr_accessor :foreign_tin_not_required + + # The foreign taxpayer identification number (TIN). + attr_accessor :foreign_tin + + # A reference number for the form. + attr_accessor :reference_number + + # The FATCA status of disregarded entity or branch receiving payment. + attr_accessor :disregarded_entity_fatca_status + + # The address for disregarded entities. + attr_accessor :disregarded_address + + # The city for disregarded entities. + attr_accessor :disregarded_city + + # The state for disregarded entities. + attr_accessor :disregarded_state + + # The ZIP code for disregarded entities. + attr_accessor :disregarded_zip + + # The country for disregarded entities. + attr_accessor :disregarded_country + + # The GIIN for disregarded entities. + attr_accessor :disregarded_entity_giin + + # Certifies the beneficial owner's country under the U.S. tax treaty. + attr_accessor :treaty_country_certification + + # The treaty country of the beneficial owner. + attr_accessor :treaty_country + + # Certifies that the beneficial owner is eligible for treaty benefits and meets any limitation on benefits requirements. + attr_accessor :benefit_limitation_certification + + # The benefit limitation for tax treaty claims. + attr_accessor :benefit_limitation + + # Certifies that the beneficial owner claims treaty benefits and meets the qualified resident status for specific U.S. source income. + attr_accessor :qualified_resident_status_certification + + # Indicates the specific article and paragraph of the tax treaty under which the beneficial owner is claiming benefits. + attr_accessor :treaty_article + + # Specifies the reduced withholding rate claimed under the applicable tax treaty. + attr_accessor :withholding_rate + + # Specifies the type of income for which the reduced treaty withholding rate is being claimed. + attr_accessor :income_type + + # The additional conditions in the article the beneficial owner meets to be eligible for the rate of withholding. + attr_accessor :treaty_reasons + + # The name of the entity that sponsors the foreign financial institution (FFI). + attr_accessor :ffi_sponsoring_entity + + # Certifies that the entity is an investment entity, not a QI, WP, or WT, and has an agreement with a sponsoring entity. + attr_accessor :investment_entity_certification + + # Certifies that the entity is a controlled foreign corporation sponsored by a U.S. financial institution, not a QI, WP, or WT, and shares a common electronic account system for full transparency. + attr_accessor :controlled_foreign_corporation_certification + + # Certifies that the FFI operates solely as a limited bank or credit union within its country, meets asset thresholds, and has no foreign operations or affiliations outside its country of organization. + attr_accessor :compliant_nonregistering_local_bank_certification + + # Certifies that the FFI is not primarily engaged in investment activities, maintains only low-value accounts, and has limited total assets within its group. + attr_accessor :compliant_ffi_low_value_accounts_certification + + # The name of sponsoring entity for a certified deemed-compliant, closely held investment vehicle. + attr_accessor :sponsored_closely_held_entity_sponsoring_entity + + # Certifies that the entity is a sponsored investment entity with 20 or fewer individual owners, and that all compliance obligations are fulfilled by the sponsoring entity. + attr_accessor :sponsored_closely_held_investment_vehicle_certification + + # Certifies that the entity qualifies as a limited life debt investment entity based on its formation date, issuance terms, and compliance with regulatory requirements. + attr_accessor :compliant_limited_life_debt_entity_certification + + # Certifies that the entity is a financial institution solely because it is an investment entity under regulations and the entity does not maintain financial accounts. + attr_accessor :investment_entity_no_financial_accounts_certification + + # Certifies that the FFI meets all requirements to qualify as an owner-documented FFI, including restrictions on activities, ownership, and account relationships. + attr_accessor :owner_documented_ffi_certification + + # Certifies that the FFI will provide a complete owner reporting statement and required documentation for each relevant owner or debt holder. + attr_accessor :owner_documented_ffi_reporting_statement_certification + + # Certifies that the FFI will provide an auditor’s letter and required owner reporting documentation to confirm its status as an owner-documented FFI. + attr_accessor :owner_documented_ffi_auditor_letter_certification + + # Certifies that the trust has no contingent or unidentified beneficiaries or designated classes of beneficiaries. + attr_accessor :owner_documented_ffi_trust_beneficiaries_certification + + # Certifies that the entity qualifies as a restricted distributor based on its operations, customer base, regulatory compliance, and financial and geographic limitations. + attr_accessor :restricted_distributor_certification + + # Certifies that the entity is, and has been, bound by distribution agreements prohibiting sales of fund interests to specified U.S. persons and certain non-U.S. entities. + attr_accessor :restricted_distributor_agreement_certification + + # Certifies that the entity complies with distribution restrictions for U.S.-linked investors and has addressed any preexisting sales in accordance with FATCA regulations. + attr_accessor :restricted_distributor_preexisting_sales_compliance_certification + + # Certifies that the entity meets the requirements to be considered a nonreporting financial institution to an applicable IGA. + attr_accessor :nonreporting_iga_ffi_certification + + # The country for the applicable IGA with the United States. + attr_accessor :iga_country + + # The applicable IGA model. + attr_accessor :iga_model + + # Specifies how the applicable IGA is treated under the IGA provisions or Treasury regulations. + attr_accessor :iga_legal_status_treatment + + # The trustee or sponsor name for the nonreporting IGA FFI. + attr_accessor :iga_ffi_trustee_or_sponsor + + # Indicates whether the trustee for the nonreporting IGA FFI is foreign. + attr_accessor :iga_ffi_trustee_is_foreign + + # Certifies that the entity is the beneficial owner and is not engaged in commercial financial activities related to the specified payments, accounts or obligations for which this form is submitted. + attr_accessor :non_commercial_financial_activity_certification + + # Certifies that the entity is an international organization described in section 7701(a)(18). + attr_accessor :internation_organization_certification + + # Certifies that the entity is an intergovernmental or supranational organization primarily comprised of foreign governments, is the beneficial owner, and is not engaged in commercial financial activities. + attr_accessor :intergovernmental_organization_certification + + # Certifies that the entity is a pension or retirement fund established in a treaty country and is entitled to treaty benefits on U.S. source income. + attr_accessor :treaty_qualified_pension_fund_certification + + # Certifies that the entity is a government-regulated retirement fund meeting specific requirements for contributions, tax exemption, beneficiary limits, and distribution restrictions. + attr_accessor :qualified_retirement_fund_certification + + # Certifies that the entity is a government-regulated retirement fund with fewer than 50 participants, limited foreign ownership, and employer sponsorship that is not from investment entities or passive NFFEs. + attr_accessor :narrow_participation_retirement_fund_certification + + # Certifies that the entity is formed under a pension plan meeting section 401(a) requirements, except for being U.S.-trust funded. + attr_accessor :section401_a_equivalent_pension_plan_certification + + # Certifies that the entity is established solely to earn income for the benefit of qualifying retirement funds or accounts under applicable FATCA regulations or IGAs. + attr_accessor :investment_entity_for_retirement_funds_certification + + # Certifies that the entity is established and sponsored by a qualifying exempt beneficial owner to provide retirement, disability, or death benefits to individuals based on services performed for the sponsor. + attr_accessor :exempt_beneficial_owner_sponsored_retirement_fund_certification + + # Certifies that the entity is an investment entity wholly owned by exempt beneficial owners and has provided complete ownership and documentation details as required under FATCA regulations. + attr_accessor :exempt_beneficial_owner_owned_investment_entity_certification + + # Certifies that the entity is a financial institution (other than an investment entity) that is incorporated or organized under the laws of a possession of the United States. + attr_accessor :territory_financial_institution_certification + + # Certifies that the entity is a holding company, treasury center, or captive finance company operating within a nonfinancial group and not functioning as an investment or financial institution. + attr_accessor :excepted_nonfinancial_group_entity_certification + + # Certifies that the entity is a recently formed startup NFFE investing in a non-financial business and is not operating as or presenting itself as an investment fund. + attr_accessor :excepted_nonfinancial_start_up_certification + + # The date the start-up company was formed on (or, in case of new line of business, the date of board resolution approving the new line of business). + attr_accessor :startup_formation_or_resolution_date + + # Certifies that the entity is in liquidation, reorganization, or bankruptcy and intends to operate as a nonfinancial entity, with supporting documentation available if the process exceeds three years. + attr_accessor :excepted_nonfinancial_entity_in_liquidation_or_bankruptcy_certification + + # The filed date for a plan of reorganization, liquidation or bankruptcy. + attr_accessor :nonfinancial_entity_filing_date + + # Certifies that the entity is a section 501(c) organization based on a valid IRS determination letter or a legal opinion from U.S. counsel. + attr_accessor :section501_c_organization_certification + + # The date of the IRS determination letter confirming the entity’s section 501(c) status. + attr_accessor :determination_letter_date + + # Certifies that the entity is a nonprofit organization established for charitable or similar purposes, exempt from income tax, and restricted in the use and distribution of its assets under applicable law. + attr_accessor :nonprofit_organization_certification + + # Certifies that the entity is a foreign corporation that is not a financial institution and whose stock is regularly traded on an established securities market. + attr_accessor :publicly_traded_nffe_certification + + # The name of the securities market where the corporation's stock is regularly traded. + attr_accessor :publicly_traded_nffe_securities_market + + # Certifies that the entity is a foreign corporation that is not a financial institution and is affiliated with a publicly traded entity within the same expanded affiliated group. + attr_accessor :nffe_affiliate_of_publicly_traded_entity_certification + + # The name of the affiliated entity whose stock is regularly traded on an established securities market. + attr_accessor :publicly_traded_entity + + # The name of the established securities market where the affiliated entity's stock is traded. + attr_accessor :nffe_affiliate_of_publicly_traded_entity_securities_market + + # Certifies that the entity is organized in a U.S. possession, is not engaged in financial activities, and is entirely owned by bona fide residents of that possession. + attr_accessor :excepted_territory_nffe_certification + + # Certifies that the entity is a foreign non-financial institution with less than 50% passive income and less than 50% of its assets producing or held to produce passive income. + attr_accessor :active_nffe_certification + + # Certifies that the entity is a foreign non-financial entity that does not qualify for any other NFFE category and is not a financial institution. + attr_accessor :passive_nffe_certification + + # Certifies that the passive NFFE has no substantial U.S. owners or controlling U.S. persons. + attr_accessor :passive_nffe_no_substantial_us_owners_certification + + # Certifies that the passive NFFE has provided the name, address, and TIN of each substantial U.S. owner or controlling U.S. person. + attr_accessor :passive_nffe_substantial_us_owners_provided_certification + + # Certifies that the entity is an inter-affiliate FFI meeting all conditions for exemption, including limited account activity and payment interactions within its expanded affiliated group. + attr_accessor :excepted_inter_affiliate_ffi_certification + + # Certifies that the entity is a sponsored direct reporting NFFE. + attr_accessor :sponsored_direct_reporting_nffe_certification + + # The name of the entity that sponsors the direct reporting NFFE. + attr_accessor :direct_reporting_nffe_sponsoring_entity + + # The list of substantial U.S. owners of passive NFFE. + attr_accessor :substantial_us_owners + + # The name of the signer. + attr_accessor :signer_name + + # Certifies signer has the capacity to sign for the beneficial owner. + attr_accessor :capacity_to_sign_certification + + # The ID of the associated company. + attr_accessor :company_id + + # A reference identifier for the form. + attr_accessor :reference_id + + # The email address of the individual associated with the form. + attr_accessor :email + + # The date when e-delivery was consented. + attr_accessor :e_delivery_consented_at + + # The signature of the form. + attr_accessor :signature + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'name' => :'name', + :'citizenship_country' => :'citizenshipCountry', + :'disregarded_entity' => :'disregardedEntity', + :'entity_type' => :'entityType', + :'making_treaty_claim' => :'makingTreatyClaim', + :'fatca_status' => :'fatcaStatus', + :'residence_address' => :'residenceAddress', + :'residence_city' => :'residenceCity', + :'residence_state' => :'residenceState', + :'residence_zip' => :'residenceZip', + :'residence_country' => :'residenceCountry', + :'residence_is_mailing' => :'residenceIsMailing', + :'mailing_address' => :'mailingAddress', + :'mailing_city' => :'mailingCity', + :'mailing_state' => :'mailingState', + :'mailing_zip' => :'mailingZip', + :'mailing_country' => :'mailingCountry', + :'tin' => :'tin', + :'giin' => :'giin', + :'foreign_tin_not_required' => :'foreignTinNotRequired', + :'foreign_tin' => :'foreignTin', + :'reference_number' => :'referenceNumber', + :'disregarded_entity_fatca_status' => :'disregardedEntityFatcaStatus', + :'disregarded_address' => :'disregardedAddress', + :'disregarded_city' => :'disregardedCity', + :'disregarded_state' => :'disregardedState', + :'disregarded_zip' => :'disregardedZip', + :'disregarded_country' => :'disregardedCountry', + :'disregarded_entity_giin' => :'disregardedEntityGiin', + :'treaty_country_certification' => :'treatyCountryCertification', + :'treaty_country' => :'treatyCountry', + :'benefit_limitation_certification' => :'benefitLimitationCertification', + :'benefit_limitation' => :'benefitLimitation', + :'qualified_resident_status_certification' => :'qualifiedResidentStatusCertification', + :'treaty_article' => :'treatyArticle', + :'withholding_rate' => :'withholdingRate', + :'income_type' => :'incomeType', + :'treaty_reasons' => :'treatyReasons', + :'ffi_sponsoring_entity' => :'ffiSponsoringEntity', + :'investment_entity_certification' => :'investmentEntityCertification', + :'controlled_foreign_corporation_certification' => :'controlledForeignCorporationCertification', + :'compliant_nonregistering_local_bank_certification' => :'compliantNonregisteringLocalBankCertification', + :'compliant_ffi_low_value_accounts_certification' => :'compliantFfiLowValueAccountsCertification', + :'sponsored_closely_held_entity_sponsoring_entity' => :'sponsoredCloselyHeldEntitySponsoringEntity', + :'sponsored_closely_held_investment_vehicle_certification' => :'sponsoredCloselyHeldInvestmentVehicleCertification', + :'compliant_limited_life_debt_entity_certification' => :'compliantLimitedLifeDebtEntityCertification', + :'investment_entity_no_financial_accounts_certification' => :'investmentEntityNoFinancialAccountsCertification', + :'owner_documented_ffi_certification' => :'ownerDocumentedFfiCertification', + :'owner_documented_ffi_reporting_statement_certification' => :'ownerDocumentedFfiReportingStatementCertification', + :'owner_documented_ffi_auditor_letter_certification' => :'ownerDocumentedFfiAuditorLetterCertification', + :'owner_documented_ffi_trust_beneficiaries_certification' => :'ownerDocumentedFfiTrustBeneficiariesCertification', + :'restricted_distributor_certification' => :'restrictedDistributorCertification', + :'restricted_distributor_agreement_certification' => :'restrictedDistributorAgreementCertification', + :'restricted_distributor_preexisting_sales_compliance_certification' => :'restrictedDistributorPreexistingSalesComplianceCertification', + :'nonreporting_iga_ffi_certification' => :'nonreportingIgaFfiCertification', + :'iga_country' => :'igaCountry', + :'iga_model' => :'igaModel', + :'iga_legal_status_treatment' => :'igaLegalStatusTreatment', + :'iga_ffi_trustee_or_sponsor' => :'igaFfiTrusteeOrSponsor', + :'iga_ffi_trustee_is_foreign' => :'igaFfiTrusteeIsForeign', + :'non_commercial_financial_activity_certification' => :'nonCommercialFinancialActivityCertification', + :'internation_organization_certification' => :'internationOrganizationCertification', + :'intergovernmental_organization_certification' => :'intergovernmentalOrganizationCertification', + :'treaty_qualified_pension_fund_certification' => :'treatyQualifiedPensionFundCertification', + :'qualified_retirement_fund_certification' => :'qualifiedRetirementFundCertification', + :'narrow_participation_retirement_fund_certification' => :'narrowParticipationRetirementFundCertification', + :'section401_a_equivalent_pension_plan_certification' => :'section401AEquivalentPensionPlanCertification', + :'investment_entity_for_retirement_funds_certification' => :'investmentEntityForRetirementFundsCertification', + :'exempt_beneficial_owner_sponsored_retirement_fund_certification' => :'exemptBeneficialOwnerSponsoredRetirementFundCertification', + :'exempt_beneficial_owner_owned_investment_entity_certification' => :'exemptBeneficialOwnerOwnedInvestmentEntityCertification', + :'territory_financial_institution_certification' => :'territoryFinancialInstitutionCertification', + :'excepted_nonfinancial_group_entity_certification' => :'exceptedNonfinancialGroupEntityCertification', + :'excepted_nonfinancial_start_up_certification' => :'exceptedNonfinancialStartUpCertification', + :'startup_formation_or_resolution_date' => :'startupFormationOrResolutionDate', + :'excepted_nonfinancial_entity_in_liquidation_or_bankruptcy_certification' => :'exceptedNonfinancialEntityInLiquidationOrBankruptcyCertification', + :'nonfinancial_entity_filing_date' => :'nonfinancialEntityFilingDate', + :'section501_c_organization_certification' => :'section501COrganizationCertification', + :'determination_letter_date' => :'determinationLetterDate', + :'nonprofit_organization_certification' => :'nonprofitOrganizationCertification', + :'publicly_traded_nffe_certification' => :'publiclyTradedNffeCertification', + :'publicly_traded_nffe_securities_market' => :'publiclyTradedNffeSecuritiesMarket', + :'nffe_affiliate_of_publicly_traded_entity_certification' => :'nffeAffiliateOfPubliclyTradedEntityCertification', + :'publicly_traded_entity' => :'publiclyTradedEntity', + :'nffe_affiliate_of_publicly_traded_entity_securities_market' => :'nffeAffiliateOfPubliclyTradedEntitySecuritiesMarket', + :'excepted_territory_nffe_certification' => :'exceptedTerritoryNffeCertification', + :'active_nffe_certification' => :'activeNffeCertification', + :'passive_nffe_certification' => :'passiveNffeCertification', + :'passive_nffe_no_substantial_us_owners_certification' => :'passiveNffeNoSubstantialUsOwnersCertification', + :'passive_nffe_substantial_us_owners_provided_certification' => :'passiveNffeSubstantialUsOwnersProvidedCertification', + :'excepted_inter_affiliate_ffi_certification' => :'exceptedInterAffiliateFfiCertification', + :'sponsored_direct_reporting_nffe_certification' => :'sponsoredDirectReportingNffeCertification', + :'direct_reporting_nffe_sponsoring_entity' => :'directReportingNffeSponsoringEntity', + :'substantial_us_owners' => :'substantialUsOwners', + :'signer_name' => :'signerName', + :'capacity_to_sign_certification' => :'capacityToSignCertification', + :'company_id' => :'companyId', + :'reference_id' => :'referenceId', + :'email' => :'email', + :'e_delivery_consented_at' => :'eDeliveryConsentedAt', + :'signature' => :'signature' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'String', + :'name' => :'String', + :'citizenship_country' => :'String', + :'disregarded_entity' => :'String', + :'entity_type' => :'String', + :'making_treaty_claim' => :'Boolean', + :'fatca_status' => :'String', + :'residence_address' => :'String', + :'residence_city' => :'String', + :'residence_state' => :'String', + :'residence_zip' => :'String', + :'residence_country' => :'String', + :'residence_is_mailing' => :'Boolean', + :'mailing_address' => :'String', + :'mailing_city' => :'String', + :'mailing_state' => :'String', + :'mailing_zip' => :'String', + :'mailing_country' => :'String', + :'tin' => :'String', + :'giin' => :'String', + :'foreign_tin_not_required' => :'Boolean', + :'foreign_tin' => :'String', + :'reference_number' => :'String', + :'disregarded_entity_fatca_status' => :'String', + :'disregarded_address' => :'String', + :'disregarded_city' => :'String', + :'disregarded_state' => :'String', + :'disregarded_zip' => :'String', + :'disregarded_country' => :'String', + :'disregarded_entity_giin' => :'String', + :'treaty_country_certification' => :'Boolean', + :'treaty_country' => :'String', + :'benefit_limitation_certification' => :'Boolean', + :'benefit_limitation' => :'String', + :'qualified_resident_status_certification' => :'Boolean', + :'treaty_article' => :'String', + :'withholding_rate' => :'String', + :'income_type' => :'String', + :'treaty_reasons' => :'String', + :'ffi_sponsoring_entity' => :'String', + :'investment_entity_certification' => :'Boolean', + :'controlled_foreign_corporation_certification' => :'Boolean', + :'compliant_nonregistering_local_bank_certification' => :'Boolean', + :'compliant_ffi_low_value_accounts_certification' => :'Boolean', + :'sponsored_closely_held_entity_sponsoring_entity' => :'String', + :'sponsored_closely_held_investment_vehicle_certification' => :'Boolean', + :'compliant_limited_life_debt_entity_certification' => :'Boolean', + :'investment_entity_no_financial_accounts_certification' => :'Boolean', + :'owner_documented_ffi_certification' => :'Boolean', + :'owner_documented_ffi_reporting_statement_certification' => :'Boolean', + :'owner_documented_ffi_auditor_letter_certification' => :'Boolean', + :'owner_documented_ffi_trust_beneficiaries_certification' => :'Boolean', + :'restricted_distributor_certification' => :'Boolean', + :'restricted_distributor_agreement_certification' => :'Boolean', + :'restricted_distributor_preexisting_sales_compliance_certification' => :'Boolean', + :'nonreporting_iga_ffi_certification' => :'Boolean', + :'iga_country' => :'String', + :'iga_model' => :'String', + :'iga_legal_status_treatment' => :'String', + :'iga_ffi_trustee_or_sponsor' => :'String', + :'iga_ffi_trustee_is_foreign' => :'Boolean', + :'non_commercial_financial_activity_certification' => :'Boolean', + :'internation_organization_certification' => :'Boolean', + :'intergovernmental_organization_certification' => :'Boolean', + :'treaty_qualified_pension_fund_certification' => :'Boolean', + :'qualified_retirement_fund_certification' => :'Boolean', + :'narrow_participation_retirement_fund_certification' => :'Boolean', + :'section401_a_equivalent_pension_plan_certification' => :'Boolean', + :'investment_entity_for_retirement_funds_certification' => :'Boolean', + :'exempt_beneficial_owner_sponsored_retirement_fund_certification' => :'Boolean', + :'exempt_beneficial_owner_owned_investment_entity_certification' => :'Boolean', + :'territory_financial_institution_certification' => :'Boolean', + :'excepted_nonfinancial_group_entity_certification' => :'Boolean', + :'excepted_nonfinancial_start_up_certification' => :'Boolean', + :'startup_formation_or_resolution_date' => :'Date', + :'excepted_nonfinancial_entity_in_liquidation_or_bankruptcy_certification' => :'Boolean', + :'nonfinancial_entity_filing_date' => :'Date', + :'section501_c_organization_certification' => :'Boolean', + :'determination_letter_date' => :'Date', + :'nonprofit_organization_certification' => :'Boolean', + :'publicly_traded_nffe_certification' => :'Boolean', + :'publicly_traded_nffe_securities_market' => :'String', + :'nffe_affiliate_of_publicly_traded_entity_certification' => :'Boolean', + :'publicly_traded_entity' => :'String', + :'nffe_affiliate_of_publicly_traded_entity_securities_market' => :'String', + :'excepted_territory_nffe_certification' => :'Boolean', + :'active_nffe_certification' => :'Boolean', + :'passive_nffe_certification' => :'Boolean', + :'passive_nffe_no_substantial_us_owners_certification' => :'Boolean', + :'passive_nffe_substantial_us_owners_provided_certification' => :'Boolean', + :'excepted_inter_affiliate_ffi_certification' => :'Boolean', + :'sponsored_direct_reporting_nffe_certification' => :'Boolean', + :'direct_reporting_nffe_sponsoring_entity' => :'String', + :'substantial_us_owners' => :'Array', + :'signer_name' => :'String', + :'capacity_to_sign_certification' => :'Boolean', + :'company_id' => :'String', + :'reference_id' => :'String', + :'email' => :'String', + :'e_delivery_consented_at' => :'Time', + :'signature' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'disregarded_entity', + :'making_treaty_claim', + :'residence_state', + :'mailing_address', + :'mailing_city', + :'mailing_state', + :'mailing_zip', + :'mailing_country', + :'tin', + :'giin', + :'foreign_tin_not_required', + :'foreign_tin', + :'reference_number', + :'disregarded_entity_fatca_status', + :'disregarded_address', + :'disregarded_city', + :'disregarded_state', + :'disregarded_zip', + :'disregarded_country', + :'disregarded_entity_giin', + :'treaty_country_certification', + :'treaty_country', + :'benefit_limitation_certification', + :'benefit_limitation', + :'qualified_resident_status_certification', + :'treaty_article', + :'withholding_rate', + :'income_type', + :'treaty_reasons', + :'ffi_sponsoring_entity', + :'investment_entity_certification', + :'controlled_foreign_corporation_certification', + :'compliant_nonregistering_local_bank_certification', + :'compliant_ffi_low_value_accounts_certification', + :'sponsored_closely_held_entity_sponsoring_entity', + :'sponsored_closely_held_investment_vehicle_certification', + :'compliant_limited_life_debt_entity_certification', + :'investment_entity_no_financial_accounts_certification', + :'owner_documented_ffi_certification', + :'owner_documented_ffi_reporting_statement_certification', + :'owner_documented_ffi_auditor_letter_certification', + :'owner_documented_ffi_trust_beneficiaries_certification', + :'restricted_distributor_certification', + :'restricted_distributor_agreement_certification', + :'restricted_distributor_preexisting_sales_compliance_certification', + :'nonreporting_iga_ffi_certification', + :'iga_country', + :'iga_model', + :'iga_legal_status_treatment', + :'iga_ffi_trustee_or_sponsor', + :'iga_ffi_trustee_is_foreign', + :'non_commercial_financial_activity_certification', + :'internation_organization_certification', + :'intergovernmental_organization_certification', + :'treaty_qualified_pension_fund_certification', + :'qualified_retirement_fund_certification', + :'narrow_participation_retirement_fund_certification', + :'section401_a_equivalent_pension_plan_certification', + :'investment_entity_for_retirement_funds_certification', + :'exempt_beneficial_owner_sponsored_retirement_fund_certification', + :'exempt_beneficial_owner_owned_investment_entity_certification', + :'territory_financial_institution_certification', + :'excepted_nonfinancial_group_entity_certification', + :'excepted_nonfinancial_start_up_certification', + :'startup_formation_or_resolution_date', + :'excepted_nonfinancial_entity_in_liquidation_or_bankruptcy_certification', + :'nonfinancial_entity_filing_date', + :'section501_c_organization_certification', + :'determination_letter_date', + :'nonprofit_organization_certification', + :'publicly_traded_nffe_certification', + :'publicly_traded_nffe_securities_market', + :'nffe_affiliate_of_publicly_traded_entity_certification', + :'publicly_traded_entity', + :'nffe_affiliate_of_publicly_traded_entity_securities_market', + :'excepted_territory_nffe_certification', + :'active_nffe_certification', + :'passive_nffe_certification', + :'passive_nffe_no_substantial_us_owners_certification', + :'passive_nffe_substantial_us_owners_provided_certification', + :'excepted_inter_affiliate_ffi_certification', + :'sponsored_direct_reporting_nffe_certification', + :'direct_reporting_nffe_sponsoring_entity', + :'signer_name', + :'capacity_to_sign_certification', + :'reference_id', + :'email', + :'e_delivery_consented_at', + :'signature' + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'W9FormBaseRequest' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::A1099::V2::W8BenEFormRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::A1099::V2::W8BenEFormRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'citizenship_country') + self.citizenship_country = attributes[:'citizenship_country'] + end + + if attributes.key?(:'disregarded_entity') + self.disregarded_entity = attributes[:'disregarded_entity'] + end + + if attributes.key?(:'entity_type') + self.entity_type = attributes[:'entity_type'] + end + + if attributes.key?(:'making_treaty_claim') + self.making_treaty_claim = attributes[:'making_treaty_claim'] + end + + if attributes.key?(:'fatca_status') + self.fatca_status = attributes[:'fatca_status'] + end + + if attributes.key?(:'residence_address') + self.residence_address = attributes[:'residence_address'] + end + + if attributes.key?(:'residence_city') + self.residence_city = attributes[:'residence_city'] + end + + if attributes.key?(:'residence_state') + self.residence_state = attributes[:'residence_state'] + end + + if attributes.key?(:'residence_zip') + self.residence_zip = attributes[:'residence_zip'] + end + + if attributes.key?(:'residence_country') + self.residence_country = attributes[:'residence_country'] + end + + if attributes.key?(:'residence_is_mailing') + self.residence_is_mailing = attributes[:'residence_is_mailing'] + end + + if attributes.key?(:'mailing_address') + self.mailing_address = attributes[:'mailing_address'] + end + + if attributes.key?(:'mailing_city') + self.mailing_city = attributes[:'mailing_city'] + end + + if attributes.key?(:'mailing_state') + self.mailing_state = attributes[:'mailing_state'] + end + + if attributes.key?(:'mailing_zip') + self.mailing_zip = attributes[:'mailing_zip'] + end + + if attributes.key?(:'mailing_country') + self.mailing_country = attributes[:'mailing_country'] + end + + if attributes.key?(:'tin') + self.tin = attributes[:'tin'] + end + + if attributes.key?(:'giin') + self.giin = attributes[:'giin'] + end + + if attributes.key?(:'foreign_tin_not_required') + self.foreign_tin_not_required = attributes[:'foreign_tin_not_required'] + end + + if attributes.key?(:'foreign_tin') + self.foreign_tin = attributes[:'foreign_tin'] + end + + if attributes.key?(:'reference_number') + self.reference_number = attributes[:'reference_number'] + end + + if attributes.key?(:'disregarded_entity_fatca_status') + self.disregarded_entity_fatca_status = attributes[:'disregarded_entity_fatca_status'] + end + + if attributes.key?(:'disregarded_address') + self.disregarded_address = attributes[:'disregarded_address'] + end + + if attributes.key?(:'disregarded_city') + self.disregarded_city = attributes[:'disregarded_city'] + end + + if attributes.key?(:'disregarded_state') + self.disregarded_state = attributes[:'disregarded_state'] + end + + if attributes.key?(:'disregarded_zip') + self.disregarded_zip = attributes[:'disregarded_zip'] + end + + if attributes.key?(:'disregarded_country') + self.disregarded_country = attributes[:'disregarded_country'] + end + + if attributes.key?(:'disregarded_entity_giin') + self.disregarded_entity_giin = attributes[:'disregarded_entity_giin'] + end + + if attributes.key?(:'treaty_country_certification') + self.treaty_country_certification = attributes[:'treaty_country_certification'] + end + + if attributes.key?(:'treaty_country') + self.treaty_country = attributes[:'treaty_country'] + end + + if attributes.key?(:'benefit_limitation_certification') + self.benefit_limitation_certification = attributes[:'benefit_limitation_certification'] + end + + if attributes.key?(:'benefit_limitation') + self.benefit_limitation = attributes[:'benefit_limitation'] + end + + if attributes.key?(:'qualified_resident_status_certification') + self.qualified_resident_status_certification = attributes[:'qualified_resident_status_certification'] + end + + if attributes.key?(:'treaty_article') + self.treaty_article = attributes[:'treaty_article'] + end + + if attributes.key?(:'withholding_rate') + self.withholding_rate = attributes[:'withholding_rate'] + end + + if attributes.key?(:'income_type') + self.income_type = attributes[:'income_type'] + end + + if attributes.key?(:'treaty_reasons') + self.treaty_reasons = attributes[:'treaty_reasons'] + end + + if attributes.key?(:'ffi_sponsoring_entity') + self.ffi_sponsoring_entity = attributes[:'ffi_sponsoring_entity'] + end + + if attributes.key?(:'investment_entity_certification') + self.investment_entity_certification = attributes[:'investment_entity_certification'] + end + + if attributes.key?(:'controlled_foreign_corporation_certification') + self.controlled_foreign_corporation_certification = attributes[:'controlled_foreign_corporation_certification'] + end + + if attributes.key?(:'compliant_nonregistering_local_bank_certification') + self.compliant_nonregistering_local_bank_certification = attributes[:'compliant_nonregistering_local_bank_certification'] + end + + if attributes.key?(:'compliant_ffi_low_value_accounts_certification') + self.compliant_ffi_low_value_accounts_certification = attributes[:'compliant_ffi_low_value_accounts_certification'] + end + + if attributes.key?(:'sponsored_closely_held_entity_sponsoring_entity') + self.sponsored_closely_held_entity_sponsoring_entity = attributes[:'sponsored_closely_held_entity_sponsoring_entity'] + end + + if attributes.key?(:'sponsored_closely_held_investment_vehicle_certification') + self.sponsored_closely_held_investment_vehicle_certification = attributes[:'sponsored_closely_held_investment_vehicle_certification'] + end + + if attributes.key?(:'compliant_limited_life_debt_entity_certification') + self.compliant_limited_life_debt_entity_certification = attributes[:'compliant_limited_life_debt_entity_certification'] + end + + if attributes.key?(:'investment_entity_no_financial_accounts_certification') + self.investment_entity_no_financial_accounts_certification = attributes[:'investment_entity_no_financial_accounts_certification'] + end + + if attributes.key?(:'owner_documented_ffi_certification') + self.owner_documented_ffi_certification = attributes[:'owner_documented_ffi_certification'] + end + + if attributes.key?(:'owner_documented_ffi_reporting_statement_certification') + self.owner_documented_ffi_reporting_statement_certification = attributes[:'owner_documented_ffi_reporting_statement_certification'] + end + + if attributes.key?(:'owner_documented_ffi_auditor_letter_certification') + self.owner_documented_ffi_auditor_letter_certification = attributes[:'owner_documented_ffi_auditor_letter_certification'] + end + + if attributes.key?(:'owner_documented_ffi_trust_beneficiaries_certification') + self.owner_documented_ffi_trust_beneficiaries_certification = attributes[:'owner_documented_ffi_trust_beneficiaries_certification'] + end + + if attributes.key?(:'restricted_distributor_certification') + self.restricted_distributor_certification = attributes[:'restricted_distributor_certification'] + end + + if attributes.key?(:'restricted_distributor_agreement_certification') + self.restricted_distributor_agreement_certification = attributes[:'restricted_distributor_agreement_certification'] + end + + if attributes.key?(:'restricted_distributor_preexisting_sales_compliance_certification') + self.restricted_distributor_preexisting_sales_compliance_certification = attributes[:'restricted_distributor_preexisting_sales_compliance_certification'] + end + + if attributes.key?(:'nonreporting_iga_ffi_certification') + self.nonreporting_iga_ffi_certification = attributes[:'nonreporting_iga_ffi_certification'] + end + + if attributes.key?(:'iga_country') + self.iga_country = attributes[:'iga_country'] + end + + if attributes.key?(:'iga_model') + self.iga_model = attributes[:'iga_model'] + end + + if attributes.key?(:'iga_legal_status_treatment') + self.iga_legal_status_treatment = attributes[:'iga_legal_status_treatment'] + end + + if attributes.key?(:'iga_ffi_trustee_or_sponsor') + self.iga_ffi_trustee_or_sponsor = attributes[:'iga_ffi_trustee_or_sponsor'] + end + + if attributes.key?(:'iga_ffi_trustee_is_foreign') + self.iga_ffi_trustee_is_foreign = attributes[:'iga_ffi_trustee_is_foreign'] + end + + if attributes.key?(:'non_commercial_financial_activity_certification') + self.non_commercial_financial_activity_certification = attributes[:'non_commercial_financial_activity_certification'] + end + + if attributes.key?(:'internation_organization_certification') + self.internation_organization_certification = attributes[:'internation_organization_certification'] + end + + if attributes.key?(:'intergovernmental_organization_certification') + self.intergovernmental_organization_certification = attributes[:'intergovernmental_organization_certification'] + end + + if attributes.key?(:'treaty_qualified_pension_fund_certification') + self.treaty_qualified_pension_fund_certification = attributes[:'treaty_qualified_pension_fund_certification'] + end + + if attributes.key?(:'qualified_retirement_fund_certification') + self.qualified_retirement_fund_certification = attributes[:'qualified_retirement_fund_certification'] + end + + if attributes.key?(:'narrow_participation_retirement_fund_certification') + self.narrow_participation_retirement_fund_certification = attributes[:'narrow_participation_retirement_fund_certification'] + end + + if attributes.key?(:'section401_a_equivalent_pension_plan_certification') + self.section401_a_equivalent_pension_plan_certification = attributes[:'section401_a_equivalent_pension_plan_certification'] + end + + if attributes.key?(:'investment_entity_for_retirement_funds_certification') + self.investment_entity_for_retirement_funds_certification = attributes[:'investment_entity_for_retirement_funds_certification'] + end + + if attributes.key?(:'exempt_beneficial_owner_sponsored_retirement_fund_certification') + self.exempt_beneficial_owner_sponsored_retirement_fund_certification = attributes[:'exempt_beneficial_owner_sponsored_retirement_fund_certification'] + end + + if attributes.key?(:'exempt_beneficial_owner_owned_investment_entity_certification') + self.exempt_beneficial_owner_owned_investment_entity_certification = attributes[:'exempt_beneficial_owner_owned_investment_entity_certification'] + end + + if attributes.key?(:'territory_financial_institution_certification') + self.territory_financial_institution_certification = attributes[:'territory_financial_institution_certification'] + end + + if attributes.key?(:'excepted_nonfinancial_group_entity_certification') + self.excepted_nonfinancial_group_entity_certification = attributes[:'excepted_nonfinancial_group_entity_certification'] + end + + if attributes.key?(:'excepted_nonfinancial_start_up_certification') + self.excepted_nonfinancial_start_up_certification = attributes[:'excepted_nonfinancial_start_up_certification'] + end + + if attributes.key?(:'startup_formation_or_resolution_date') + self.startup_formation_or_resolution_date = attributes[:'startup_formation_or_resolution_date'] + end + + if attributes.key?(:'excepted_nonfinancial_entity_in_liquidation_or_bankruptcy_certification') + self.excepted_nonfinancial_entity_in_liquidation_or_bankruptcy_certification = attributes[:'excepted_nonfinancial_entity_in_liquidation_or_bankruptcy_certification'] + end + + if attributes.key?(:'nonfinancial_entity_filing_date') + self.nonfinancial_entity_filing_date = attributes[:'nonfinancial_entity_filing_date'] + end + + if attributes.key?(:'section501_c_organization_certification') + self.section501_c_organization_certification = attributes[:'section501_c_organization_certification'] + end + + if attributes.key?(:'determination_letter_date') + self.determination_letter_date = attributes[:'determination_letter_date'] + end + + if attributes.key?(:'nonprofit_organization_certification') + self.nonprofit_organization_certification = attributes[:'nonprofit_organization_certification'] + end + + if attributes.key?(:'publicly_traded_nffe_certification') + self.publicly_traded_nffe_certification = attributes[:'publicly_traded_nffe_certification'] + end + + if attributes.key?(:'publicly_traded_nffe_securities_market') + self.publicly_traded_nffe_securities_market = attributes[:'publicly_traded_nffe_securities_market'] + end + + if attributes.key?(:'nffe_affiliate_of_publicly_traded_entity_certification') + self.nffe_affiliate_of_publicly_traded_entity_certification = attributes[:'nffe_affiliate_of_publicly_traded_entity_certification'] + end + + if attributes.key?(:'publicly_traded_entity') + self.publicly_traded_entity = attributes[:'publicly_traded_entity'] + end + + if attributes.key?(:'nffe_affiliate_of_publicly_traded_entity_securities_market') + self.nffe_affiliate_of_publicly_traded_entity_securities_market = attributes[:'nffe_affiliate_of_publicly_traded_entity_securities_market'] + end + + if attributes.key?(:'excepted_territory_nffe_certification') + self.excepted_territory_nffe_certification = attributes[:'excepted_territory_nffe_certification'] + end + + if attributes.key?(:'active_nffe_certification') + self.active_nffe_certification = attributes[:'active_nffe_certification'] + end + + if attributes.key?(:'passive_nffe_certification') + self.passive_nffe_certification = attributes[:'passive_nffe_certification'] + end + + if attributes.key?(:'passive_nffe_no_substantial_us_owners_certification') + self.passive_nffe_no_substantial_us_owners_certification = attributes[:'passive_nffe_no_substantial_us_owners_certification'] + end + + if attributes.key?(:'passive_nffe_substantial_us_owners_provided_certification') + self.passive_nffe_substantial_us_owners_provided_certification = attributes[:'passive_nffe_substantial_us_owners_provided_certification'] + end + + if attributes.key?(:'excepted_inter_affiliate_ffi_certification') + self.excepted_inter_affiliate_ffi_certification = attributes[:'excepted_inter_affiliate_ffi_certification'] + end + + if attributes.key?(:'sponsored_direct_reporting_nffe_certification') + self.sponsored_direct_reporting_nffe_certification = attributes[:'sponsored_direct_reporting_nffe_certification'] + end + + if attributes.key?(:'direct_reporting_nffe_sponsoring_entity') + self.direct_reporting_nffe_sponsoring_entity = attributes[:'direct_reporting_nffe_sponsoring_entity'] + end + + if attributes.key?(:'substantial_us_owners') + if (value = attributes[:'substantial_us_owners']).is_a?(Array) + self.substantial_us_owners = value + end + end + + if attributes.key?(:'signer_name') + self.signer_name = attributes[:'signer_name'] + end + + if attributes.key?(:'capacity_to_sign_certification') + self.capacity_to_sign_certification = attributes[:'capacity_to_sign_certification'] + end + + if attributes.key?(:'company_id') + self.company_id = attributes[:'company_id'] + end + + if attributes.key?(:'reference_id') + self.reference_id = attributes[:'reference_id'] + end + + if attributes.key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.key?(:'e_delivery_consented_at') + self.e_delivery_consented_at = attributes[:'e_delivery_consented_at'] + end + + if attributes.key?(:'signature') + self.signature = attributes[:'signature'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + type_validator = EnumAttributeValidator.new('String', ["W4", "W8Ben", "W8BenE", "W8Imy", "W9"]) + return false unless type_validator.valid?(@type) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["W4", "W8Ben", "W8BenE", "W8Imy", "W9"]) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + name == o.name && + citizenship_country == o.citizenship_country && + disregarded_entity == o.disregarded_entity && + entity_type == o.entity_type && + making_treaty_claim == o.making_treaty_claim && + fatca_status == o.fatca_status && + residence_address == o.residence_address && + residence_city == o.residence_city && + residence_state == o.residence_state && + residence_zip == o.residence_zip && + residence_country == o.residence_country && + residence_is_mailing == o.residence_is_mailing && + mailing_address == o.mailing_address && + mailing_city == o.mailing_city && + mailing_state == o.mailing_state && + mailing_zip == o.mailing_zip && + mailing_country == o.mailing_country && + tin == o.tin && + giin == o.giin && + foreign_tin_not_required == o.foreign_tin_not_required && + foreign_tin == o.foreign_tin && + reference_number == o.reference_number && + disregarded_entity_fatca_status == o.disregarded_entity_fatca_status && + disregarded_address == o.disregarded_address && + disregarded_city == o.disregarded_city && + disregarded_state == o.disregarded_state && + disregarded_zip == o.disregarded_zip && + disregarded_country == o.disregarded_country && + disregarded_entity_giin == o.disregarded_entity_giin && + treaty_country_certification == o.treaty_country_certification && + treaty_country == o.treaty_country && + benefit_limitation_certification == o.benefit_limitation_certification && + benefit_limitation == o.benefit_limitation && + qualified_resident_status_certification == o.qualified_resident_status_certification && + treaty_article == o.treaty_article && + withholding_rate == o.withholding_rate && + income_type == o.income_type && + treaty_reasons == o.treaty_reasons && + ffi_sponsoring_entity == o.ffi_sponsoring_entity && + investment_entity_certification == o.investment_entity_certification && + controlled_foreign_corporation_certification == o.controlled_foreign_corporation_certification && + compliant_nonregistering_local_bank_certification == o.compliant_nonregistering_local_bank_certification && + compliant_ffi_low_value_accounts_certification == o.compliant_ffi_low_value_accounts_certification && + sponsored_closely_held_entity_sponsoring_entity == o.sponsored_closely_held_entity_sponsoring_entity && + sponsored_closely_held_investment_vehicle_certification == o.sponsored_closely_held_investment_vehicle_certification && + compliant_limited_life_debt_entity_certification == o.compliant_limited_life_debt_entity_certification && + investment_entity_no_financial_accounts_certification == o.investment_entity_no_financial_accounts_certification && + owner_documented_ffi_certification == o.owner_documented_ffi_certification && + owner_documented_ffi_reporting_statement_certification == o.owner_documented_ffi_reporting_statement_certification && + owner_documented_ffi_auditor_letter_certification == o.owner_documented_ffi_auditor_letter_certification && + owner_documented_ffi_trust_beneficiaries_certification == o.owner_documented_ffi_trust_beneficiaries_certification && + restricted_distributor_certification == o.restricted_distributor_certification && + restricted_distributor_agreement_certification == o.restricted_distributor_agreement_certification && + restricted_distributor_preexisting_sales_compliance_certification == o.restricted_distributor_preexisting_sales_compliance_certification && + nonreporting_iga_ffi_certification == o.nonreporting_iga_ffi_certification && + iga_country == o.iga_country && + iga_model == o.iga_model && + iga_legal_status_treatment == o.iga_legal_status_treatment && + iga_ffi_trustee_or_sponsor == o.iga_ffi_trustee_or_sponsor && + iga_ffi_trustee_is_foreign == o.iga_ffi_trustee_is_foreign && + non_commercial_financial_activity_certification == o.non_commercial_financial_activity_certification && + internation_organization_certification == o.internation_organization_certification && + intergovernmental_organization_certification == o.intergovernmental_organization_certification && + treaty_qualified_pension_fund_certification == o.treaty_qualified_pension_fund_certification && + qualified_retirement_fund_certification == o.qualified_retirement_fund_certification && + narrow_participation_retirement_fund_certification == o.narrow_participation_retirement_fund_certification && + section401_a_equivalent_pension_plan_certification == o.section401_a_equivalent_pension_plan_certification && + investment_entity_for_retirement_funds_certification == o.investment_entity_for_retirement_funds_certification && + exempt_beneficial_owner_sponsored_retirement_fund_certification == o.exempt_beneficial_owner_sponsored_retirement_fund_certification && + exempt_beneficial_owner_owned_investment_entity_certification == o.exempt_beneficial_owner_owned_investment_entity_certification && + territory_financial_institution_certification == o.territory_financial_institution_certification && + excepted_nonfinancial_group_entity_certification == o.excepted_nonfinancial_group_entity_certification && + excepted_nonfinancial_start_up_certification == o.excepted_nonfinancial_start_up_certification && + startup_formation_or_resolution_date == o.startup_formation_or_resolution_date && + excepted_nonfinancial_entity_in_liquidation_or_bankruptcy_certification == o.excepted_nonfinancial_entity_in_liquidation_or_bankruptcy_certification && + nonfinancial_entity_filing_date == o.nonfinancial_entity_filing_date && + section501_c_organization_certification == o.section501_c_organization_certification && + determination_letter_date == o.determination_letter_date && + nonprofit_organization_certification == o.nonprofit_organization_certification && + publicly_traded_nffe_certification == o.publicly_traded_nffe_certification && + publicly_traded_nffe_securities_market == o.publicly_traded_nffe_securities_market && + nffe_affiliate_of_publicly_traded_entity_certification == o.nffe_affiliate_of_publicly_traded_entity_certification && + publicly_traded_entity == o.publicly_traded_entity && + nffe_affiliate_of_publicly_traded_entity_securities_market == o.nffe_affiliate_of_publicly_traded_entity_securities_market && + excepted_territory_nffe_certification == o.excepted_territory_nffe_certification && + active_nffe_certification == o.active_nffe_certification && + passive_nffe_certification == o.passive_nffe_certification && + passive_nffe_no_substantial_us_owners_certification == o.passive_nffe_no_substantial_us_owners_certification && + passive_nffe_substantial_us_owners_provided_certification == o.passive_nffe_substantial_us_owners_provided_certification && + excepted_inter_affiliate_ffi_certification == o.excepted_inter_affiliate_ffi_certification && + sponsored_direct_reporting_nffe_certification == o.sponsored_direct_reporting_nffe_certification && + direct_reporting_nffe_sponsoring_entity == o.direct_reporting_nffe_sponsoring_entity && + substantial_us_owners == o.substantial_us_owners && + signer_name == o.signer_name && + capacity_to_sign_certification == o.capacity_to_sign_certification && + company_id == o.company_id && + reference_id == o.reference_id && + email == o.email && + e_delivery_consented_at == o.e_delivery_consented_at && + signature == o.signature + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, name, citizenship_country, disregarded_entity, entity_type, making_treaty_claim, fatca_status, residence_address, residence_city, residence_state, residence_zip, residence_country, residence_is_mailing, mailing_address, mailing_city, mailing_state, mailing_zip, mailing_country, tin, giin, foreign_tin_not_required, foreign_tin, reference_number, disregarded_entity_fatca_status, disregarded_address, disregarded_city, disregarded_state, disregarded_zip, disregarded_country, disregarded_entity_giin, treaty_country_certification, treaty_country, benefit_limitation_certification, benefit_limitation, qualified_resident_status_certification, treaty_article, withholding_rate, income_type, treaty_reasons, ffi_sponsoring_entity, investment_entity_certification, controlled_foreign_corporation_certification, compliant_nonregistering_local_bank_certification, compliant_ffi_low_value_accounts_certification, sponsored_closely_held_entity_sponsoring_entity, sponsored_closely_held_investment_vehicle_certification, compliant_limited_life_debt_entity_certification, investment_entity_no_financial_accounts_certification, owner_documented_ffi_certification, owner_documented_ffi_reporting_statement_certification, owner_documented_ffi_auditor_letter_certification, owner_documented_ffi_trust_beneficiaries_certification, restricted_distributor_certification, restricted_distributor_agreement_certification, restricted_distributor_preexisting_sales_compliance_certification, nonreporting_iga_ffi_certification, iga_country, iga_model, iga_legal_status_treatment, iga_ffi_trustee_or_sponsor, iga_ffi_trustee_is_foreign, non_commercial_financial_activity_certification, internation_organization_certification, intergovernmental_organization_certification, treaty_qualified_pension_fund_certification, qualified_retirement_fund_certification, narrow_participation_retirement_fund_certification, section401_a_equivalent_pension_plan_certification, investment_entity_for_retirement_funds_certification, exempt_beneficial_owner_sponsored_retirement_fund_certification, exempt_beneficial_owner_owned_investment_entity_certification, territory_financial_institution_certification, excepted_nonfinancial_group_entity_certification, excepted_nonfinancial_start_up_certification, startup_formation_or_resolution_date, excepted_nonfinancial_entity_in_liquidation_or_bankruptcy_certification, nonfinancial_entity_filing_date, section501_c_organization_certification, determination_letter_date, nonprofit_organization_certification, publicly_traded_nffe_certification, publicly_traded_nffe_securities_market, nffe_affiliate_of_publicly_traded_entity_certification, publicly_traded_entity, nffe_affiliate_of_publicly_traded_entity_securities_market, excepted_territory_nffe_certification, active_nffe_certification, passive_nffe_certification, passive_nffe_no_substantial_us_owners_certification, passive_nffe_substantial_us_owners_provided_certification, excepted_inter_affiliate_ffi_certification, sponsored_direct_reporting_nffe_certification, direct_reporting_nffe_sponsoring_entity, substantial_us_owners, signer_name, capacity_to_sign_certification, company_id, reference_id, email, e_delivery_consented_at, signature].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::A1099::V2.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/A1099/V2/w8_ben_e_form_response.rb b/lib/avalara_sdk/models/A1099/V2/w8_ben_e_form_response.rb index 80517f5..b817182 100644 --- a/lib/avalara_sdk/models/A1099/V2/w8_ben_e_form_response.rb +++ b/lib/avalara_sdk/models/A1099/V2/w8_ben_e_form_response.rb @@ -1,7 +1,7 @@ =begin #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) =end @@ -539,11 +539,11 @@ def self.openapi_types :'territory_financial_institution_certification' => :'Boolean', :'excepted_nonfinancial_group_entity_certification' => :'Boolean', :'excepted_nonfinancial_start_up_certification' => :'Boolean', - :'startup_formation_or_resolution_date' => :'Time', + :'startup_formation_or_resolution_date' => :'Date', :'excepted_nonfinancial_entity_in_liquidation_or_bankruptcy_certification' => :'Boolean', - :'nonfinancial_entity_filing_date' => :'Time', + :'nonfinancial_entity_filing_date' => :'Date', :'section501_c_organization_certification' => :'Boolean', - :'determination_letter_date' => :'Time', + :'determination_letter_date' => :'Date', :'nonprofit_organization_certification' => :'Boolean', :'publicly_traded_nffe_certification' => :'Boolean', :'publicly_traded_nffe_securities_market' => :'String', diff --git a/lib/avalara_sdk/models/A1099/V2/w8_ben_e_substantial_us_owner_data_model.rb b/lib/avalara_sdk/models/A1099/V2/w8_ben_e_substantial_us_owner_data_model.rb index 9cb0f30..ee9eac0 100644 --- a/lib/avalara_sdk/models/A1099/V2/w8_ben_e_substantial_us_owner_data_model.rb +++ b/lib/avalara_sdk/models/A1099/V2/w8_ben_e_substantial_us_owner_data_model.rb @@ -1,7 +1,7 @@ =begin #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) =end diff --git a/lib/avalara_sdk/models/A1099/V2/w8_ben_form_data_model.rb b/lib/avalara_sdk/models/A1099/V2/w8_ben_form_data_model.rb index a63c633..e7865cb 100644 --- a/lib/avalara_sdk/models/A1099/V2/w8_ben_form_data_model.rb +++ b/lib/avalara_sdk/models/A1099/V2/w8_ben_form_data_model.rb @@ -1,7 +1,7 @@ =begin #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) =end @@ -979,9 +979,9 @@ def self.openapi_types :'certify_box41' => :'Boolean', :'certify_box43' => :'Boolean', :'certify_part29_signature' => :'Boolean', - :'part19_formation_or_resolution_date' => :'Time', - :'part20_filing_date' => :'Time', - :'part21_determination_date' => :'Time', + :'part19_formation_or_resolution_date' => :'Date', + :'part20_filing_date' => :'Date', + :'part21_determination_date' => :'Date', :'substantial_us_owners' => :'Array', :'ein' => :'String', :'ein_type' => :'String', @@ -1051,8 +1051,8 @@ def self.openapi_types :'certify_box40' => :'Boolean', :'box41_sponsoring_entity' => :'String', :'certify_box42' => :'Boolean', - :'box35_formed_on_date' => :'Time', - :'box36_filed_on_date' => :'Time', + :'box35_formed_on_date' => :'Date', + :'box36_filed_on_date' => :'Date', :'tin_match_status' => :'String', :'signature' => :'String', :'business_classification' => :'String', diff --git a/lib/avalara_sdk/models/A1099/V2/w8_ben_form_request.rb b/lib/avalara_sdk/models/A1099/V2/w8_ben_form_request.rb new file mode 100644 index 0000000..500b551 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/w8_ben_form_request.rb @@ -0,0 +1,561 @@ +=begin +#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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class W8BenFormRequest + # The form type (always \"w8ben\" for this model). + attr_accessor :type + + # The name of the individual or entity associated with the form. + attr_accessor :name + + # The country of citizenship. + attr_accessor :citizenship_country + + # The residential address of the individual or entity. + attr_accessor :residence_address + + # The city of residence. + attr_accessor :residence_city + + # The state of residence. + attr_accessor :residence_state + + # The ZIP code of the residence. + attr_accessor :residence_zip + + # The country of residence. + attr_accessor :residence_country + + # Indicates whether the residence address is the mailing address. + attr_accessor :residence_is_mailing + + # The mailing address. + attr_accessor :mailing_address + + # The city of the mailing address. + attr_accessor :mailing_city + + # The state of the mailing address. + attr_accessor :mailing_state + + # The ZIP code of the mailing address. + attr_accessor :mailing_zip + + # The country of the mailing address. + attr_accessor :mailing_country + + # The taxpayer identification number (TIN). + attr_accessor :tin + + # Indicates whether a foreign TIN is not legally required. + attr_accessor :foreign_tin_not_required + + # The foreign taxpayer identification number (TIN). + attr_accessor :foreign_tin + + # A reference number for the form. + attr_accessor :reference_number + + # The birthday of the individual associated with the form. + attr_accessor :birthday + + # The country for which the treaty applies. + attr_accessor :treaty_country + + # The specific article of the treaty being claimed. + attr_accessor :treaty_article + + # The reasons for claiming treaty benefits. + attr_accessor :treaty_reasons + + # The withholding rate applied as per the treaty. + attr_accessor :withholding_rate + + # The type of income covered by the treaty. + attr_accessor :income_type + + # The name of the signer of the form. + attr_accessor :signer_name + + # The ID of the associated company. + attr_accessor :company_id + + # A reference identifier for the form. + attr_accessor :reference_id + + # The email address of the individual associated with the form. + attr_accessor :email + + # The date when e-delivery was consented. + attr_accessor :e_delivery_consented_at + + # The signature of the form. + attr_accessor :signature + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'name' => :'name', + :'citizenship_country' => :'citizenshipCountry', + :'residence_address' => :'residenceAddress', + :'residence_city' => :'residenceCity', + :'residence_state' => :'residenceState', + :'residence_zip' => :'residenceZip', + :'residence_country' => :'residenceCountry', + :'residence_is_mailing' => :'residenceIsMailing', + :'mailing_address' => :'mailingAddress', + :'mailing_city' => :'mailingCity', + :'mailing_state' => :'mailingState', + :'mailing_zip' => :'mailingZip', + :'mailing_country' => :'mailingCountry', + :'tin' => :'tin', + :'foreign_tin_not_required' => :'foreignTinNotRequired', + :'foreign_tin' => :'foreignTin', + :'reference_number' => :'referenceNumber', + :'birthday' => :'birthday', + :'treaty_country' => :'treatyCountry', + :'treaty_article' => :'treatyArticle', + :'treaty_reasons' => :'treatyReasons', + :'withholding_rate' => :'withholdingRate', + :'income_type' => :'incomeType', + :'signer_name' => :'signerName', + :'company_id' => :'companyId', + :'reference_id' => :'referenceId', + :'email' => :'email', + :'e_delivery_consented_at' => :'eDeliveryConsentedAt', + :'signature' => :'signature' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'String', + :'name' => :'String', + :'citizenship_country' => :'String', + :'residence_address' => :'String', + :'residence_city' => :'String', + :'residence_state' => :'String', + :'residence_zip' => :'String', + :'residence_country' => :'String', + :'residence_is_mailing' => :'Boolean', + :'mailing_address' => :'String', + :'mailing_city' => :'String', + :'mailing_state' => :'String', + :'mailing_zip' => :'String', + :'mailing_country' => :'String', + :'tin' => :'String', + :'foreign_tin_not_required' => :'Boolean', + :'foreign_tin' => :'String', + :'reference_number' => :'String', + :'birthday' => :'Date', + :'treaty_country' => :'String', + :'treaty_article' => :'String', + :'treaty_reasons' => :'String', + :'withholding_rate' => :'String', + :'income_type' => :'String', + :'signer_name' => :'String', + :'company_id' => :'String', + :'reference_id' => :'String', + :'email' => :'String', + :'e_delivery_consented_at' => :'Time', + :'signature' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'residence_state', + :'mailing_address', + :'mailing_city', + :'mailing_state', + :'mailing_zip', + :'mailing_country', + :'tin', + :'foreign_tin', + :'reference_number', + :'birthday', + :'treaty_article', + :'treaty_reasons', + :'withholding_rate', + :'income_type', + :'signer_name', + :'reference_id', + :'email', + :'e_delivery_consented_at', + :'signature' + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'W9FormBaseRequest' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::A1099::V2::W8BenFormRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::A1099::V2::W8BenFormRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'citizenship_country') + self.citizenship_country = attributes[:'citizenship_country'] + end + + if attributes.key?(:'residence_address') + self.residence_address = attributes[:'residence_address'] + end + + if attributes.key?(:'residence_city') + self.residence_city = attributes[:'residence_city'] + end + + if attributes.key?(:'residence_state') + self.residence_state = attributes[:'residence_state'] + end + + if attributes.key?(:'residence_zip') + self.residence_zip = attributes[:'residence_zip'] + end + + if attributes.key?(:'residence_country') + self.residence_country = attributes[:'residence_country'] + end + + if attributes.key?(:'residence_is_mailing') + self.residence_is_mailing = attributes[:'residence_is_mailing'] + end + + if attributes.key?(:'mailing_address') + self.mailing_address = attributes[:'mailing_address'] + end + + if attributes.key?(:'mailing_city') + self.mailing_city = attributes[:'mailing_city'] + end + + if attributes.key?(:'mailing_state') + self.mailing_state = attributes[:'mailing_state'] + end + + if attributes.key?(:'mailing_zip') + self.mailing_zip = attributes[:'mailing_zip'] + end + + if attributes.key?(:'mailing_country') + self.mailing_country = attributes[:'mailing_country'] + end + + if attributes.key?(:'tin') + self.tin = attributes[:'tin'] + end + + if attributes.key?(:'foreign_tin_not_required') + self.foreign_tin_not_required = attributes[:'foreign_tin_not_required'] + end + + if attributes.key?(:'foreign_tin') + self.foreign_tin = attributes[:'foreign_tin'] + end + + if attributes.key?(:'reference_number') + self.reference_number = attributes[:'reference_number'] + end + + if attributes.key?(:'birthday') + self.birthday = attributes[:'birthday'] + end + + if attributes.key?(:'treaty_country') + self.treaty_country = attributes[:'treaty_country'] + end + + if attributes.key?(:'treaty_article') + self.treaty_article = attributes[:'treaty_article'] + end + + if attributes.key?(:'treaty_reasons') + self.treaty_reasons = attributes[:'treaty_reasons'] + end + + if attributes.key?(:'withholding_rate') + self.withholding_rate = attributes[:'withholding_rate'] + end + + if attributes.key?(:'income_type') + self.income_type = attributes[:'income_type'] + end + + if attributes.key?(:'signer_name') + self.signer_name = attributes[:'signer_name'] + end + + if attributes.key?(:'company_id') + self.company_id = attributes[:'company_id'] + end + + if attributes.key?(:'reference_id') + self.reference_id = attributes[:'reference_id'] + end + + if attributes.key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.key?(:'e_delivery_consented_at') + self.e_delivery_consented_at = attributes[:'e_delivery_consented_at'] + end + + if attributes.key?(:'signature') + self.signature = attributes[:'signature'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + type_validator = EnumAttributeValidator.new('String', ["W4", "W8Ben", "W8BenE", "W8Imy", "W9"]) + return false unless type_validator.valid?(@type) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["W4", "W8Ben", "W8BenE", "W8Imy", "W9"]) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + name == o.name && + citizenship_country == o.citizenship_country && + residence_address == o.residence_address && + residence_city == o.residence_city && + residence_state == o.residence_state && + residence_zip == o.residence_zip && + residence_country == o.residence_country && + residence_is_mailing == o.residence_is_mailing && + mailing_address == o.mailing_address && + mailing_city == o.mailing_city && + mailing_state == o.mailing_state && + mailing_zip == o.mailing_zip && + mailing_country == o.mailing_country && + tin == o.tin && + foreign_tin_not_required == o.foreign_tin_not_required && + foreign_tin == o.foreign_tin && + reference_number == o.reference_number && + birthday == o.birthday && + treaty_country == o.treaty_country && + treaty_article == o.treaty_article && + treaty_reasons == o.treaty_reasons && + withholding_rate == o.withholding_rate && + income_type == o.income_type && + signer_name == o.signer_name && + company_id == o.company_id && + reference_id == o.reference_id && + email == o.email && + e_delivery_consented_at == o.e_delivery_consented_at && + signature == o.signature + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, name, citizenship_country, residence_address, residence_city, residence_state, residence_zip, residence_country, residence_is_mailing, mailing_address, mailing_city, mailing_state, mailing_zip, mailing_country, tin, foreign_tin_not_required, foreign_tin, reference_number, birthday, treaty_country, treaty_article, treaty_reasons, withholding_rate, income_type, signer_name, company_id, reference_id, email, e_delivery_consented_at, signature].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::A1099::V2.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/A1099/V2/w8_ben_form_response.rb b/lib/avalara_sdk/models/A1099/V2/w8_ben_form_response.rb index 8018fa9..a337f31 100644 --- a/lib/avalara_sdk/models/A1099/V2/w8_ben_form_response.rb +++ b/lib/avalara_sdk/models/A1099/V2/w8_ben_form_response.rb @@ -1,7 +1,7 @@ =begin #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) =end diff --git a/lib/avalara_sdk/models/A1099/V2/w8_bene_form_data_model.rb b/lib/avalara_sdk/models/A1099/V2/w8_bene_form_data_model.rb index ace6872..ecb9c33 100644 --- a/lib/avalara_sdk/models/A1099/V2/w8_bene_form_data_model.rb +++ b/lib/avalara_sdk/models/A1099/V2/w8_bene_form_data_model.rb @@ -1,7 +1,7 @@ =begin #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) =end @@ -933,9 +933,9 @@ def self.openapi_types :'certify_box41' => :'Boolean', :'certify_box43' => :'Boolean', :'certify_part29_signature' => :'Boolean', - :'part19_formation_or_resolution_date' => :'Time', - :'part20_filing_date' => :'Time', - :'part21_determination_date' => :'Time', + :'part19_formation_or_resolution_date' => :'Date', + :'part20_filing_date' => :'Date', + :'part21_determination_date' => :'Date', :'substantial_us_owners' => :'Array', :'employee_first_name' => :'String', :'employee_middle_name' => :'String', @@ -1031,8 +1031,8 @@ def self.openapi_types :'certify_box40' => :'Boolean', :'box41_sponsoring_entity' => :'String', :'certify_box42' => :'Boolean', - :'box35_formed_on_date' => :'Time', - :'box36_filed_on_date' => :'Time', + :'box35_formed_on_date' => :'Date', + :'box36_filed_on_date' => :'Date', :'tin_match_status' => :'String', :'signature' => :'String', :'business_classification' => :'String', diff --git a/lib/avalara_sdk/models/A1099/V2/w8_imy_form_data_model.rb b/lib/avalara_sdk/models/A1099/V2/w8_imy_form_data_model.rb index 3acd8ce..ec34b40 100644 --- a/lib/avalara_sdk/models/A1099/V2/w8_imy_form_data_model.rb +++ b/lib/avalara_sdk/models/A1099/V2/w8_imy_form_data_model.rb @@ -1,7 +1,7 @@ =begin #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) =end @@ -973,8 +973,8 @@ def self.openapi_types :'certify_box42' => :'Boolean', :'signer_name' => :'String', :'e_delivery_consented_at' => :'Time', - :'box35_formed_on_date' => :'Time', - :'box36_filed_on_date' => :'Time', + :'box35_formed_on_date' => :'Date', + :'box36_filed_on_date' => :'Date', :'employee_first_name' => :'String', :'employee_middle_name' => :'String', :'employee_last_name' => :'String', @@ -1044,9 +1044,9 @@ def self.openapi_types :'certify_box41' => :'Boolean', :'certify_box43' => :'Boolean', :'certify_part29_signature' => :'Boolean', - :'part19_formation_or_resolution_date' => :'Time', - :'part20_filing_date' => :'Time', - :'part21_determination_date' => :'Time', + :'part19_formation_or_resolution_date' => :'Date', + :'part20_filing_date' => :'Date', + :'part21_determination_date' => :'Date', :'substantial_us_owners' => :'Array', :'birthday' => :'String', :'foreign_tin_not_required' => :'Boolean', diff --git a/lib/avalara_sdk/models/A1099/V2/w8_imy_form_request.rb b/lib/avalara_sdk/models/A1099/V2/w8_imy_form_request.rb new file mode 100644 index 0000000..c4c73fa --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/w8_imy_form_request.rb @@ -0,0 +1,1518 @@ +=begin +#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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class W8ImyFormRequest + # The form type (always \"w8imy\" for this model). + attr_accessor :type + + # The name of the individual or entity associated with the form. + attr_accessor :name + + # The country of citizenship. + attr_accessor :citizenship_country + + # The name of the disregarded entity receiving the payment (if applicable). + attr_accessor :disregarded_entity + + # The entity type. + attr_accessor :entity_type + + # The FATCA status. + attr_accessor :fatca_status + + # The residential address of the individual or entity. + attr_accessor :residence_address + + # The city of residence. + attr_accessor :residence_city + + # The state of residence. + attr_accessor :residence_state + + # The ZIP code of the residence. + attr_accessor :residence_zip + + # The country of residence. + attr_accessor :residence_country + + # Indicates whether the residence address is also the mailing address. + attr_accessor :residence_is_mailing + + # The mailing address. + attr_accessor :mailing_address + + # The city of the mailing address. + attr_accessor :mailing_city + + # The state of the mailing address. + attr_accessor :mailing_state + + # The ZIP code of the mailing address. + attr_accessor :mailing_zip + + # The country of the mailing address. + attr_accessor :mailing_country + + # The type of TIN provided. + attr_accessor :tin_type + + # The taxpayer identification number (TIN). + attr_accessor :tin + + # The global intermediary identification number (GIIN). + attr_accessor :giin + + # The foreign taxpayer identification number (TIN). + attr_accessor :foreign_tin + + # A reference number for the form. + attr_accessor :reference_number + + # The FATCA status of disregarded entity or branch receiving payment. + attr_accessor :disregarded_entity_fatca_status + + # The address for disregarded entities. + attr_accessor :disregarded_address + + # The city for disregarded entities. + attr_accessor :disregarded_city + + # The state for disregarded entities. + attr_accessor :disregarded_state + + # The ZIP code for disregarded entities. + attr_accessor :disregarded_zip + + # The country for disregarded entities. + attr_accessor :disregarded_country + + # The GIIN for disregarded entities. + attr_accessor :disregarded_entity_giin + + # Certifies that the entity is a Qualified Intermediary (QI) acting in accordance with its QI Agreement, providing required withholding statements and documentation for relevant tax withholding purposes. + attr_accessor :qualified_intermediary_certification + + # Certifies that the Qualified Intermediary assumes primary withholding responsibility under chapters 3 and 4 for the specified accounts. + attr_accessor :qi_primary_withholding_responsibility_certification + + # Certifies that the Qualified Intermediary assumes primary withholding and reporting responsibility under section 1446(f) for amounts realized from sales of interests in publicly traded partnerships. + attr_accessor :qi_withholding_responsibility_for_ptp_sales_certification + + # Certifies that the Qualified Intermediary assumes primary withholding responsibility as a nominee under Regulations section 1.1446-4(b)(3) for publicly traded partnership distributions. + attr_accessor :qi_nominee_withholding_responsibility_for_ptp_distributions_certification + + # Certifies that the Qualified Intermediary is acting as a qualified securities lender and assumes primary withholding and reporting responsibilities for U.S. source substitute dividend payments. + attr_accessor :qi_securities_lender_substitute_dividend_withholding_certification + + # Certifies that the Qualified Intermediary assumes primary withholding under chapters 3 and 4, and primary Form 1099 reporting and backup withholding responsibility for U.S. source interest and substitute interest payments. + attr_accessor :qi_withholding_and1099_reporting_responsibility_certification + + # Certifies that the Qualified Intermediary assumes Form 1099 reporting and backup withholding responsibility, or FATCA reporting responsibility as a participating or registered deemed-compliant FFI, for accounts held by specified U.S. persons. + attr_accessor :qi_form1099_or_fatca_reporting_responsibility_certification + + # Certifies that the Qualified Intermediary does not assume primary Form 1099 reporting and backup withholding responsibility for the accounts associated with this form. + attr_accessor :qi_opt_out_of_form1099_reporting_certification + + # Certifies that the Qualified Intermediary meets the requirements for allocating payments to a chapter 4 withholding rate pool of U.S. payees under Regulations section 1.6049-4(c)(4)(iii). + attr_accessor :qi_withholding_rate_pool_certification + + # Certifies that the Qualified Intermediary has obtained or will obtain documentation confirming the status of any intermediary or flow-through entity as a participating FFI, registered deemed-compliant FFI, or QI for U.S. payees in a chapter 4 withholding rate pool. + attr_accessor :qi_intermediary_or_flow_through_entity_documentation_certification + + # Certifies that the Qualified Derivatives Dealer (QDD) is approved by the IRS and assumes primary withholding and reporting responsibilities for payments related to potential section 871(m) transactions. + attr_accessor :qualified_derivatives_dealer_certification + + # Indicates QDD classification is Corporation. + attr_accessor :qdd_corporation + + # Indicates QDD classification is Partnership. + attr_accessor :qdd_partnership + + # Indicates QDD classification is Disregarded Entity. + attr_accessor :qdd_disregarded_entity + + # Certifies that the entity is not acting as a Qualified Intermediary and is not acting for its own account for the accounts covered by this form. + attr_accessor :nonqualified_intermediary_certification + + # Certifies that the nonqualified intermediary is submitting this form to transmit withholding certificates and/or other required documentation along with a withholding statement. + attr_accessor :nqi_withholding_statement_transmission_certification + + # Certifies that the nonqualified intermediary meets the requirements of Regulations section 1.6049-4(c)(4)(iii) for U.S. payees included in a withholding rate pool, excluding publicly traded partnership distributions. + attr_accessor :nqi_withholding_rate_pool_compliance_certification + + # Certifies that the nonqualified intermediary is acting as a qualified securities lender (not as a QI) and assumes primary withholding and reporting responsibilities for U.S. source substitute dividend payments. + attr_accessor :nqi_qualified_securities_lender_certification + + # Certifies that the nonqualified intermediary has verified, or will verify, all information on alternative withholding statements for consistency with account data to determine the correct withholding rate, as required under sections 1441 or 1471. + attr_accessor :nqi_alternative_withholding_statement_verification_certification + + # Certifies that the entity is a financial institution (other than an investment entity) that is incorporated or organized under the laws of a possession of the United States. + attr_accessor :territory_financial_institution_certification + + # Certifies that the territory financial institution agrees to be treated as a U.S. person for chapters 3 and 4 purposes concerning reportable amounts and withholdable payments. + attr_accessor :tfi_treated_as_us_person_certification + + # Certifies that the territory financial institution is transmitting withholding certificates or other required documentation and has provided or will provide a withholding statement for reportable or withholdable payments. + attr_accessor :tfi_withholding_statement_transmission_certification + + # Certifies that the territory financial institution agrees to be treated as a U.S. person under Regulations section 1.1446(f)-4(a)(2)(i)(B) for amounts realized from sales of publicly traded partnership interests. + attr_accessor :tfi_treated_as_us_person_for_ptp_sales_certification + + # Certifies that the territory financial institution agrees to be treated as a U.S. person and as a nominee for purposes of publicly traded partnership distributions under the applicable regulations. + attr_accessor :tfi_nominee_us_person_for_ptp_distributions_certification + + # Certifies that the territory financial institution is not acting as a nominee for publicly traded partnership distributions and is providing withholding statements for those distributions. + attr_accessor :tfi_not_nominee_for_ptp_distributions_certification + + # Certifies that the U.S. branch is receiving reportable or withholdable payments that are not effectively connected income, PTP distributions, or proceeds from PTP sales. + attr_accessor :us_branch_non_effectively_connected_income_certification + + # Certifies that the U.S. branch of a foreign bank or insurance company agrees to be treated as a U.S. person for reportable amounts or withholdable payments under the applicable regulations. + attr_accessor :us_branch_agreement_to_be_treated_as_us_person_certification + + # Certifies that the U.S. branch is transmitting required documentation and withholding statements for reportable or withholdable payments and is applying the appropriate FATCA regulations. + attr_accessor :us_branch_withholding_statement_and_compliance_certification + + # Certifies that the U.S. branch is acting as a U.S. person for purposes of amounts realized from sales of publicly traded partnership interests under the applicable regulations. + attr_accessor :us_branch_acting_as_us_person_for_ptp_sales_certification + + # Certifies that the U.S. branch is treated as a U.S. person and as a nominee for publicly traded partnership distributions under the applicable regulations. + attr_accessor :us_branch_nominee_for_ptp_distributions_certification + + # Certifies that the U.S. branch is not acting as a nominee for publicly traded partnership distributions and is providing the required withholding statements. + attr_accessor :us_branch_not_nominee_for_ptp_distributions_certification + + # Certifies that the entity is a withholding foreign partnership (WP) or a withholding foreign trust (WT) that is compliant with the terms of its WP or WT agreement. + attr_accessor :withholding_foreign_partnership_or_trust_certification + + # Certifies that the entity is a nonwithholding foreign partnership or trust, providing the form for non-effectively connected payments and transmitting required withholding documentation for chapters 3 and 4. + attr_accessor :nonwithholding_foreign_entity_withholding_statement_certification + + # Certifies that the entity is a foreign partnership or grantor trust acting as a partner in a lower-tier partnership and is submitting the form for purposes of section 1446(a). + attr_accessor :foreign_entity_partner_in_lower_tier_partnership_certification + + # Certifies that the entity is a foreign partnership receiving an amount realized from the transfer of a partnership interest for purposes of section 1446(f). + attr_accessor :foreign_partnership_amount_realized_section1446_f_certification + + # Certifies that the foreign partnership is providing a withholding statement for a modified amount realized from the transfer of a partnership interest, when applicable. + attr_accessor :foreign_partnership_modified_amount_realized_certification + + # Certifies that the foreign grantor trust is submitting the form on behalf of each grantor or owner and providing a withholding statement to allocate the amount realized in accordance with the regulations. + attr_accessor :foreign_grantor_trust_amount_realized_allocation_certification + + # Certifies that the entity may rely on the information in all associated withholding certificates under the applicable standards of knowledge in sections 1441 or 1471 when providing an alternative withholding statement. + attr_accessor :alternative_withholding_statement_reliance_certification + + # Certifies that the nonparticipating FFI is transmitting withholding documentation and providing a statement allocating payment portions to exempt beneficial owners. + attr_accessor :np_ffi_with_exempt_beneficial_owners_certification + + # The name of the entity that sponsors the foreign financial institution (FFI). + attr_accessor :ffi_sponsoring_entity + + # Certifies that the entity is an investment entity, not a QI, WP, or WT, and has an agreement with a sponsoring entity. + attr_accessor :investment_entity_certification + + # Certifies that the entity is a controlled foreign corporation sponsored by a U.S. financial institution, not a QI, WP, or WT, and shares a common electronic account system for full transparency. + attr_accessor :controlled_foreign_corporation_certification + + # Certifies that the FFI meets all requirements to qualify as an owner-documented FFI, including restrictions on activities, ownership, and account relationships. + attr_accessor :owner_documented_ffi_certification + + # Certifies that the FFI will provide a complete owner reporting statement and required documentation for each relevant owner or debt holder. + attr_accessor :owner_documented_ffi_reporting_statement_certification + + # Certifies that the FFI has provided or will provide an auditor’s letter and required owner documentation, including a reporting statement and Form W-9s, to meet owner-documented FFI requirements under the regulations. + attr_accessor :owner_documented_ffi_auditor_letter_certification + + # Certifies that the FFI operates solely as a limited bank or credit union within its country, meets asset thresholds, and has no foreign operations or affiliations outside its country of organization. + attr_accessor :compliant_nonregistering_local_bank_certification + + # Certifies that the FFI is not primarily engaged in investment activities, maintains only low-value accounts, and has limited total assets within its group. + attr_accessor :compliant_ffi_low_value_accounts_certification + + # The name of sponsoring entity for a certified deemed-compliant, closely held investment vehicle. + attr_accessor :sponsored_closely_held_entity_sponsoring_entity + + # Certifies that the entity is a sponsored investment entity with 20 or fewer individual owners, and that all compliance obligations are fulfilled by the sponsoring entity. + attr_accessor :sponsored_closely_held_investment_vehicle_certification + + # Certifies that the entity qualifies as a limited life debt investment entity based on its formation date, issuance terms, and compliance with regulatory requirements. + attr_accessor :compliant_limited_life_debt_entity_certification + + # Certifies that the entity is a financial institution solely because it is an investment entity under regulations and the entity does not maintain financial accounts. + attr_accessor :investment_entity_no_financial_accounts_certification + + # Certifies that the entity qualifies as a restricted distributor based on its operations, customer base, regulatory compliance, and financial and geographic limitations. + attr_accessor :restricted_distributor_certification + + # Certifies that the entity is, and has been, bound by distribution agreements prohibiting sales of fund interests to specified U.S. persons and certain non-U.S. entities. + attr_accessor :restricted_distributor_agreement_certification + + # Certifies that the entity complies with distribution restrictions for U.S.-linked investors and has addressed any preexisting sales in accordance with FATCA regulations. + attr_accessor :restricted_distributor_preexisting_sales_compliance_certification + + # Certifies that the entity is treated as the beneficial owner of the payment solely for purposes of chapter 4 under Regulations section 1.1471-6(d)(4). + attr_accessor :foreign_central_bank_of_issue_certification + + # Certifies that the entity meets the requirements to be considered a nonreporting financial institution to an applicable IGA. + attr_accessor :nonreporting_iga_ffi_certification + + # The country for the applicable IGA with the United States. + attr_accessor :iga_country + + # The applicable IGA model. + attr_accessor :iga_model + + # Specifies how the applicable IGA is treated under the IGA provisions or Treasury regulations. + attr_accessor :iga_legal_status_treatment + + # The trustee or sponsor name for the nonreporting IGA FFI. + attr_accessor :iga_ffi_trustee_or_sponsor + + # Indicates whether the trustee for the nonreporting IGA FFI is foreign. + attr_accessor :iga_ffi_trustee_is_foreign + + # Certifies that the entity is a pension or retirement fund established in a treaty country and is entitled to treaty benefits on U.S. source income. + attr_accessor :treaty_qualified_pension_fund_certification + + # Certifies that the entity is a government-regulated retirement fund meeting specific requirements for contributions, tax exemption, beneficiary limits, and distribution restrictions. + attr_accessor :qualified_retirement_fund_certification + + # Certifies that the entity is a government-regulated retirement fund with fewer than 50 participants, limited foreign ownership, and employer sponsorship that is not from investment entities or passive NFFEs. + attr_accessor :narrow_participation_retirement_fund_certification + + # Certifies that the entity is formed under a pension plan meeting section 401(a) requirements, except for being U.S.-trust funded. + attr_accessor :section401_a_equivalent_pension_plan_certification + + # Certifies that the entity is established solely to earn income for the benefit of qualifying retirement funds or accounts under applicable FATCA regulations or IGAs. + attr_accessor :investment_entity_for_retirement_funds_certification + + # Certifies that the entity is established and sponsored by a qualifying exempt beneficial owner to provide retirement, disability, or death benefits to individuals based on services performed for the sponsor. + attr_accessor :exempt_beneficial_owner_sponsored_retirement_fund_certification + + # Certifies that the entity is a holding company, treasury center, or captive finance company operating within a nonfinancial group and not functioning as an investment or financial institution. + attr_accessor :excepted_nonfinancial_group_entity_certification + + # Certifies that the entity is a recently formed startup NFFE investing in a non-financial business and is not operating as or presenting itself as an investment fund. + attr_accessor :excepted_nonfinancial_start_up_certification + + # The date the start-up company was formed on (or, in case of new line of business, the date of board resolution approving the new line of business). + attr_accessor :startup_formation_or_resolution_date + + # Certifies that the entity is in liquidation, reorganization, or bankruptcy and intends to operate as a nonfinancial entity, with supporting documentation available if the process exceeds three years. + attr_accessor :excepted_nonfinancial_entity_in_liquidation_or_bankruptcy_certification + + # The filed date for a plan of reorganization, liquidation or bankruptcy. + attr_accessor :nonfinancial_entity_filing_date + + # Certifies that the entity is a foreign corporation that is not a financial institution and whose stock is regularly traded on an established securities market. + attr_accessor :publicly_traded_nffe_certification + + # The name of the securities market where the corporation's stock is regularly traded. + attr_accessor :publicly_traded_nffe_securities_market + + # Certifies that the entity is a foreign corporation that is not a financial institution and is affiliated with a publicly traded entity within the same expanded affiliated group. + attr_accessor :nffe_affiliate_of_publicly_traded_entity_certification + + # The name of the affiliated entity whose stock is regularly traded on an established securities market. + attr_accessor :publicly_traded_entity + + # The name of the established securities market where the affiliated entity's stock is traded. + attr_accessor :nffe_affiliate_of_publicly_traded_entity_securities_market + + # Certifies that the entity is organized in a U.S. possession, is not engaged in financial activities, and is entirely owned by bona fide residents of that possession. + attr_accessor :excepted_territory_nffe_certification + + # Certifies that the entity is a foreign non-financial institution with less than 50% passive income and less than 50% of its assets producing or held to produce passive income. + attr_accessor :active_nffe_certification + + # Certifies that the entity is a foreign non-financial entity that does not qualify for any other NFFE category and is not a financial institution. + attr_accessor :passive_nffe_certification + + # Certifies that the entity is a sponsored direct reporting NFFE. + attr_accessor :sponsored_direct_reporting_nffe_certification + + # The name of the entity that sponsors the direct reporting NFFE. + attr_accessor :direct_reporting_nffe_sponsoring_entity + + # The name of the signer. + attr_accessor :signer_name + + # The ID of the associated company. + attr_accessor :company_id + + # A reference identifier for the form. + attr_accessor :reference_id + + # The email address of the individual associated with the form. + attr_accessor :email + + # The date when e-delivery was consented. + attr_accessor :e_delivery_consented_at + + # The signature of the form. + attr_accessor :signature + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'name' => :'name', + :'citizenship_country' => :'citizenshipCountry', + :'disregarded_entity' => :'disregardedEntity', + :'entity_type' => :'entityType', + :'fatca_status' => :'fatcaStatus', + :'residence_address' => :'residenceAddress', + :'residence_city' => :'residenceCity', + :'residence_state' => :'residenceState', + :'residence_zip' => :'residenceZip', + :'residence_country' => :'residenceCountry', + :'residence_is_mailing' => :'residenceIsMailing', + :'mailing_address' => :'mailingAddress', + :'mailing_city' => :'mailingCity', + :'mailing_state' => :'mailingState', + :'mailing_zip' => :'mailingZip', + :'mailing_country' => :'mailingCountry', + :'tin_type' => :'tinType', + :'tin' => :'tin', + :'giin' => :'giin', + :'foreign_tin' => :'foreignTin', + :'reference_number' => :'referenceNumber', + :'disregarded_entity_fatca_status' => :'disregardedEntityFatcaStatus', + :'disregarded_address' => :'disregardedAddress', + :'disregarded_city' => :'disregardedCity', + :'disregarded_state' => :'disregardedState', + :'disregarded_zip' => :'disregardedZip', + :'disregarded_country' => :'disregardedCountry', + :'disregarded_entity_giin' => :'disregardedEntityGiin', + :'qualified_intermediary_certification' => :'qualifiedIntermediaryCertification', + :'qi_primary_withholding_responsibility_certification' => :'qiPrimaryWithholdingResponsibilityCertification', + :'qi_withholding_responsibility_for_ptp_sales_certification' => :'qiWithholdingResponsibilityForPtpSalesCertification', + :'qi_nominee_withholding_responsibility_for_ptp_distributions_certification' => :'qiNomineeWithholdingResponsibilityForPtpDistributionsCertification', + :'qi_securities_lender_substitute_dividend_withholding_certification' => :'qiSecuritiesLenderSubstituteDividendWithholdingCertification', + :'qi_withholding_and1099_reporting_responsibility_certification' => :'qiWithholdingAnd1099ReportingResponsibilityCertification', + :'qi_form1099_or_fatca_reporting_responsibility_certification' => :'qiForm1099OrFatcaReportingResponsibilityCertification', + :'qi_opt_out_of_form1099_reporting_certification' => :'qiOptOutOfForm1099ReportingCertification', + :'qi_withholding_rate_pool_certification' => :'qiWithholdingRatePoolCertification', + :'qi_intermediary_or_flow_through_entity_documentation_certification' => :'qiIntermediaryOrFlowThroughEntityDocumentationCertification', + :'qualified_derivatives_dealer_certification' => :'qualifiedDerivativesDealerCertification', + :'qdd_corporation' => :'qddCorporation', + :'qdd_partnership' => :'qddPartnership', + :'qdd_disregarded_entity' => :'qddDisregardedEntity', + :'nonqualified_intermediary_certification' => :'nonqualifiedIntermediaryCertification', + :'nqi_withholding_statement_transmission_certification' => :'nqiWithholdingStatementTransmissionCertification', + :'nqi_withholding_rate_pool_compliance_certification' => :'nqiWithholdingRatePoolComplianceCertification', + :'nqi_qualified_securities_lender_certification' => :'nqiQualifiedSecuritiesLenderCertification', + :'nqi_alternative_withholding_statement_verification_certification' => :'nqiAlternativeWithholdingStatementVerificationCertification', + :'territory_financial_institution_certification' => :'territoryFinancialInstitutionCertification', + :'tfi_treated_as_us_person_certification' => :'tfiTreatedAsUsPersonCertification', + :'tfi_withholding_statement_transmission_certification' => :'tfiWithholdingStatementTransmissionCertification', + :'tfi_treated_as_us_person_for_ptp_sales_certification' => :'tfiTreatedAsUsPersonForPtpSalesCertification', + :'tfi_nominee_us_person_for_ptp_distributions_certification' => :'tfiNomineeUsPersonForPtpDistributionsCertification', + :'tfi_not_nominee_for_ptp_distributions_certification' => :'tfiNotNomineeForPtpDistributionsCertification', + :'us_branch_non_effectively_connected_income_certification' => :'usBranchNonEffectivelyConnectedIncomeCertification', + :'us_branch_agreement_to_be_treated_as_us_person_certification' => :'usBranchAgreementToBeTreatedAsUsPersonCertification', + :'us_branch_withholding_statement_and_compliance_certification' => :'usBranchWithholdingStatementAndComplianceCertification', + :'us_branch_acting_as_us_person_for_ptp_sales_certification' => :'usBranchActingAsUsPersonForPtpSalesCertification', + :'us_branch_nominee_for_ptp_distributions_certification' => :'usBranchNomineeForPtpDistributionsCertification', + :'us_branch_not_nominee_for_ptp_distributions_certification' => :'usBranchNotNomineeForPtpDistributionsCertification', + :'withholding_foreign_partnership_or_trust_certification' => :'withholdingForeignPartnershipOrTrustCertification', + :'nonwithholding_foreign_entity_withholding_statement_certification' => :'nonwithholdingForeignEntityWithholdingStatementCertification', + :'foreign_entity_partner_in_lower_tier_partnership_certification' => :'foreignEntityPartnerInLowerTierPartnershipCertification', + :'foreign_partnership_amount_realized_section1446_f_certification' => :'foreignPartnershipAmountRealizedSection1446FCertification', + :'foreign_partnership_modified_amount_realized_certification' => :'foreignPartnershipModifiedAmountRealizedCertification', + :'foreign_grantor_trust_amount_realized_allocation_certification' => :'foreignGrantorTrustAmountRealizedAllocationCertification', + :'alternative_withholding_statement_reliance_certification' => :'alternativeWithholdingStatementRelianceCertification', + :'np_ffi_with_exempt_beneficial_owners_certification' => :'npFfiWithExemptBeneficialOwnersCertification', + :'ffi_sponsoring_entity' => :'ffiSponsoringEntity', + :'investment_entity_certification' => :'investmentEntityCertification', + :'controlled_foreign_corporation_certification' => :'controlledForeignCorporationCertification', + :'owner_documented_ffi_certification' => :'ownerDocumentedFfiCertification', + :'owner_documented_ffi_reporting_statement_certification' => :'ownerDocumentedFfiReportingStatementCertification', + :'owner_documented_ffi_auditor_letter_certification' => :'ownerDocumentedFfiAuditorLetterCertification', + :'compliant_nonregistering_local_bank_certification' => :'compliantNonregisteringLocalBankCertification', + :'compliant_ffi_low_value_accounts_certification' => :'compliantFfiLowValueAccountsCertification', + :'sponsored_closely_held_entity_sponsoring_entity' => :'sponsoredCloselyHeldEntitySponsoringEntity', + :'sponsored_closely_held_investment_vehicle_certification' => :'sponsoredCloselyHeldInvestmentVehicleCertification', + :'compliant_limited_life_debt_entity_certification' => :'compliantLimitedLifeDebtEntityCertification', + :'investment_entity_no_financial_accounts_certification' => :'investmentEntityNoFinancialAccountsCertification', + :'restricted_distributor_certification' => :'restrictedDistributorCertification', + :'restricted_distributor_agreement_certification' => :'restrictedDistributorAgreementCertification', + :'restricted_distributor_preexisting_sales_compliance_certification' => :'restrictedDistributorPreexistingSalesComplianceCertification', + :'foreign_central_bank_of_issue_certification' => :'foreignCentralBankOfIssueCertification', + :'nonreporting_iga_ffi_certification' => :'nonreportingIgaFfiCertification', + :'iga_country' => :'igaCountry', + :'iga_model' => :'igaModel', + :'iga_legal_status_treatment' => :'igaLegalStatusTreatment', + :'iga_ffi_trustee_or_sponsor' => :'igaFfiTrusteeOrSponsor', + :'iga_ffi_trustee_is_foreign' => :'igaFfiTrusteeIsForeign', + :'treaty_qualified_pension_fund_certification' => :'treatyQualifiedPensionFundCertification', + :'qualified_retirement_fund_certification' => :'qualifiedRetirementFundCertification', + :'narrow_participation_retirement_fund_certification' => :'narrowParticipationRetirementFundCertification', + :'section401_a_equivalent_pension_plan_certification' => :'section401AEquivalentPensionPlanCertification', + :'investment_entity_for_retirement_funds_certification' => :'investmentEntityForRetirementFundsCertification', + :'exempt_beneficial_owner_sponsored_retirement_fund_certification' => :'exemptBeneficialOwnerSponsoredRetirementFundCertification', + :'excepted_nonfinancial_group_entity_certification' => :'exceptedNonfinancialGroupEntityCertification', + :'excepted_nonfinancial_start_up_certification' => :'exceptedNonfinancialStartUpCertification', + :'startup_formation_or_resolution_date' => :'startupFormationOrResolutionDate', + :'excepted_nonfinancial_entity_in_liquidation_or_bankruptcy_certification' => :'exceptedNonfinancialEntityInLiquidationOrBankruptcyCertification', + :'nonfinancial_entity_filing_date' => :'nonfinancialEntityFilingDate', + :'publicly_traded_nffe_certification' => :'publiclyTradedNffeCertification', + :'publicly_traded_nffe_securities_market' => :'publiclyTradedNffeSecuritiesMarket', + :'nffe_affiliate_of_publicly_traded_entity_certification' => :'nffeAffiliateOfPubliclyTradedEntityCertification', + :'publicly_traded_entity' => :'publiclyTradedEntity', + :'nffe_affiliate_of_publicly_traded_entity_securities_market' => :'nffeAffiliateOfPubliclyTradedEntitySecuritiesMarket', + :'excepted_territory_nffe_certification' => :'exceptedTerritoryNffeCertification', + :'active_nffe_certification' => :'activeNffeCertification', + :'passive_nffe_certification' => :'passiveNffeCertification', + :'sponsored_direct_reporting_nffe_certification' => :'sponsoredDirectReportingNffeCertification', + :'direct_reporting_nffe_sponsoring_entity' => :'directReportingNffeSponsoringEntity', + :'signer_name' => :'signerName', + :'company_id' => :'companyId', + :'reference_id' => :'referenceId', + :'email' => :'email', + :'e_delivery_consented_at' => :'eDeliveryConsentedAt', + :'signature' => :'signature' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'String', + :'name' => :'String', + :'citizenship_country' => :'String', + :'disregarded_entity' => :'String', + :'entity_type' => :'String', + :'fatca_status' => :'String', + :'residence_address' => :'String', + :'residence_city' => :'String', + :'residence_state' => :'String', + :'residence_zip' => :'String', + :'residence_country' => :'String', + :'residence_is_mailing' => :'Boolean', + :'mailing_address' => :'String', + :'mailing_city' => :'String', + :'mailing_state' => :'String', + :'mailing_zip' => :'String', + :'mailing_country' => :'String', + :'tin_type' => :'String', + :'tin' => :'String', + :'giin' => :'String', + :'foreign_tin' => :'String', + :'reference_number' => :'String', + :'disregarded_entity_fatca_status' => :'String', + :'disregarded_address' => :'String', + :'disregarded_city' => :'String', + :'disregarded_state' => :'String', + :'disregarded_zip' => :'String', + :'disregarded_country' => :'String', + :'disregarded_entity_giin' => :'String', + :'qualified_intermediary_certification' => :'Boolean', + :'qi_primary_withholding_responsibility_certification' => :'Boolean', + :'qi_withholding_responsibility_for_ptp_sales_certification' => :'Boolean', + :'qi_nominee_withholding_responsibility_for_ptp_distributions_certification' => :'Boolean', + :'qi_securities_lender_substitute_dividend_withholding_certification' => :'Boolean', + :'qi_withholding_and1099_reporting_responsibility_certification' => :'Boolean', + :'qi_form1099_or_fatca_reporting_responsibility_certification' => :'Boolean', + :'qi_opt_out_of_form1099_reporting_certification' => :'Boolean', + :'qi_withholding_rate_pool_certification' => :'Boolean', + :'qi_intermediary_or_flow_through_entity_documentation_certification' => :'Boolean', + :'qualified_derivatives_dealer_certification' => :'Boolean', + :'qdd_corporation' => :'Boolean', + :'qdd_partnership' => :'Boolean', + :'qdd_disregarded_entity' => :'Boolean', + :'nonqualified_intermediary_certification' => :'Boolean', + :'nqi_withholding_statement_transmission_certification' => :'Boolean', + :'nqi_withholding_rate_pool_compliance_certification' => :'Boolean', + :'nqi_qualified_securities_lender_certification' => :'Boolean', + :'nqi_alternative_withholding_statement_verification_certification' => :'Boolean', + :'territory_financial_institution_certification' => :'Boolean', + :'tfi_treated_as_us_person_certification' => :'Boolean', + :'tfi_withholding_statement_transmission_certification' => :'Boolean', + :'tfi_treated_as_us_person_for_ptp_sales_certification' => :'Boolean', + :'tfi_nominee_us_person_for_ptp_distributions_certification' => :'Boolean', + :'tfi_not_nominee_for_ptp_distributions_certification' => :'Boolean', + :'us_branch_non_effectively_connected_income_certification' => :'Boolean', + :'us_branch_agreement_to_be_treated_as_us_person_certification' => :'Boolean', + :'us_branch_withholding_statement_and_compliance_certification' => :'Boolean', + :'us_branch_acting_as_us_person_for_ptp_sales_certification' => :'Boolean', + :'us_branch_nominee_for_ptp_distributions_certification' => :'Boolean', + :'us_branch_not_nominee_for_ptp_distributions_certification' => :'Boolean', + :'withholding_foreign_partnership_or_trust_certification' => :'Boolean', + :'nonwithholding_foreign_entity_withholding_statement_certification' => :'Boolean', + :'foreign_entity_partner_in_lower_tier_partnership_certification' => :'Boolean', + :'foreign_partnership_amount_realized_section1446_f_certification' => :'Boolean', + :'foreign_partnership_modified_amount_realized_certification' => :'Boolean', + :'foreign_grantor_trust_amount_realized_allocation_certification' => :'Boolean', + :'alternative_withholding_statement_reliance_certification' => :'Boolean', + :'np_ffi_with_exempt_beneficial_owners_certification' => :'Boolean', + :'ffi_sponsoring_entity' => :'String', + :'investment_entity_certification' => :'Boolean', + :'controlled_foreign_corporation_certification' => :'Boolean', + :'owner_documented_ffi_certification' => :'Boolean', + :'owner_documented_ffi_reporting_statement_certification' => :'Boolean', + :'owner_documented_ffi_auditor_letter_certification' => :'Boolean', + :'compliant_nonregistering_local_bank_certification' => :'Boolean', + :'compliant_ffi_low_value_accounts_certification' => :'Boolean', + :'sponsored_closely_held_entity_sponsoring_entity' => :'String', + :'sponsored_closely_held_investment_vehicle_certification' => :'Boolean', + :'compliant_limited_life_debt_entity_certification' => :'Boolean', + :'investment_entity_no_financial_accounts_certification' => :'Boolean', + :'restricted_distributor_certification' => :'Boolean', + :'restricted_distributor_agreement_certification' => :'Boolean', + :'restricted_distributor_preexisting_sales_compliance_certification' => :'Boolean', + :'foreign_central_bank_of_issue_certification' => :'Boolean', + :'nonreporting_iga_ffi_certification' => :'Boolean', + :'iga_country' => :'String', + :'iga_model' => :'String', + :'iga_legal_status_treatment' => :'String', + :'iga_ffi_trustee_or_sponsor' => :'String', + :'iga_ffi_trustee_is_foreign' => :'Boolean', + :'treaty_qualified_pension_fund_certification' => :'Boolean', + :'qualified_retirement_fund_certification' => :'Boolean', + :'narrow_participation_retirement_fund_certification' => :'Boolean', + :'section401_a_equivalent_pension_plan_certification' => :'Boolean', + :'investment_entity_for_retirement_funds_certification' => :'Boolean', + :'exempt_beneficial_owner_sponsored_retirement_fund_certification' => :'Boolean', + :'excepted_nonfinancial_group_entity_certification' => :'Boolean', + :'excepted_nonfinancial_start_up_certification' => :'Boolean', + :'startup_formation_or_resolution_date' => :'Date', + :'excepted_nonfinancial_entity_in_liquidation_or_bankruptcy_certification' => :'Boolean', + :'nonfinancial_entity_filing_date' => :'Date', + :'publicly_traded_nffe_certification' => :'Boolean', + :'publicly_traded_nffe_securities_market' => :'String', + :'nffe_affiliate_of_publicly_traded_entity_certification' => :'Boolean', + :'publicly_traded_entity' => :'String', + :'nffe_affiliate_of_publicly_traded_entity_securities_market' => :'String', + :'excepted_territory_nffe_certification' => :'Boolean', + :'active_nffe_certification' => :'Boolean', + :'passive_nffe_certification' => :'Boolean', + :'sponsored_direct_reporting_nffe_certification' => :'Boolean', + :'direct_reporting_nffe_sponsoring_entity' => :'String', + :'signer_name' => :'String', + :'company_id' => :'String', + :'reference_id' => :'String', + :'email' => :'String', + :'e_delivery_consented_at' => :'Time', + :'signature' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'disregarded_entity', + :'residence_state', + :'mailing_address', + :'mailing_city', + :'mailing_state', + :'mailing_zip', + :'mailing_country', + :'tin_type', + :'tin', + :'giin', + :'foreign_tin', + :'reference_number', + :'disregarded_entity_fatca_status', + :'disregarded_address', + :'disregarded_city', + :'disregarded_state', + :'disregarded_zip', + :'disregarded_country', + :'disregarded_entity_giin', + :'qualified_intermediary_certification', + :'qi_primary_withholding_responsibility_certification', + :'qi_withholding_responsibility_for_ptp_sales_certification', + :'qi_nominee_withholding_responsibility_for_ptp_distributions_certification', + :'qi_securities_lender_substitute_dividend_withholding_certification', + :'qi_withholding_and1099_reporting_responsibility_certification', + :'qi_form1099_or_fatca_reporting_responsibility_certification', + :'qi_opt_out_of_form1099_reporting_certification', + :'qi_withholding_rate_pool_certification', + :'qi_intermediary_or_flow_through_entity_documentation_certification', + :'qualified_derivatives_dealer_certification', + :'qdd_corporation', + :'qdd_partnership', + :'qdd_disregarded_entity', + :'nonqualified_intermediary_certification', + :'nqi_withholding_statement_transmission_certification', + :'nqi_withholding_rate_pool_compliance_certification', + :'nqi_qualified_securities_lender_certification', + :'nqi_alternative_withholding_statement_verification_certification', + :'territory_financial_institution_certification', + :'tfi_treated_as_us_person_certification', + :'tfi_withholding_statement_transmission_certification', + :'tfi_treated_as_us_person_for_ptp_sales_certification', + :'tfi_nominee_us_person_for_ptp_distributions_certification', + :'tfi_not_nominee_for_ptp_distributions_certification', + :'us_branch_non_effectively_connected_income_certification', + :'us_branch_agreement_to_be_treated_as_us_person_certification', + :'us_branch_withholding_statement_and_compliance_certification', + :'us_branch_acting_as_us_person_for_ptp_sales_certification', + :'us_branch_nominee_for_ptp_distributions_certification', + :'us_branch_not_nominee_for_ptp_distributions_certification', + :'withholding_foreign_partnership_or_trust_certification', + :'nonwithholding_foreign_entity_withholding_statement_certification', + :'foreign_entity_partner_in_lower_tier_partnership_certification', + :'foreign_partnership_amount_realized_section1446_f_certification', + :'foreign_partnership_modified_amount_realized_certification', + :'foreign_grantor_trust_amount_realized_allocation_certification', + :'alternative_withholding_statement_reliance_certification', + :'np_ffi_with_exempt_beneficial_owners_certification', + :'ffi_sponsoring_entity', + :'investment_entity_certification', + :'controlled_foreign_corporation_certification', + :'owner_documented_ffi_certification', + :'owner_documented_ffi_reporting_statement_certification', + :'owner_documented_ffi_auditor_letter_certification', + :'compliant_nonregistering_local_bank_certification', + :'compliant_ffi_low_value_accounts_certification', + :'sponsored_closely_held_entity_sponsoring_entity', + :'sponsored_closely_held_investment_vehicle_certification', + :'compliant_limited_life_debt_entity_certification', + :'investment_entity_no_financial_accounts_certification', + :'restricted_distributor_certification', + :'restricted_distributor_agreement_certification', + :'restricted_distributor_preexisting_sales_compliance_certification', + :'foreign_central_bank_of_issue_certification', + :'nonreporting_iga_ffi_certification', + :'iga_country', + :'iga_model', + :'iga_legal_status_treatment', + :'iga_ffi_trustee_or_sponsor', + :'iga_ffi_trustee_is_foreign', + :'treaty_qualified_pension_fund_certification', + :'qualified_retirement_fund_certification', + :'narrow_participation_retirement_fund_certification', + :'section401_a_equivalent_pension_plan_certification', + :'investment_entity_for_retirement_funds_certification', + :'exempt_beneficial_owner_sponsored_retirement_fund_certification', + :'excepted_nonfinancial_group_entity_certification', + :'excepted_nonfinancial_start_up_certification', + :'startup_formation_or_resolution_date', + :'excepted_nonfinancial_entity_in_liquidation_or_bankruptcy_certification', + :'nonfinancial_entity_filing_date', + :'publicly_traded_nffe_certification', + :'publicly_traded_nffe_securities_market', + :'nffe_affiliate_of_publicly_traded_entity_certification', + :'publicly_traded_entity', + :'nffe_affiliate_of_publicly_traded_entity_securities_market', + :'excepted_territory_nffe_certification', + :'active_nffe_certification', + :'passive_nffe_certification', + :'sponsored_direct_reporting_nffe_certification', + :'direct_reporting_nffe_sponsoring_entity', + :'signer_name', + :'reference_id', + :'email', + :'e_delivery_consented_at', + :'signature' + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'W9FormBaseRequest' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::A1099::V2::W8ImyFormRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::A1099::V2::W8ImyFormRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'citizenship_country') + self.citizenship_country = attributes[:'citizenship_country'] + end + + if attributes.key?(:'disregarded_entity') + self.disregarded_entity = attributes[:'disregarded_entity'] + end + + if attributes.key?(:'entity_type') + self.entity_type = attributes[:'entity_type'] + end + + if attributes.key?(:'fatca_status') + self.fatca_status = attributes[:'fatca_status'] + end + + if attributes.key?(:'residence_address') + self.residence_address = attributes[:'residence_address'] + end + + if attributes.key?(:'residence_city') + self.residence_city = attributes[:'residence_city'] + end + + if attributes.key?(:'residence_state') + self.residence_state = attributes[:'residence_state'] + end + + if attributes.key?(:'residence_zip') + self.residence_zip = attributes[:'residence_zip'] + end + + if attributes.key?(:'residence_country') + self.residence_country = attributes[:'residence_country'] + end + + if attributes.key?(:'residence_is_mailing') + self.residence_is_mailing = attributes[:'residence_is_mailing'] + end + + if attributes.key?(:'mailing_address') + self.mailing_address = attributes[:'mailing_address'] + end + + if attributes.key?(:'mailing_city') + self.mailing_city = attributes[:'mailing_city'] + end + + if attributes.key?(:'mailing_state') + self.mailing_state = attributes[:'mailing_state'] + end + + if attributes.key?(:'mailing_zip') + self.mailing_zip = attributes[:'mailing_zip'] + end + + if attributes.key?(:'mailing_country') + self.mailing_country = attributes[:'mailing_country'] + end + + if attributes.key?(:'tin_type') + self.tin_type = attributes[:'tin_type'] + end + + if attributes.key?(:'tin') + self.tin = attributes[:'tin'] + end + + if attributes.key?(:'giin') + self.giin = attributes[:'giin'] + end + + if attributes.key?(:'foreign_tin') + self.foreign_tin = attributes[:'foreign_tin'] + end + + if attributes.key?(:'reference_number') + self.reference_number = attributes[:'reference_number'] + end + + if attributes.key?(:'disregarded_entity_fatca_status') + self.disregarded_entity_fatca_status = attributes[:'disregarded_entity_fatca_status'] + end + + if attributes.key?(:'disregarded_address') + self.disregarded_address = attributes[:'disregarded_address'] + end + + if attributes.key?(:'disregarded_city') + self.disregarded_city = attributes[:'disregarded_city'] + end + + if attributes.key?(:'disregarded_state') + self.disregarded_state = attributes[:'disregarded_state'] + end + + if attributes.key?(:'disregarded_zip') + self.disregarded_zip = attributes[:'disregarded_zip'] + end + + if attributes.key?(:'disregarded_country') + self.disregarded_country = attributes[:'disregarded_country'] + end + + if attributes.key?(:'disregarded_entity_giin') + self.disregarded_entity_giin = attributes[:'disregarded_entity_giin'] + end + + if attributes.key?(:'qualified_intermediary_certification') + self.qualified_intermediary_certification = attributes[:'qualified_intermediary_certification'] + end + + if attributes.key?(:'qi_primary_withholding_responsibility_certification') + self.qi_primary_withholding_responsibility_certification = attributes[:'qi_primary_withholding_responsibility_certification'] + end + + if attributes.key?(:'qi_withholding_responsibility_for_ptp_sales_certification') + self.qi_withholding_responsibility_for_ptp_sales_certification = attributes[:'qi_withholding_responsibility_for_ptp_sales_certification'] + end + + if attributes.key?(:'qi_nominee_withholding_responsibility_for_ptp_distributions_certification') + self.qi_nominee_withholding_responsibility_for_ptp_distributions_certification = attributes[:'qi_nominee_withholding_responsibility_for_ptp_distributions_certification'] + end + + if attributes.key?(:'qi_securities_lender_substitute_dividend_withholding_certification') + self.qi_securities_lender_substitute_dividend_withholding_certification = attributes[:'qi_securities_lender_substitute_dividend_withholding_certification'] + end + + if attributes.key?(:'qi_withholding_and1099_reporting_responsibility_certification') + self.qi_withholding_and1099_reporting_responsibility_certification = attributes[:'qi_withholding_and1099_reporting_responsibility_certification'] + end + + if attributes.key?(:'qi_form1099_or_fatca_reporting_responsibility_certification') + self.qi_form1099_or_fatca_reporting_responsibility_certification = attributes[:'qi_form1099_or_fatca_reporting_responsibility_certification'] + end + + if attributes.key?(:'qi_opt_out_of_form1099_reporting_certification') + self.qi_opt_out_of_form1099_reporting_certification = attributes[:'qi_opt_out_of_form1099_reporting_certification'] + end + + if attributes.key?(:'qi_withholding_rate_pool_certification') + self.qi_withholding_rate_pool_certification = attributes[:'qi_withholding_rate_pool_certification'] + end + + if attributes.key?(:'qi_intermediary_or_flow_through_entity_documentation_certification') + self.qi_intermediary_or_flow_through_entity_documentation_certification = attributes[:'qi_intermediary_or_flow_through_entity_documentation_certification'] + end + + if attributes.key?(:'qualified_derivatives_dealer_certification') + self.qualified_derivatives_dealer_certification = attributes[:'qualified_derivatives_dealer_certification'] + end + + if attributes.key?(:'qdd_corporation') + self.qdd_corporation = attributes[:'qdd_corporation'] + end + + if attributes.key?(:'qdd_partnership') + self.qdd_partnership = attributes[:'qdd_partnership'] + end + + if attributes.key?(:'qdd_disregarded_entity') + self.qdd_disregarded_entity = attributes[:'qdd_disregarded_entity'] + end + + if attributes.key?(:'nonqualified_intermediary_certification') + self.nonqualified_intermediary_certification = attributes[:'nonqualified_intermediary_certification'] + end + + if attributes.key?(:'nqi_withholding_statement_transmission_certification') + self.nqi_withholding_statement_transmission_certification = attributes[:'nqi_withholding_statement_transmission_certification'] + end + + if attributes.key?(:'nqi_withholding_rate_pool_compliance_certification') + self.nqi_withholding_rate_pool_compliance_certification = attributes[:'nqi_withholding_rate_pool_compliance_certification'] + end + + if attributes.key?(:'nqi_qualified_securities_lender_certification') + self.nqi_qualified_securities_lender_certification = attributes[:'nqi_qualified_securities_lender_certification'] + end + + if attributes.key?(:'nqi_alternative_withholding_statement_verification_certification') + self.nqi_alternative_withholding_statement_verification_certification = attributes[:'nqi_alternative_withholding_statement_verification_certification'] + end + + if attributes.key?(:'territory_financial_institution_certification') + self.territory_financial_institution_certification = attributes[:'territory_financial_institution_certification'] + end + + if attributes.key?(:'tfi_treated_as_us_person_certification') + self.tfi_treated_as_us_person_certification = attributes[:'tfi_treated_as_us_person_certification'] + end + + if attributes.key?(:'tfi_withholding_statement_transmission_certification') + self.tfi_withholding_statement_transmission_certification = attributes[:'tfi_withholding_statement_transmission_certification'] + end + + if attributes.key?(:'tfi_treated_as_us_person_for_ptp_sales_certification') + self.tfi_treated_as_us_person_for_ptp_sales_certification = attributes[:'tfi_treated_as_us_person_for_ptp_sales_certification'] + end + + if attributes.key?(:'tfi_nominee_us_person_for_ptp_distributions_certification') + self.tfi_nominee_us_person_for_ptp_distributions_certification = attributes[:'tfi_nominee_us_person_for_ptp_distributions_certification'] + end + + if attributes.key?(:'tfi_not_nominee_for_ptp_distributions_certification') + self.tfi_not_nominee_for_ptp_distributions_certification = attributes[:'tfi_not_nominee_for_ptp_distributions_certification'] + end + + if attributes.key?(:'us_branch_non_effectively_connected_income_certification') + self.us_branch_non_effectively_connected_income_certification = attributes[:'us_branch_non_effectively_connected_income_certification'] + end + + if attributes.key?(:'us_branch_agreement_to_be_treated_as_us_person_certification') + self.us_branch_agreement_to_be_treated_as_us_person_certification = attributes[:'us_branch_agreement_to_be_treated_as_us_person_certification'] + end + + if attributes.key?(:'us_branch_withholding_statement_and_compliance_certification') + self.us_branch_withholding_statement_and_compliance_certification = attributes[:'us_branch_withholding_statement_and_compliance_certification'] + end + + if attributes.key?(:'us_branch_acting_as_us_person_for_ptp_sales_certification') + self.us_branch_acting_as_us_person_for_ptp_sales_certification = attributes[:'us_branch_acting_as_us_person_for_ptp_sales_certification'] + end + + if attributes.key?(:'us_branch_nominee_for_ptp_distributions_certification') + self.us_branch_nominee_for_ptp_distributions_certification = attributes[:'us_branch_nominee_for_ptp_distributions_certification'] + end + + if attributes.key?(:'us_branch_not_nominee_for_ptp_distributions_certification') + self.us_branch_not_nominee_for_ptp_distributions_certification = attributes[:'us_branch_not_nominee_for_ptp_distributions_certification'] + end + + if attributes.key?(:'withholding_foreign_partnership_or_trust_certification') + self.withholding_foreign_partnership_or_trust_certification = attributes[:'withholding_foreign_partnership_or_trust_certification'] + end + + if attributes.key?(:'nonwithholding_foreign_entity_withholding_statement_certification') + self.nonwithholding_foreign_entity_withholding_statement_certification = attributes[:'nonwithholding_foreign_entity_withholding_statement_certification'] + end + + if attributes.key?(:'foreign_entity_partner_in_lower_tier_partnership_certification') + self.foreign_entity_partner_in_lower_tier_partnership_certification = attributes[:'foreign_entity_partner_in_lower_tier_partnership_certification'] + end + + if attributes.key?(:'foreign_partnership_amount_realized_section1446_f_certification') + self.foreign_partnership_amount_realized_section1446_f_certification = attributes[:'foreign_partnership_amount_realized_section1446_f_certification'] + end + + if attributes.key?(:'foreign_partnership_modified_amount_realized_certification') + self.foreign_partnership_modified_amount_realized_certification = attributes[:'foreign_partnership_modified_amount_realized_certification'] + end + + if attributes.key?(:'foreign_grantor_trust_amount_realized_allocation_certification') + self.foreign_grantor_trust_amount_realized_allocation_certification = attributes[:'foreign_grantor_trust_amount_realized_allocation_certification'] + end + + if attributes.key?(:'alternative_withholding_statement_reliance_certification') + self.alternative_withholding_statement_reliance_certification = attributes[:'alternative_withholding_statement_reliance_certification'] + end + + if attributes.key?(:'np_ffi_with_exempt_beneficial_owners_certification') + self.np_ffi_with_exempt_beneficial_owners_certification = attributes[:'np_ffi_with_exempt_beneficial_owners_certification'] + end + + if attributes.key?(:'ffi_sponsoring_entity') + self.ffi_sponsoring_entity = attributes[:'ffi_sponsoring_entity'] + end + + if attributes.key?(:'investment_entity_certification') + self.investment_entity_certification = attributes[:'investment_entity_certification'] + end + + if attributes.key?(:'controlled_foreign_corporation_certification') + self.controlled_foreign_corporation_certification = attributes[:'controlled_foreign_corporation_certification'] + end + + if attributes.key?(:'owner_documented_ffi_certification') + self.owner_documented_ffi_certification = attributes[:'owner_documented_ffi_certification'] + end + + if attributes.key?(:'owner_documented_ffi_reporting_statement_certification') + self.owner_documented_ffi_reporting_statement_certification = attributes[:'owner_documented_ffi_reporting_statement_certification'] + end + + if attributes.key?(:'owner_documented_ffi_auditor_letter_certification') + self.owner_documented_ffi_auditor_letter_certification = attributes[:'owner_documented_ffi_auditor_letter_certification'] + end + + if attributes.key?(:'compliant_nonregistering_local_bank_certification') + self.compliant_nonregistering_local_bank_certification = attributes[:'compliant_nonregistering_local_bank_certification'] + end + + if attributes.key?(:'compliant_ffi_low_value_accounts_certification') + self.compliant_ffi_low_value_accounts_certification = attributes[:'compliant_ffi_low_value_accounts_certification'] + end + + if attributes.key?(:'sponsored_closely_held_entity_sponsoring_entity') + self.sponsored_closely_held_entity_sponsoring_entity = attributes[:'sponsored_closely_held_entity_sponsoring_entity'] + end + + if attributes.key?(:'sponsored_closely_held_investment_vehicle_certification') + self.sponsored_closely_held_investment_vehicle_certification = attributes[:'sponsored_closely_held_investment_vehicle_certification'] + end + + if attributes.key?(:'compliant_limited_life_debt_entity_certification') + self.compliant_limited_life_debt_entity_certification = attributes[:'compliant_limited_life_debt_entity_certification'] + end + + if attributes.key?(:'investment_entity_no_financial_accounts_certification') + self.investment_entity_no_financial_accounts_certification = attributes[:'investment_entity_no_financial_accounts_certification'] + end + + if attributes.key?(:'restricted_distributor_certification') + self.restricted_distributor_certification = attributes[:'restricted_distributor_certification'] + end + + if attributes.key?(:'restricted_distributor_agreement_certification') + self.restricted_distributor_agreement_certification = attributes[:'restricted_distributor_agreement_certification'] + end + + if attributes.key?(:'restricted_distributor_preexisting_sales_compliance_certification') + self.restricted_distributor_preexisting_sales_compliance_certification = attributes[:'restricted_distributor_preexisting_sales_compliance_certification'] + end + + if attributes.key?(:'foreign_central_bank_of_issue_certification') + self.foreign_central_bank_of_issue_certification = attributes[:'foreign_central_bank_of_issue_certification'] + end + + if attributes.key?(:'nonreporting_iga_ffi_certification') + self.nonreporting_iga_ffi_certification = attributes[:'nonreporting_iga_ffi_certification'] + end + + if attributes.key?(:'iga_country') + self.iga_country = attributes[:'iga_country'] + end + + if attributes.key?(:'iga_model') + self.iga_model = attributes[:'iga_model'] + end + + if attributes.key?(:'iga_legal_status_treatment') + self.iga_legal_status_treatment = attributes[:'iga_legal_status_treatment'] + end + + if attributes.key?(:'iga_ffi_trustee_or_sponsor') + self.iga_ffi_trustee_or_sponsor = attributes[:'iga_ffi_trustee_or_sponsor'] + end + + if attributes.key?(:'iga_ffi_trustee_is_foreign') + self.iga_ffi_trustee_is_foreign = attributes[:'iga_ffi_trustee_is_foreign'] + end + + if attributes.key?(:'treaty_qualified_pension_fund_certification') + self.treaty_qualified_pension_fund_certification = attributes[:'treaty_qualified_pension_fund_certification'] + end + + if attributes.key?(:'qualified_retirement_fund_certification') + self.qualified_retirement_fund_certification = attributes[:'qualified_retirement_fund_certification'] + end + + if attributes.key?(:'narrow_participation_retirement_fund_certification') + self.narrow_participation_retirement_fund_certification = attributes[:'narrow_participation_retirement_fund_certification'] + end + + if attributes.key?(:'section401_a_equivalent_pension_plan_certification') + self.section401_a_equivalent_pension_plan_certification = attributes[:'section401_a_equivalent_pension_plan_certification'] + end + + if attributes.key?(:'investment_entity_for_retirement_funds_certification') + self.investment_entity_for_retirement_funds_certification = attributes[:'investment_entity_for_retirement_funds_certification'] + end + + if attributes.key?(:'exempt_beneficial_owner_sponsored_retirement_fund_certification') + self.exempt_beneficial_owner_sponsored_retirement_fund_certification = attributes[:'exempt_beneficial_owner_sponsored_retirement_fund_certification'] + end + + if attributes.key?(:'excepted_nonfinancial_group_entity_certification') + self.excepted_nonfinancial_group_entity_certification = attributes[:'excepted_nonfinancial_group_entity_certification'] + end + + if attributes.key?(:'excepted_nonfinancial_start_up_certification') + self.excepted_nonfinancial_start_up_certification = attributes[:'excepted_nonfinancial_start_up_certification'] + end + + if attributes.key?(:'startup_formation_or_resolution_date') + self.startup_formation_or_resolution_date = attributes[:'startup_formation_or_resolution_date'] + end + + if attributes.key?(:'excepted_nonfinancial_entity_in_liquidation_or_bankruptcy_certification') + self.excepted_nonfinancial_entity_in_liquidation_or_bankruptcy_certification = attributes[:'excepted_nonfinancial_entity_in_liquidation_or_bankruptcy_certification'] + end + + if attributes.key?(:'nonfinancial_entity_filing_date') + self.nonfinancial_entity_filing_date = attributes[:'nonfinancial_entity_filing_date'] + end + + if attributes.key?(:'publicly_traded_nffe_certification') + self.publicly_traded_nffe_certification = attributes[:'publicly_traded_nffe_certification'] + end + + if attributes.key?(:'publicly_traded_nffe_securities_market') + self.publicly_traded_nffe_securities_market = attributes[:'publicly_traded_nffe_securities_market'] + end + + if attributes.key?(:'nffe_affiliate_of_publicly_traded_entity_certification') + self.nffe_affiliate_of_publicly_traded_entity_certification = attributes[:'nffe_affiliate_of_publicly_traded_entity_certification'] + end + + if attributes.key?(:'publicly_traded_entity') + self.publicly_traded_entity = attributes[:'publicly_traded_entity'] + end + + if attributes.key?(:'nffe_affiliate_of_publicly_traded_entity_securities_market') + self.nffe_affiliate_of_publicly_traded_entity_securities_market = attributes[:'nffe_affiliate_of_publicly_traded_entity_securities_market'] + end + + if attributes.key?(:'excepted_territory_nffe_certification') + self.excepted_territory_nffe_certification = attributes[:'excepted_territory_nffe_certification'] + end + + if attributes.key?(:'active_nffe_certification') + self.active_nffe_certification = attributes[:'active_nffe_certification'] + end + + if attributes.key?(:'passive_nffe_certification') + self.passive_nffe_certification = attributes[:'passive_nffe_certification'] + end + + if attributes.key?(:'sponsored_direct_reporting_nffe_certification') + self.sponsored_direct_reporting_nffe_certification = attributes[:'sponsored_direct_reporting_nffe_certification'] + end + + if attributes.key?(:'direct_reporting_nffe_sponsoring_entity') + self.direct_reporting_nffe_sponsoring_entity = attributes[:'direct_reporting_nffe_sponsoring_entity'] + end + + if attributes.key?(:'signer_name') + self.signer_name = attributes[:'signer_name'] + end + + if attributes.key?(:'company_id') + self.company_id = attributes[:'company_id'] + end + + if attributes.key?(:'reference_id') + self.reference_id = attributes[:'reference_id'] + end + + if attributes.key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.key?(:'e_delivery_consented_at') + self.e_delivery_consented_at = attributes[:'e_delivery_consented_at'] + end + + if attributes.key?(:'signature') + self.signature = attributes[:'signature'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + type_validator = EnumAttributeValidator.new('String', ["W4", "W8Ben", "W8BenE", "W8Imy", "W9"]) + return false unless type_validator.valid?(@type) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["W4", "W8Ben", "W8BenE", "W8Imy", "W9"]) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + name == o.name && + citizenship_country == o.citizenship_country && + disregarded_entity == o.disregarded_entity && + entity_type == o.entity_type && + fatca_status == o.fatca_status && + residence_address == o.residence_address && + residence_city == o.residence_city && + residence_state == o.residence_state && + residence_zip == o.residence_zip && + residence_country == o.residence_country && + residence_is_mailing == o.residence_is_mailing && + mailing_address == o.mailing_address && + mailing_city == o.mailing_city && + mailing_state == o.mailing_state && + mailing_zip == o.mailing_zip && + mailing_country == o.mailing_country && + tin_type == o.tin_type && + tin == o.tin && + giin == o.giin && + foreign_tin == o.foreign_tin && + reference_number == o.reference_number && + disregarded_entity_fatca_status == o.disregarded_entity_fatca_status && + disregarded_address == o.disregarded_address && + disregarded_city == o.disregarded_city && + disregarded_state == o.disregarded_state && + disregarded_zip == o.disregarded_zip && + disregarded_country == o.disregarded_country && + disregarded_entity_giin == o.disregarded_entity_giin && + qualified_intermediary_certification == o.qualified_intermediary_certification && + qi_primary_withholding_responsibility_certification == o.qi_primary_withholding_responsibility_certification && + qi_withholding_responsibility_for_ptp_sales_certification == o.qi_withholding_responsibility_for_ptp_sales_certification && + qi_nominee_withholding_responsibility_for_ptp_distributions_certification == o.qi_nominee_withholding_responsibility_for_ptp_distributions_certification && + qi_securities_lender_substitute_dividend_withholding_certification == o.qi_securities_lender_substitute_dividend_withholding_certification && + qi_withholding_and1099_reporting_responsibility_certification == o.qi_withholding_and1099_reporting_responsibility_certification && + qi_form1099_or_fatca_reporting_responsibility_certification == o.qi_form1099_or_fatca_reporting_responsibility_certification && + qi_opt_out_of_form1099_reporting_certification == o.qi_opt_out_of_form1099_reporting_certification && + qi_withholding_rate_pool_certification == o.qi_withholding_rate_pool_certification && + qi_intermediary_or_flow_through_entity_documentation_certification == o.qi_intermediary_or_flow_through_entity_documentation_certification && + qualified_derivatives_dealer_certification == o.qualified_derivatives_dealer_certification && + qdd_corporation == o.qdd_corporation && + qdd_partnership == o.qdd_partnership && + qdd_disregarded_entity == o.qdd_disregarded_entity && + nonqualified_intermediary_certification == o.nonqualified_intermediary_certification && + nqi_withholding_statement_transmission_certification == o.nqi_withholding_statement_transmission_certification && + nqi_withholding_rate_pool_compliance_certification == o.nqi_withholding_rate_pool_compliance_certification && + nqi_qualified_securities_lender_certification == o.nqi_qualified_securities_lender_certification && + nqi_alternative_withholding_statement_verification_certification == o.nqi_alternative_withholding_statement_verification_certification && + territory_financial_institution_certification == o.territory_financial_institution_certification && + tfi_treated_as_us_person_certification == o.tfi_treated_as_us_person_certification && + tfi_withholding_statement_transmission_certification == o.tfi_withholding_statement_transmission_certification && + tfi_treated_as_us_person_for_ptp_sales_certification == o.tfi_treated_as_us_person_for_ptp_sales_certification && + tfi_nominee_us_person_for_ptp_distributions_certification == o.tfi_nominee_us_person_for_ptp_distributions_certification && + tfi_not_nominee_for_ptp_distributions_certification == o.tfi_not_nominee_for_ptp_distributions_certification && + us_branch_non_effectively_connected_income_certification == o.us_branch_non_effectively_connected_income_certification && + us_branch_agreement_to_be_treated_as_us_person_certification == o.us_branch_agreement_to_be_treated_as_us_person_certification && + us_branch_withholding_statement_and_compliance_certification == o.us_branch_withholding_statement_and_compliance_certification && + us_branch_acting_as_us_person_for_ptp_sales_certification == o.us_branch_acting_as_us_person_for_ptp_sales_certification && + us_branch_nominee_for_ptp_distributions_certification == o.us_branch_nominee_for_ptp_distributions_certification && + us_branch_not_nominee_for_ptp_distributions_certification == o.us_branch_not_nominee_for_ptp_distributions_certification && + withholding_foreign_partnership_or_trust_certification == o.withholding_foreign_partnership_or_trust_certification && + nonwithholding_foreign_entity_withholding_statement_certification == o.nonwithholding_foreign_entity_withholding_statement_certification && + foreign_entity_partner_in_lower_tier_partnership_certification == o.foreign_entity_partner_in_lower_tier_partnership_certification && + foreign_partnership_amount_realized_section1446_f_certification == o.foreign_partnership_amount_realized_section1446_f_certification && + foreign_partnership_modified_amount_realized_certification == o.foreign_partnership_modified_amount_realized_certification && + foreign_grantor_trust_amount_realized_allocation_certification == o.foreign_grantor_trust_amount_realized_allocation_certification && + alternative_withholding_statement_reliance_certification == o.alternative_withholding_statement_reliance_certification && + np_ffi_with_exempt_beneficial_owners_certification == o.np_ffi_with_exempt_beneficial_owners_certification && + ffi_sponsoring_entity == o.ffi_sponsoring_entity && + investment_entity_certification == o.investment_entity_certification && + controlled_foreign_corporation_certification == o.controlled_foreign_corporation_certification && + owner_documented_ffi_certification == o.owner_documented_ffi_certification && + owner_documented_ffi_reporting_statement_certification == o.owner_documented_ffi_reporting_statement_certification && + owner_documented_ffi_auditor_letter_certification == o.owner_documented_ffi_auditor_letter_certification && + compliant_nonregistering_local_bank_certification == o.compliant_nonregistering_local_bank_certification && + compliant_ffi_low_value_accounts_certification == o.compliant_ffi_low_value_accounts_certification && + sponsored_closely_held_entity_sponsoring_entity == o.sponsored_closely_held_entity_sponsoring_entity && + sponsored_closely_held_investment_vehicle_certification == o.sponsored_closely_held_investment_vehicle_certification && + compliant_limited_life_debt_entity_certification == o.compliant_limited_life_debt_entity_certification && + investment_entity_no_financial_accounts_certification == o.investment_entity_no_financial_accounts_certification && + restricted_distributor_certification == o.restricted_distributor_certification && + restricted_distributor_agreement_certification == o.restricted_distributor_agreement_certification && + restricted_distributor_preexisting_sales_compliance_certification == o.restricted_distributor_preexisting_sales_compliance_certification && + foreign_central_bank_of_issue_certification == o.foreign_central_bank_of_issue_certification && + nonreporting_iga_ffi_certification == o.nonreporting_iga_ffi_certification && + iga_country == o.iga_country && + iga_model == o.iga_model && + iga_legal_status_treatment == o.iga_legal_status_treatment && + iga_ffi_trustee_or_sponsor == o.iga_ffi_trustee_or_sponsor && + iga_ffi_trustee_is_foreign == o.iga_ffi_trustee_is_foreign && + treaty_qualified_pension_fund_certification == o.treaty_qualified_pension_fund_certification && + qualified_retirement_fund_certification == o.qualified_retirement_fund_certification && + narrow_participation_retirement_fund_certification == o.narrow_participation_retirement_fund_certification && + section401_a_equivalent_pension_plan_certification == o.section401_a_equivalent_pension_plan_certification && + investment_entity_for_retirement_funds_certification == o.investment_entity_for_retirement_funds_certification && + exempt_beneficial_owner_sponsored_retirement_fund_certification == o.exempt_beneficial_owner_sponsored_retirement_fund_certification && + excepted_nonfinancial_group_entity_certification == o.excepted_nonfinancial_group_entity_certification && + excepted_nonfinancial_start_up_certification == o.excepted_nonfinancial_start_up_certification && + startup_formation_or_resolution_date == o.startup_formation_or_resolution_date && + excepted_nonfinancial_entity_in_liquidation_or_bankruptcy_certification == o.excepted_nonfinancial_entity_in_liquidation_or_bankruptcy_certification && + nonfinancial_entity_filing_date == o.nonfinancial_entity_filing_date && + publicly_traded_nffe_certification == o.publicly_traded_nffe_certification && + publicly_traded_nffe_securities_market == o.publicly_traded_nffe_securities_market && + nffe_affiliate_of_publicly_traded_entity_certification == o.nffe_affiliate_of_publicly_traded_entity_certification && + publicly_traded_entity == o.publicly_traded_entity && + nffe_affiliate_of_publicly_traded_entity_securities_market == o.nffe_affiliate_of_publicly_traded_entity_securities_market && + excepted_territory_nffe_certification == o.excepted_territory_nffe_certification && + active_nffe_certification == o.active_nffe_certification && + passive_nffe_certification == o.passive_nffe_certification && + sponsored_direct_reporting_nffe_certification == o.sponsored_direct_reporting_nffe_certification && + direct_reporting_nffe_sponsoring_entity == o.direct_reporting_nffe_sponsoring_entity && + signer_name == o.signer_name && + company_id == o.company_id && + reference_id == o.reference_id && + email == o.email && + e_delivery_consented_at == o.e_delivery_consented_at && + signature == o.signature + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, name, citizenship_country, disregarded_entity, entity_type, fatca_status, residence_address, residence_city, residence_state, residence_zip, residence_country, residence_is_mailing, mailing_address, mailing_city, mailing_state, mailing_zip, mailing_country, tin_type, tin, giin, foreign_tin, reference_number, disregarded_entity_fatca_status, disregarded_address, disregarded_city, disregarded_state, disregarded_zip, disregarded_country, disregarded_entity_giin, qualified_intermediary_certification, qi_primary_withholding_responsibility_certification, qi_withholding_responsibility_for_ptp_sales_certification, qi_nominee_withholding_responsibility_for_ptp_distributions_certification, qi_securities_lender_substitute_dividend_withholding_certification, qi_withholding_and1099_reporting_responsibility_certification, qi_form1099_or_fatca_reporting_responsibility_certification, qi_opt_out_of_form1099_reporting_certification, qi_withholding_rate_pool_certification, qi_intermediary_or_flow_through_entity_documentation_certification, qualified_derivatives_dealer_certification, qdd_corporation, qdd_partnership, qdd_disregarded_entity, nonqualified_intermediary_certification, nqi_withholding_statement_transmission_certification, nqi_withholding_rate_pool_compliance_certification, nqi_qualified_securities_lender_certification, nqi_alternative_withholding_statement_verification_certification, territory_financial_institution_certification, tfi_treated_as_us_person_certification, tfi_withholding_statement_transmission_certification, tfi_treated_as_us_person_for_ptp_sales_certification, tfi_nominee_us_person_for_ptp_distributions_certification, tfi_not_nominee_for_ptp_distributions_certification, us_branch_non_effectively_connected_income_certification, us_branch_agreement_to_be_treated_as_us_person_certification, us_branch_withholding_statement_and_compliance_certification, us_branch_acting_as_us_person_for_ptp_sales_certification, us_branch_nominee_for_ptp_distributions_certification, us_branch_not_nominee_for_ptp_distributions_certification, withholding_foreign_partnership_or_trust_certification, nonwithholding_foreign_entity_withholding_statement_certification, foreign_entity_partner_in_lower_tier_partnership_certification, foreign_partnership_amount_realized_section1446_f_certification, foreign_partnership_modified_amount_realized_certification, foreign_grantor_trust_amount_realized_allocation_certification, alternative_withholding_statement_reliance_certification, np_ffi_with_exempt_beneficial_owners_certification, ffi_sponsoring_entity, investment_entity_certification, controlled_foreign_corporation_certification, owner_documented_ffi_certification, owner_documented_ffi_reporting_statement_certification, owner_documented_ffi_auditor_letter_certification, compliant_nonregistering_local_bank_certification, compliant_ffi_low_value_accounts_certification, sponsored_closely_held_entity_sponsoring_entity, sponsored_closely_held_investment_vehicle_certification, compliant_limited_life_debt_entity_certification, investment_entity_no_financial_accounts_certification, restricted_distributor_certification, restricted_distributor_agreement_certification, restricted_distributor_preexisting_sales_compliance_certification, foreign_central_bank_of_issue_certification, nonreporting_iga_ffi_certification, iga_country, iga_model, iga_legal_status_treatment, iga_ffi_trustee_or_sponsor, iga_ffi_trustee_is_foreign, treaty_qualified_pension_fund_certification, qualified_retirement_fund_certification, narrow_participation_retirement_fund_certification, section401_a_equivalent_pension_plan_certification, investment_entity_for_retirement_funds_certification, exempt_beneficial_owner_sponsored_retirement_fund_certification, excepted_nonfinancial_group_entity_certification, excepted_nonfinancial_start_up_certification, startup_formation_or_resolution_date, excepted_nonfinancial_entity_in_liquidation_or_bankruptcy_certification, nonfinancial_entity_filing_date, publicly_traded_nffe_certification, publicly_traded_nffe_securities_market, nffe_affiliate_of_publicly_traded_entity_certification, publicly_traded_entity, nffe_affiliate_of_publicly_traded_entity_securities_market, excepted_territory_nffe_certification, active_nffe_certification, passive_nffe_certification, sponsored_direct_reporting_nffe_certification, direct_reporting_nffe_sponsoring_entity, signer_name, company_id, reference_id, email, e_delivery_consented_at, signature].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::A1099::V2.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/A1099/V2/w8_imy_form_response.rb b/lib/avalara_sdk/models/A1099/V2/w8_imy_form_response.rb index 03673e7..065fc42 100644 --- a/lib/avalara_sdk/models/A1099/V2/w8_imy_form_response.rb +++ b/lib/avalara_sdk/models/A1099/V2/w8_imy_form_response.rb @@ -1,7 +1,7 @@ =begin #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) =end @@ -622,9 +622,9 @@ def self.openapi_types :'exempt_beneficial_owner_sponsored_retirement_fund_certification' => :'Boolean', :'excepted_nonfinancial_group_entity_certification' => :'Boolean', :'excepted_nonfinancial_start_up_certification' => :'Boolean', - :'startup_formation_or_resolution_date' => :'Time', + :'startup_formation_or_resolution_date' => :'Date', :'excepted_nonfinancial_entity_in_liquidation_or_bankruptcy_certification' => :'Boolean', - :'nonfinancial_entity_filing_date' => :'Time', + :'nonfinancial_entity_filing_date' => :'Date', :'publicly_traded_nffe_certification' => :'Boolean', :'publicly_traded_nffe_securities_market' => :'String', :'nffe_affiliate_of_publicly_traded_entity_certification' => :'Boolean', diff --git a/lib/avalara_sdk/models/A1099/V2/w9_form_base_request.rb b/lib/avalara_sdk/models/A1099/V2/w9_form_base_request.rb new file mode 100644 index 0000000..12d0611 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/w9_form_base_request.rb @@ -0,0 +1,299 @@ +=begin +#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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class W9FormBaseRequest + # The form type. + attr_accessor :type + + # The ID of the associated company. + attr_accessor :company_id + + # A reference identifier for the form. + attr_accessor :reference_id + + # The email address of the individual associated with the form. + attr_accessor :email + + # The date when e-delivery was consented. + attr_accessor :e_delivery_consented_at + + # The signature of the form. + attr_accessor :signature + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'company_id' => :'companyId', + :'reference_id' => :'referenceId', + :'email' => :'email', + :'e_delivery_consented_at' => :'eDeliveryConsentedAt', + :'signature' => :'signature' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'String', + :'company_id' => :'String', + :'reference_id' => :'String', + :'email' => :'String', + :'e_delivery_consented_at' => :'Time', + :'signature' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'reference_id', + :'email', + :'e_delivery_consented_at', + :'signature' + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::A1099::V2::W9FormBaseRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::A1099::V2::W9FormBaseRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'company_id') + self.company_id = attributes[:'company_id'] + end + + if attributes.key?(:'reference_id') + self.reference_id = attributes[:'reference_id'] + end + + if attributes.key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.key?(:'e_delivery_consented_at') + self.e_delivery_consented_at = attributes[:'e_delivery_consented_at'] + end + + if attributes.key?(:'signature') + self.signature = attributes[:'signature'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + type_validator = EnumAttributeValidator.new('String', ["W4", "W8Ben", "W8BenE", "W8Imy", "W9"]) + return false unless type_validator.valid?(@type) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["W4", "W8Ben", "W8BenE", "W8Imy", "W9"]) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + company_id == o.company_id && + reference_id == o.reference_id && + email == o.email && + e_delivery_consented_at == o.e_delivery_consented_at && + signature == o.signature + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, company_id, reference_id, email, e_delivery_consented_at, signature].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::A1099::V2.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/A1099/V2/w9_form_base_response.rb b/lib/avalara_sdk/models/A1099/V2/w9_form_base_response.rb index d67f68d..1474883 100644 --- a/lib/avalara_sdk/models/A1099/V2/w9_form_base_response.rb +++ b/lib/avalara_sdk/models/A1099/V2/w9_form_base_response.rb @@ -1,7 +1,7 @@ =begin #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) =end diff --git a/lib/avalara_sdk/models/A1099/V2/w9_form_data_model.rb b/lib/avalara_sdk/models/A1099/V2/w9_form_data_model.rb index 5fb9775..eeee213 100644 --- a/lib/avalara_sdk/models/A1099/V2/w9_form_data_model.rb +++ b/lib/avalara_sdk/models/A1099/V2/w9_form_data_model.rb @@ -1,7 +1,7 @@ =begin #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) =end @@ -983,9 +983,9 @@ def self.openapi_types :'certify_box41' => :'Boolean', :'certify_box43' => :'Boolean', :'certify_part29_signature' => :'Boolean', - :'part19_formation_or_resolution_date' => :'Time', - :'part20_filing_date' => :'Time', - :'part21_determination_date' => :'Time', + :'part19_formation_or_resolution_date' => :'Date', + :'part20_filing_date' => :'Date', + :'part21_determination_date' => :'Date', :'substantial_us_owners' => :'Array', :'birthday' => :'String', :'foreign_tin_not_required' => :'Boolean', @@ -1064,8 +1064,8 @@ def self.openapi_types :'certify_box40' => :'Boolean', :'box41_sponsoring_entity' => :'String', :'certify_box42' => :'Boolean', - :'box35_formed_on_date' => :'Time', - :'box36_filed_on_date' => :'Time' + :'box35_formed_on_date' => :'Date', + :'box36_filed_on_date' => :'Date' } end diff --git a/lib/avalara_sdk/models/A1099/V2/w9_form_request.rb b/lib/avalara_sdk/models/A1099/V2/w9_form_request.rb new file mode 100644 index 0000000..6dce540 --- /dev/null +++ b/lib/avalara_sdk/models/A1099/V2/w9_form_request.rb @@ -0,0 +1,495 @@ +=begin +#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) + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::A1099::V2 + class W9FormRequest + # The form type (always \"w9\" for this model). + attr_accessor :type + + # The name of the individual or entity associated with the form. + attr_accessor :name + + # The name of the business associated with the form. + attr_accessor :business_name + + # The classification of the business. + attr_accessor :business_classification + + # The classification description when \"businessClassification\" is \"Other\". + attr_accessor :business_other + + # Indicates whether the individual is a foreign partner, owner, or beneficiary. + attr_accessor :foreign_partner_owner_or_beneficiary + + # The exempt payee code. + attr_accessor :exempt_payee_code + + # The exemption from FATCA reporting code. + attr_accessor :exempt_fatca_code + + # Indicates whether the individual or entity is in a foreign country. + attr_accessor :foreign_country_indicator + + # The address of the individual or entity. + attr_accessor :address + + # The foreign address of the individual or entity. + attr_accessor :foreign_address + + # The city of the address. + attr_accessor :city + + # The state of the address. + attr_accessor :state + + # The ZIP code of the address. + attr_accessor :zip + + # The account number associated with the form. + attr_accessor :account_number + + # The type of TIN provided. + attr_accessor :tin_type + + # The taxpayer identification number (TIN). + attr_accessor :tin + + # Indicates whether backup withholding applies. + attr_accessor :backup_withholding + + # Indicates whether the individual or entity should be issued a 1099 form. + attr_accessor :is1099able + + # The ID of the associated company. + attr_accessor :company_id + + # A reference identifier for the form. + attr_accessor :reference_id + + # The email address of the individual associated with the form. + attr_accessor :email + + # The date when e-delivery was consented. + attr_accessor :e_delivery_consented_at + + # The signature of the form. + attr_accessor :signature + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'type', + :'name' => :'name', + :'business_name' => :'businessName', + :'business_classification' => :'businessClassification', + :'business_other' => :'businessOther', + :'foreign_partner_owner_or_beneficiary' => :'foreignPartnerOwnerOrBeneficiary', + :'exempt_payee_code' => :'exemptPayeeCode', + :'exempt_fatca_code' => :'exemptFatcaCode', + :'foreign_country_indicator' => :'foreignCountryIndicator', + :'address' => :'address', + :'foreign_address' => :'foreignAddress', + :'city' => :'city', + :'state' => :'state', + :'zip' => :'zip', + :'account_number' => :'accountNumber', + :'tin_type' => :'tinType', + :'tin' => :'tin', + :'backup_withholding' => :'backupWithholding', + :'is1099able' => :'is1099able', + :'company_id' => :'companyId', + :'reference_id' => :'referenceId', + :'email' => :'email', + :'e_delivery_consented_at' => :'eDeliveryConsentedAt', + :'signature' => :'signature' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'String', + :'name' => :'String', + :'business_name' => :'String', + :'business_classification' => :'String', + :'business_other' => :'String', + :'foreign_partner_owner_or_beneficiary' => :'Boolean', + :'exempt_payee_code' => :'String', + :'exempt_fatca_code' => :'String', + :'foreign_country_indicator' => :'Boolean', + :'address' => :'String', + :'foreign_address' => :'String', + :'city' => :'String', + :'state' => :'String', + :'zip' => :'String', + :'account_number' => :'String', + :'tin_type' => :'String', + :'tin' => :'String', + :'backup_withholding' => :'Boolean', + :'is1099able' => :'Boolean', + :'company_id' => :'String', + :'reference_id' => :'String', + :'email' => :'String', + :'e_delivery_consented_at' => :'Time', + :'signature' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'business_name', + :'business_other', + :'exempt_payee_code', + :'exempt_fatca_code', + :'foreign_address', + :'city', + :'state', + :'zip', + :'account_number', + :'reference_id', + :'email', + :'e_delivery_consented_at', + :'signature' + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'W9FormBaseRequest' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::A1099::V2::W9FormRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::A1099::V2::W9FormRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'business_name') + self.business_name = attributes[:'business_name'] + end + + if attributes.key?(:'business_classification') + self.business_classification = attributes[:'business_classification'] + end + + if attributes.key?(:'business_other') + self.business_other = attributes[:'business_other'] + end + + if attributes.key?(:'foreign_partner_owner_or_beneficiary') + self.foreign_partner_owner_or_beneficiary = attributes[:'foreign_partner_owner_or_beneficiary'] + end + + if attributes.key?(:'exempt_payee_code') + self.exempt_payee_code = attributes[:'exempt_payee_code'] + end + + if attributes.key?(:'exempt_fatca_code') + self.exempt_fatca_code = attributes[:'exempt_fatca_code'] + end + + if attributes.key?(:'foreign_country_indicator') + self.foreign_country_indicator = attributes[:'foreign_country_indicator'] + end + + if attributes.key?(:'address') + self.address = attributes[:'address'] + end + + if attributes.key?(:'foreign_address') + self.foreign_address = attributes[:'foreign_address'] + end + + if attributes.key?(:'city') + self.city = attributes[:'city'] + end + + if attributes.key?(:'state') + self.state = attributes[:'state'] + end + + if attributes.key?(:'zip') + self.zip = attributes[:'zip'] + end + + if attributes.key?(:'account_number') + self.account_number = attributes[:'account_number'] + end + + if attributes.key?(:'tin_type') + self.tin_type = attributes[:'tin_type'] + end + + if attributes.key?(:'tin') + self.tin = attributes[:'tin'] + end + + if attributes.key?(:'backup_withholding') + self.backup_withholding = attributes[:'backup_withholding'] + end + + if attributes.key?(:'is1099able') + self.is1099able = attributes[:'is1099able'] + end + + if attributes.key?(:'company_id') + self.company_id = attributes[:'company_id'] + end + + if attributes.key?(:'reference_id') + self.reference_id = attributes[:'reference_id'] + end + + if attributes.key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.key?(:'e_delivery_consented_at') + self.e_delivery_consented_at = attributes[:'e_delivery_consented_at'] + end + + if attributes.key?(:'signature') + self.signature = attributes[:'signature'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + type_validator = EnumAttributeValidator.new('String', ["W4", "W8Ben", "W8BenE", "W8Imy", "W9"]) + return false unless type_validator.valid?(@type) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["W4", "W8Ben", "W8BenE", "W8Imy", "W9"]) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + name == o.name && + business_name == o.business_name && + business_classification == o.business_classification && + business_other == o.business_other && + foreign_partner_owner_or_beneficiary == o.foreign_partner_owner_or_beneficiary && + exempt_payee_code == o.exempt_payee_code && + exempt_fatca_code == o.exempt_fatca_code && + foreign_country_indicator == o.foreign_country_indicator && + address == o.address && + foreign_address == o.foreign_address && + city == o.city && + state == o.state && + zip == o.zip && + account_number == o.account_number && + tin_type == o.tin_type && + tin == o.tin && + backup_withholding == o.backup_withholding && + is1099able == o.is1099able && + company_id == o.company_id && + reference_id == o.reference_id && + email == o.email && + e_delivery_consented_at == o.e_delivery_consented_at && + signature == o.signature + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, name, business_name, business_classification, business_other, foreign_partner_owner_or_beneficiary, exempt_payee_code, exempt_fatca_code, foreign_country_indicator, address, foreign_address, city, state, zip, account_number, tin_type, tin, backup_withholding, is1099able, company_id, reference_id, email, e_delivery_consented_at, signature].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::A1099::V2.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/A1099/V2/w9_form_response.rb b/lib/avalara_sdk/models/A1099/V2/w9_form_response.rb index 0d5dcd4..9a580aa 100644 --- a/lib/avalara_sdk/models/A1099/V2/w9_form_response.rb +++ b/lib/avalara_sdk/models/A1099/V2/w9_form_response.rb @@ -1,7 +1,7 @@ =begin #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) =end @@ -193,11 +193,12 @@ def self.openapi_nullable Set.new([ :'business_name', :'business_other', - :'foreign_partner_owner_or_beneficiary', :'exempt_payee_code', :'exempt_fatca_code', - :'foreign_country_indicator', :'foreign_address', + :'city', + :'state', + :'zip', :'account_number', :'entry_status_date', :'reference_id', diff --git a/lib/avalara_sdk/models/EInvoicing/V1/address.rb b/lib/avalara_sdk/models/EInvoicing/V1/address.rb new file mode 100644 index 0000000..5657630 --- /dev/null +++ b/lib/avalara_sdk/models/EInvoicing/V1/address.rb @@ -0,0 +1,382 @@ +=begin +#Avalara E-Invoicing API + +#An API that supports sending data for an E-Invoicing compliance use-case. + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 + class Address + # Address line 1 + attr_accessor :line1 + + # Address line 2 + attr_accessor :line2 + + # City + attr_accessor :city + + # State + attr_accessor :state + + # Country (ISO 3166) + attr_accessor :country + + # Postal code + attr_accessor :postal_code + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'line1' => :'line1', + :'line2' => :'line2', + :'city' => :'city', + :'state' => :'state', + :'country' => :'country', + :'postal_code' => :'postalCode' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'line1' => :'String', + :'line2' => :'String', + :'city' => :'String', + :'state' => :'String', + :'country' => :'String', + :'postal_code' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::EInvoicing::V1::Address` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::EInvoicing::V1::Address`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'line1') + self.line1 = attributes[:'line1'] + end + + if attributes.key?(:'line2') + self.line2 = attributes[:'line2'] + end + + if attributes.key?(:'city') + self.city = attributes[:'city'] + end + + if attributes.key?(:'state') + self.state = attributes[:'state'] + end + + if attributes.key?(:'country') + self.country = attributes[:'country'] + else + self.country = nil + end + + if attributes.key?(:'postal_code') + self.postal_code = attributes[:'postal_code'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if !@line1.nil? && @line1.to_s.length > 250 + invalid_properties.push('invalid value for "line1", the character length must be smaller than or equal to 250.') + end + + if !@line2.nil? && @line2.to_s.length > 250 + invalid_properties.push('invalid value for "line2", the character length must be smaller than or equal to 250.') + end + + if !@city.nil? && @city.to_s.length > 250 + invalid_properties.push('invalid value for "city", the character length must be smaller than or equal to 250.') + end + + if !@state.nil? && @state.to_s.length > 250 + invalid_properties.push('invalid value for "state", the character length must be smaller than or equal to 250.') + end + + if @country.nil? + invalid_properties.push('invalid value for "country", country cannot be nil.') + end + + if @country.to_s.length > 250 + invalid_properties.push('invalid value for "country", the character length must be smaller than or equal to 250.') + end + + if !@postal_code.nil? && @postal_code.to_s.length > 250 + invalid_properties.push('invalid value for "postal_code", the character length must be smaller than or equal to 250.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if !@line1.nil? && @line1.to_s.length > 250 + return false if !@line2.nil? && @line2.to_s.length > 250 + return false if !@city.nil? && @city.to_s.length > 250 + return false if !@state.nil? && @state.to_s.length > 250 + return false if @country.nil? + return false if @country.to_s.length > 250 + return false if !@postal_code.nil? && @postal_code.to_s.length > 250 + true + end + + # Custom attribute writer method with validation + # @param [Object] line1 Value to be assigned + def line1=(line1) + if line1.nil? + fail ArgumentError, 'line1 cannot be nil' + end + + if line1.to_s.length > 250 + fail ArgumentError, 'invalid value for "line1", the character length must be smaller than or equal to 250.' + end + + @line1 = line1 + end + + # Custom attribute writer method with validation + # @param [Object] line2 Value to be assigned + def line2=(line2) + if line2.nil? + fail ArgumentError, 'line2 cannot be nil' + end + + if line2.to_s.length > 250 + fail ArgumentError, 'invalid value for "line2", the character length must be smaller than or equal to 250.' + end + + @line2 = line2 + end + + # Custom attribute writer method with validation + # @param [Object] city Value to be assigned + def city=(city) + if city.nil? + fail ArgumentError, 'city cannot be nil' + end + + if city.to_s.length > 250 + fail ArgumentError, 'invalid value for "city", the character length must be smaller than or equal to 250.' + end + + @city = city + end + + # Custom attribute writer method with validation + # @param [Object] state Value to be assigned + def state=(state) + if state.nil? + fail ArgumentError, 'state cannot be nil' + end + + if state.to_s.length > 250 + fail ArgumentError, 'invalid value for "state", the character length must be smaller than or equal to 250.' + end + + @state = state + end + + # Custom attribute writer method with validation + # @param [Object] country Value to be assigned + def country=(country) + if country.nil? + fail ArgumentError, 'country cannot be nil' + end + + if country.to_s.length > 250 + fail ArgumentError, 'invalid value for "country", the character length must be smaller than or equal to 250.' + end + + @country = country + end + + # Custom attribute writer method with validation + # @param [Object] postal_code Value to be assigned + def postal_code=(postal_code) + if postal_code.nil? + fail ArgumentError, 'postal_code cannot be nil' + end + + if postal_code.to_s.length > 250 + fail ArgumentError, 'invalid value for "postal_code", the character length must be smaller than or equal to 250.' + end + + @postal_code = postal_code + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + line1 == o.line1 && + line2 == o.line2 && + city == o.city && + state == o.state && + country == o.country && + postal_code == o.postal_code + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [line1, line2, city, state, country, postal_code].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::EInvoicing::V1.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/batch_error_detail.rb b/lib/avalara_sdk/models/EInvoicing/V1/batch_error_detail.rb new file mode 100644 index 0000000..b408850 --- /dev/null +++ b/lib/avalara_sdk/models/EInvoicing/V1/batch_error_detail.rb @@ -0,0 +1,223 @@ +=begin +#Avalara E-Invoicing API + +#An API that supports sending data for an E-Invoicing compliance use-case. + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 + # Represents detailed error information for an individual entry in a batch request. Includes the index of the failed item and associated validation errors. + class BatchErrorDetail + # The index of the request that caused the error in the batch. + attr_accessor :index + + attr_accessor :validation_errors + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'index' => :'index', + :'validation_errors' => :'validationErrors' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'index' => :'Integer', + :'validation_errors' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::EInvoicing::V1::BatchErrorDetail` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::EInvoicing::V1::BatchErrorDetail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'index') + self.index = attributes[:'index'] + end + + if attributes.key?(:'validation_errors') + if (value = attributes[:'validation_errors']).is_a?(Array) + self.validation_errors = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + index == o.index && + validation_errors == o.validation_errors + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [index, validation_errors].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::EInvoicing::V1.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/batch_search.rb b/lib/avalara_sdk/models/EInvoicing/V1/batch_search.rb index a379e53..92be7c8 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/batch_search.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/batch_search.rb @@ -10,7 +10,7 @@ require 'time' module AvalaraSdk::EInvoicing::V1 - # Provides details about a batch search operation, including status, timestamps, and potential errors. + # Represents a single batch search operation class BatchSearch # ID of the batch search attr_accessor :id diff --git a/lib/avalara_sdk/models/EInvoicing/V1/batch_search_list_response.rb b/lib/avalara_sdk/models/EInvoicing/V1/batch_search_list_response.rb index 29d6a7d..eed6f67 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/batch_search_list_response.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/batch_search_list_response.rb @@ -10,14 +10,15 @@ require 'time' module AvalaraSdk::EInvoicing::V1 - # Schema for batch search list + # Response schema for listing batch search details. class BatchSearchListResponse - # The count of records in the result set + # The count of records in the result set. attr_accessor :record_set_count # Next Link attr_accessor :next_link + # List of batch search records. attr_accessor :value # Attribute mapping from ruby-style variable name to JSON key. diff --git a/lib/avalara_sdk/models/EInvoicing/V1/consents.rb b/lib/avalara_sdk/models/EInvoicing/V1/consents.rb new file mode 100644 index 0000000..59616b0 --- /dev/null +++ b/lib/avalara_sdk/models/EInvoicing/V1/consents.rb @@ -0,0 +1,213 @@ +=begin +#Avalara E-Invoicing API + +#An API that supports sending data for an E-Invoicing compliance use-case. + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 + class Consents + # Indicates whether the trading partner consents to being listed in the directory. If not provided in the payload, its value will default to true. + attr_accessor :list_in_avalara_directory + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'list_in_avalara_directory' => :'listInAvalaraDirectory' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'list_in_avalara_directory' => :'Boolean' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::EInvoicing::V1::Consents` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::EInvoicing::V1::Consents`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'list_in_avalara_directory') + self.list_in_avalara_directory = attributes[:'list_in_avalara_directory'] + else + self.list_in_avalara_directory = true + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + list_in_avalara_directory == o.list_in_avalara_directory + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [list_in_avalara_directory].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::EInvoicing::V1.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/create_trading_partner201_response.rb b/lib/avalara_sdk/models/EInvoicing/V1/create_trading_partner201_response.rb new file mode 100644 index 0000000..829dd57 --- /dev/null +++ b/lib/avalara_sdk/models/EInvoicing/V1/create_trading_partner201_response.rb @@ -0,0 +1,231 @@ +=begin +#Avalara E-Invoicing API + +#An API that supports sending data for an E-Invoicing compliance use-case. + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 + class CreateTradingPartner201Response + # Avalara unique ID of the participant in the directory. + attr_accessor :id + + # The status of the create operation. + attr_accessor :status + + # A human-readable message providing additional context or feedback about the outcome of the operation. + attr_accessor :message + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'status' => :'status', + :'message' => :'message' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'status' => :'String', + :'message' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::EInvoicing::V1::CreateTradingPartner201Response` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::EInvoicing::V1::CreateTradingPartner201Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + status == o.status && + message == o.message + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, status, message].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::EInvoicing::V1.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/create_trading_partners_batch200_response.rb b/lib/avalara_sdk/models/EInvoicing/V1/create_trading_partners_batch200_response.rb new file mode 100644 index 0000000..e40dfff --- /dev/null +++ b/lib/avalara_sdk/models/EInvoicing/V1/create_trading_partners_batch200_response.rb @@ -0,0 +1,232 @@ +=begin +#Avalara E-Invoicing API + +#An API that supports sending data for an E-Invoicing compliance use-case. + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 + class CreateTradingPartnersBatch200Response + attr_accessor :status + + # A message indicating the result of the batch operation. + attr_accessor :message + + # A list of trading partners successfully created. + attr_accessor :value + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'status' => :'status', + :'message' => :'message', + :'value' => :'value' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'status' => :'String', + :'message' => :'String', + :'value' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::EInvoicing::V1::CreateTradingPartnersBatch200Response` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::EInvoicing::V1::CreateTradingPartnersBatch200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + + if attributes.key?(:'value') + if (value = attributes[:'value']).is_a?(Array) + self.value = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + status == o.status && + message == o.message && + value == o.value + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [status, message, value].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::EInvoicing::V1.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/create_trading_partners_batch200_response_value_inner.rb b/lib/avalara_sdk/models/EInvoicing/V1/create_trading_partners_batch200_response_value_inner.rb new file mode 100644 index 0000000..f69f5f7 --- /dev/null +++ b/lib/avalara_sdk/models/EInvoicing/V1/create_trading_partners_batch200_response_value_inner.rb @@ -0,0 +1,231 @@ +=begin +#Avalara E-Invoicing API + +#An API that supports sending data for an E-Invoicing compliance use-case. + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 + class CreateTradingPartnersBatch200ResponseValueInner + # The unique identifier of the created trading partner. + attr_accessor :id + + # Index number of the trading partner. + attr_accessor :index + + # A success message for the specific created record. + attr_accessor :message + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'index' => :'index', + :'message' => :'message' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'index' => :'Integer', + :'message' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::EInvoicing::V1::CreateTradingPartnersBatch200ResponseValueInner` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::EInvoicing::V1::CreateTradingPartnersBatch200ResponseValueInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'index') + self.index = attributes[:'index'] + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + index == o.index && + message == o.message + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, index, message].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::EInvoicing::V1.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/create_trading_partners_batch_request.rb b/lib/avalara_sdk/models/EInvoicing/V1/create_trading_partners_batch_request.rb new file mode 100644 index 0000000..b581761 --- /dev/null +++ b/lib/avalara_sdk/models/EInvoicing/V1/create_trading_partners_batch_request.rb @@ -0,0 +1,212 @@ +=begin +#Avalara E-Invoicing API + +#An API that supports sending data for an E-Invoicing compliance use-case. + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 + class CreateTradingPartnersBatchRequest + attr_accessor :value + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'value' => :'value' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'value' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::EInvoicing::V1::CreateTradingPartnersBatchRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::EInvoicing::V1::CreateTradingPartnersBatchRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'value') + if (value = attributes[:'value']).is_a?(Array) + self.value = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + value == o.value + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [value].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::EInvoicing::V1.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/data_input_fields_response.rb b/lib/avalara_sdk/models/EInvoicing/V1/data_input_fields_response.rb index 49edd2e..00551e0 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/data_input_fields_response.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/data_input_fields_response.rb @@ -10,8 +10,7 @@ require 'time' module AvalaraSdk::EInvoicing::V1 - # Response model providing a list of input fields required, optional, or conditional for different country mandates. - class DataInputFieldsResponse + class DataInputFieldsResponse # Total count of results attr_accessor :recordset_count diff --git a/lib/avalara_sdk/models/EInvoicing/V1/document_fetch.rb b/lib/avalara_sdk/models/EInvoicing/V1/document_fetch.rb index 2b520d5..09bad1c 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/document_fetch.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/document_fetch.rb @@ -10,8 +10,7 @@ require 'time' module AvalaraSdk::EInvoicing::V1 - # An object of the inbound document - class DocumentFetch + class DocumentFetch # Unique ID for this document that can be used for status checking and file downloads. This is a UID created by the Avalara E-Invoicing platform. attr_accessor :id diff --git a/lib/avalara_sdk/models/EInvoicing/V1/error_response.rb b/lib/avalara_sdk/models/EInvoicing/V1/error_response.rb index 5105d0d..c6e17de 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/error_response.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/error_response.rb @@ -10,7 +10,7 @@ require 'time' module AvalaraSdk::EInvoicing::V1 - # Structure for reporting errors encountered during API operations, including title, status, and detailed message. + # Standard format for API error responses. class ErrorResponse attr_accessor :title diff --git a/lib/avalara_sdk/models/EInvoicing/V1/extension.rb b/lib/avalara_sdk/models/EInvoicing/V1/extension.rb new file mode 100644 index 0000000..d81175f --- /dev/null +++ b/lib/avalara_sdk/models/EInvoicing/V1/extension.rb @@ -0,0 +1,256 @@ +=begin +#Avalara E-Invoicing API + +#An API that supports sending data for an E-Invoicing compliance use-case. + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 + class Extension + # Name of the custom attribute. + attr_accessor :key + + # Array of string values associated with the custom attribute. + attr_accessor :values + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'key' => :'key', + :'values' => :'values' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'key' => :'String', + :'values' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::EInvoicing::V1::Extension` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::EInvoicing::V1::Extension`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'key') + self.key = attributes[:'key'] + else + self.key = nil + end + + if attributes.key?(:'values') + if (value = attributes[:'values']).is_a?(Array) + self.values = value + end + else + self.values = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @key.nil? + invalid_properties.push('invalid value for "key", key cannot be nil.') + end + + if @key.to_s.length > 250 + invalid_properties.push('invalid value for "key", the character length must be smaller than or equal to 250.') + end + + if @values.nil? + invalid_properties.push('invalid value for "values", values cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @key.nil? + return false if @key.to_s.length > 250 + return false if @values.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] key Value to be assigned + def key=(key) + if key.nil? + fail ArgumentError, 'key cannot be nil' + end + + if key.to_s.length > 250 + fail ArgumentError, 'invalid value for "key", the character length must be smaller than or equal to 250.' + end + + @key = key + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + key == o.key && + values == o.values + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [key, values].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::EInvoicing::V1.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/hmac_signature_value.rb b/lib/avalara_sdk/models/EInvoicing/V1/hmac_signature_value.rb index 5312997..fcdc3d3 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/hmac_signature_value.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/hmac_signature_value.rb @@ -10,8 +10,7 @@ require 'time' module AvalaraSdk::EInvoicing::V1 - # Contains the HMAC algorithm and the resulting signature value used for verifying message integrity. - class HmacSignatureValue + class HmacSignatureValue # The algorithm used to create the signature. attr_accessor :algorithm diff --git a/lib/avalara_sdk/models/EInvoicing/V1/identifier.rb b/lib/avalara_sdk/models/EInvoicing/V1/identifier.rb new file mode 100644 index 0000000..9b40bdc --- /dev/null +++ b/lib/avalara_sdk/models/EInvoicing/V1/identifier.rb @@ -0,0 +1,302 @@ +=begin +#Avalara E-Invoicing API + +#An API that supports sending data for an E-Invoicing compliance use-case. + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 + class Identifier + # Identifier name (e.g., Peppol Participant ID). + attr_accessor :name + + # Display name of the identifier. + attr_accessor :display_name + + # Value of the identifier. + attr_accessor :value + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'display_name' => :'displayName', + :'value' => :'value' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'String', + :'display_name' => :'String', + :'value' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::EInvoicing::V1::Identifier` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::EInvoicing::V1::Identifier`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + else + self.name = nil + end + + if attributes.key?(:'display_name') + self.display_name = attributes[:'display_name'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + else + self.value = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + if @name.to_s.length > 250 + invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 250.') + end + + if !@display_name.nil? && @display_name.to_s.length > 250 + invalid_properties.push('invalid value for "display_name", the character length must be smaller than or equal to 250.') + end + + if @value.nil? + invalid_properties.push('invalid value for "value", value cannot be nil.') + end + + if @value.to_s.length > 250 + invalid_properties.push('invalid value for "value", the character length must be smaller than or equal to 250.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @name.nil? + return false if @name.to_s.length > 250 + return false if !@display_name.nil? && @display_name.to_s.length > 250 + return false if @value.nil? + return false if @value.to_s.length > 250 + true + end + + # Custom attribute writer method with validation + # @param [Object] name Value to be assigned + def name=(name) + if name.nil? + fail ArgumentError, 'name cannot be nil' + end + + if name.to_s.length > 250 + fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 250.' + end + + @name = name + end + + # Custom attribute writer method with validation + # @param [Object] display_name Value to be assigned + def display_name=(display_name) + if display_name.nil? + fail ArgumentError, 'display_name cannot be nil' + end + + if display_name.to_s.length > 250 + fail ArgumentError, 'invalid value for "display_name", the character length must be smaller than or equal to 250.' + end + + @display_name = display_name + end + + # Custom attribute writer method with validation + # @param [Object] value Value to be assigned + def value=(value) + if value.nil? + fail ArgumentError, 'value cannot be nil' + end + + if value.to_s.length > 250 + fail ArgumentError, 'invalid value for "value", the character length must be smaller than or equal to 250.' + end + + @value = value + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + display_name == o.display_name && + value == o.value + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name, display_name, value].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::EInvoicing::V1.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/mandate.rb b/lib/avalara_sdk/models/EInvoicing/V1/mandate.rb index f126f4c..88a1e34 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/mandate.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/mandate.rb @@ -10,8 +10,7 @@ require 'time' module AvalaraSdk::EInvoicing::V1 - # An object representing the country mandate - class Mandate + class Mandate # The `mandateId` is comprised of the country code, mandate type, and the network or regulation type (for example, AU-B2G-PEPPOL). Keep in mind the following when specifying a `mandateId`. - A country can have multiple mandate types (B2C, B2B, B2G). - A entity/company can opt in for multiple mandates. - A `mandateId` is the combination of country + mandate type + network/regulation. attr_accessor :mandate_id diff --git a/lib/avalara_sdk/models/EInvoicing/V1/pagination.rb b/lib/avalara_sdk/models/EInvoicing/V1/pagination.rb index eb60ad5..2918088 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/pagination.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/pagination.rb @@ -10,8 +10,7 @@ require 'time' module AvalaraSdk::EInvoicing::V1 - # Pagination information for the dataset. - class Pagination + class Pagination # The total count of records in the dataset. attr_accessor :recordset_count diff --git a/lib/avalara_sdk/models/EInvoicing/V1/required_when_field.rb b/lib/avalara_sdk/models/EInvoicing/V1/required_when_field.rb index 562ea79..dbac1d0 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/required_when_field.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/required_when_field.rb @@ -10,8 +10,7 @@ require 'time' module AvalaraSdk::EInvoicing::V1 - # Mandates for which this field is required - class RequiredWhenField + class RequiredWhenField attr_accessor :scenario # Attribute mapping from ruby-style variable name to JSON key. diff --git a/lib/avalara_sdk/models/EInvoicing/V1/search_participants200_response.rb b/lib/avalara_sdk/models/EInvoicing/V1/search_participants200_response.rb new file mode 100644 index 0000000..4e492d0 --- /dev/null +++ b/lib/avalara_sdk/models/EInvoicing/V1/search_participants200_response.rb @@ -0,0 +1,232 @@ +=begin +#Avalara E-Invoicing API + +#An API that supports sending data for an E-Invoicing compliance use-case. + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 + class SearchParticipants200Response + # The count of records in the result set. + attr_accessor :record_set_count + + # The next page link to get the next set of results. + attr_accessor :next_link + + attr_accessor :value + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'record_set_count' => :'@recordSetCount', + :'next_link' => :'@nextLink', + :'value' => :'value' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'record_set_count' => :'Integer', + :'next_link' => :'String', + :'value' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::EInvoicing::V1::SearchParticipants200Response` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::EInvoicing::V1::SearchParticipants200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'record_set_count') + self.record_set_count = attributes[:'record_set_count'] + end + + if attributes.key?(:'next_link') + self.next_link = attributes[:'next_link'] + end + + if attributes.key?(:'value') + if (value = attributes[:'value']).is_a?(Array) + self.value = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + record_set_count == o.record_set_count && + next_link == o.next_link && + value == o.value + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [record_set_count, next_link, value].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::EInvoicing::V1.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/signature.rb b/lib/avalara_sdk/models/EInvoicing/V1/signature.rb index a4785df..05ff3e5 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/signature.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/signature.rb @@ -10,8 +10,7 @@ require 'time' module AvalaraSdk::EInvoicing::V1 - # Defines the signature configuration, specifying whether and how messages are signed for webhook delivery. - class Signature + class Signature attr_accessor :signature # Attribute mapping from ruby-style variable name to JSON key. diff --git a/lib/avalara_sdk/models/EInvoicing/V1/signature_value.rb b/lib/avalara_sdk/models/EInvoicing/V1/signature_value.rb index 4e6380c..18be1c5 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/signature_value.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/signature_value.rb @@ -10,8 +10,7 @@ require 'time' module AvalaraSdk::EInvoicing::V1 - # Includes the actual signature applied to a webhook message along with the algorithm used. - class SignatureValue + class SignatureValue attr_accessor :signature # Attribute mapping from ruby-style variable name to JSON key. diff --git a/lib/avalara_sdk/models/EInvoicing/V1/subscription_common.rb b/lib/avalara_sdk/models/EInvoicing/V1/subscription_common.rb index c5b00a6..76991f3 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/subscription_common.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/subscription_common.rb @@ -10,8 +10,7 @@ require 'time' module AvalaraSdk::EInvoicing::V1 - # Basic configuration for a webhook subscription, including description and target notification URL. - class SubscriptionCommon + class SubscriptionCommon # Description of the subscription attr_accessor :description diff --git a/lib/avalara_sdk/models/EInvoicing/V1/success_response.rb b/lib/avalara_sdk/models/EInvoicing/V1/success_response.rb index 6af1b03..f395444 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/success_response.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/success_response.rb @@ -10,8 +10,7 @@ require 'time' module AvalaraSdk::EInvoicing::V1 - # Indicates a successful outcome of an API operation, including a generated ID and success message. - class SuccessResponse + class SuccessResponse # Unique identifier for the new or updated entity. attr_accessor :id diff --git a/lib/avalara_sdk/models/EInvoicing/V1/supported_document_types.rb b/lib/avalara_sdk/models/EInvoicing/V1/supported_document_types.rb new file mode 100644 index 0000000..1284978 --- /dev/null +++ b/lib/avalara_sdk/models/EInvoicing/V1/supported_document_types.rb @@ -0,0 +1,305 @@ +=begin +#Avalara E-Invoicing API + +#An API that supports sending data for an E-Invoicing compliance use-case. + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 + class SupportedDocumentTypes + # Document type name. + attr_accessor :name + + # Document type value. + attr_accessor :value + + # Does trading partner support receiving this document type. + attr_accessor :supported_by_trading_partner + + # Does avalara support exchanging this document type. + attr_accessor :supported_by_avalara + + # Optional array used to carry additional metadata or configuration values that may be required by specific document types. When creating or updating a trading partner, the keys provided in the 'extensions' attribute must be selected from a predefined list of supported extensions. Using any unsupported keys will result in a validation error. + attr_accessor :extensions + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'value' => :'value', + :'supported_by_trading_partner' => :'supportedByTradingPartner', + :'supported_by_avalara' => :'supportedByAvalara', + :'extensions' => :'extensions' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'String', + :'value' => :'String', + :'supported_by_trading_partner' => :'Boolean', + :'supported_by_avalara' => :'Boolean', + :'extensions' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::EInvoicing::V1::SupportedDocumentTypes` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::EInvoicing::V1::SupportedDocumentTypes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + else + self.value = nil + end + + if attributes.key?(:'supported_by_trading_partner') + self.supported_by_trading_partner = attributes[:'supported_by_trading_partner'] + else + self.supported_by_trading_partner = nil + end + + if attributes.key?(:'supported_by_avalara') + self.supported_by_avalara = attributes[:'supported_by_avalara'] + end + + if attributes.key?(:'extensions') + if (value = attributes[:'extensions']).is_a?(Array) + self.extensions = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if !@name.nil? && @name.to_s.length > 250 + invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 250.') + end + + if @value.nil? + invalid_properties.push('invalid value for "value", value cannot be nil.') + end + + if @value.to_s.length > 500 + invalid_properties.push('invalid value for "value", the character length must be smaller than or equal to 500.') + end + + if @supported_by_trading_partner.nil? + invalid_properties.push('invalid value for "supported_by_trading_partner", supported_by_trading_partner cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if !@name.nil? && @name.to_s.length > 250 + return false if @value.nil? + return false if @value.to_s.length > 500 + return false if @supported_by_trading_partner.nil? + true + end + + # Custom attribute writer method with validation + # @param [Object] name Value to be assigned + def name=(name) + if name.nil? + fail ArgumentError, 'name cannot be nil' + end + + if name.to_s.length > 250 + fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 250.' + end + + @name = name + end + + # Custom attribute writer method with validation + # @param [Object] value Value to be assigned + def value=(value) + if value.nil? + fail ArgumentError, 'value cannot be nil' + end + + if value.to_s.length > 500 + fail ArgumentError, 'invalid value for "value", the character length must be smaller than or equal to 500.' + end + + @value = value + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + value == o.value && + supported_by_trading_partner == o.supported_by_trading_partner && + supported_by_avalara == o.supported_by_avalara && + extensions == o.extensions + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name, value, supported_by_trading_partner, supported_by_avalara, extensions].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::EInvoicing::V1.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/tax_identifier_request.rb b/lib/avalara_sdk/models/EInvoicing/V1/tax_identifier_request.rb new file mode 100644 index 0000000..3f15d3c --- /dev/null +++ b/lib/avalara_sdk/models/EInvoicing/V1/tax_identifier_request.rb @@ -0,0 +1,329 @@ +=begin +#Avalara E-Invoicing API + +#An API that supports sending data for an E-Invoicing compliance use-case. + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 + # Represents a request to validate company’s tax identifier. + class TaxIdentifierRequest + # The two-letter ISO-3166 country code of the tax identifier. + attr_accessor :country_code + + # Type of the identifier. + attr_accessor :identifier_type + + # The tax identifier of the company. + attr_accessor :identifier + + # Optional field for adding additional details required by specific tax authorities. Refer to the GET /tax-identifiers/schema API endpoint for the full request structure for a given country. + attr_accessor :extensions + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'country_code' => :'countryCode', + :'identifier_type' => :'identifierType', + :'identifier' => :'identifier', + :'extensions' => :'extensions' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'country_code' => :'String', + :'identifier_type' => :'String', + :'identifier' => :'String', + :'extensions' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::EInvoicing::V1::TaxIdentifierRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::EInvoicing::V1::TaxIdentifierRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'country_code') + self.country_code = attributes[:'country_code'] + else + self.country_code = nil + end + + if attributes.key?(:'identifier_type') + self.identifier_type = attributes[:'identifier_type'] + else + self.identifier_type = nil + end + + if attributes.key?(:'identifier') + self.identifier = attributes[:'identifier'] + else + self.identifier = nil + end + + if attributes.key?(:'extensions') + self.extensions = attributes[:'extensions'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @country_code.nil? + invalid_properties.push('invalid value for "country_code", country_code cannot be nil.') + end + + if @country_code.to_s.length > 2 + invalid_properties.push('invalid value for "country_code", the character length must be smaller than or equal to 2.') + end + + if @country_code.to_s.length < 2 + invalid_properties.push('invalid value for "country_code", the character length must be great than or equal to 2.') + end + + if @identifier_type.nil? + invalid_properties.push('invalid value for "identifier_type", identifier_type cannot be nil.') + end + + if @identifier_type.to_s.length > 100 + invalid_properties.push('invalid value for "identifier_type", the character length must be smaller than or equal to 100.') + end + + if @identifier.nil? + invalid_properties.push('invalid value for "identifier", identifier cannot be nil.') + end + + if @identifier.to_s.length > 100 + invalid_properties.push('invalid value for "identifier", the character length must be smaller than or equal to 100.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @country_code.nil? + return false if @country_code.to_s.length > 2 + return false if @country_code.to_s.length < 2 + return false if @identifier_type.nil? + return false if @identifier_type.to_s.length > 100 + return false if @identifier.nil? + return false if @identifier.to_s.length > 100 + true + end + + # Custom attribute writer method with validation + # @param [Object] country_code Value to be assigned + def country_code=(country_code) + if country_code.nil? + fail ArgumentError, 'country_code cannot be nil' + end + + if country_code.to_s.length > 2 + fail ArgumentError, 'invalid value for "country_code", the character length must be smaller than or equal to 2.' + end + + if country_code.to_s.length < 2 + fail ArgumentError, 'invalid value for "country_code", the character length must be great than or equal to 2.' + end + + @country_code = country_code + end + + # Custom attribute writer method with validation + # @param [Object] identifier_type Value to be assigned + def identifier_type=(identifier_type) + if identifier_type.nil? + fail ArgumentError, 'identifier_type cannot be nil' + end + + if identifier_type.to_s.length > 100 + fail ArgumentError, 'invalid value for "identifier_type", the character length must be smaller than or equal to 100.' + end + + @identifier_type = identifier_type + end + + # Custom attribute writer method with validation + # @param [Object] identifier Value to be assigned + def identifier=(identifier) + if identifier.nil? + fail ArgumentError, 'identifier cannot be nil' + end + + if identifier.to_s.length > 100 + fail ArgumentError, 'invalid value for "identifier", the character length must be smaller than or equal to 100.' + end + + @identifier = identifier + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + country_code == o.country_code && + identifier_type == o.identifier_type && + identifier == o.identifier && + extensions == o.extensions + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [country_code, identifier_type, identifier, extensions].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::EInvoicing::V1.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/tax_identifier_response.rb b/lib/avalara_sdk/models/EInvoicing/V1/tax_identifier_response.rb new file mode 100644 index 0000000..d0a7f59 --- /dev/null +++ b/lib/avalara_sdk/models/EInvoicing/V1/tax_identifier_response.rb @@ -0,0 +1,228 @@ +=begin +#Avalara E-Invoicing API + +#An API that supports sending data for an E-Invoicing compliance use-case. + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 + # Represents the response for a tax identifier validation request. + class TaxIdentifierResponse + # The two-letter ISO-3166 country code of the tax identifier. + attr_accessor :country_code + + attr_accessor :value + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'country_code' => :'countryCode', + :'value' => :'value' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'country_code' => :'String', + :'value' => :'TaxIdentifierResponseValue' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::EInvoicing::V1::TaxIdentifierResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::EInvoicing::V1::TaxIdentifierResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'country_code') + self.country_code = attributes[:'country_code'] + else + self.country_code = nil + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @country_code.nil? + invalid_properties.push('invalid value for "country_code", country_code cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @country_code.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + country_code == o.country_code && + value == o.value + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [country_code, value].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::EInvoicing::V1.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/tax_identifier_response_value.rb b/lib/avalara_sdk/models/EInvoicing/V1/tax_identifier_response_value.rb new file mode 100644 index 0000000..e7c0943 --- /dev/null +++ b/lib/avalara_sdk/models/EInvoicing/V1/tax_identifier_response_value.rb @@ -0,0 +1,231 @@ +=begin +#Avalara E-Invoicing API + +#An API that supports sending data for an E-Invoicing compliance use-case. + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 + class TaxIdentifierResponseValue + # Type of the identifier. + attr_accessor :identifier_type + + # The tax identifier of the company. + attr_accessor :identifier + + # Optional field containing additional company-related information such as companyName, companyAddress, blockListed, tradeName, and taxPayerType. It may also include other details specific to the given tax authority. Refer to the GET /tax-identifiers/schema API endpoint for the full response structure for a given country. + attr_accessor :extensions + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'identifier_type' => :'identifierType', + :'identifier' => :'identifier', + :'extensions' => :'extensions' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'identifier_type' => :'String', + :'identifier' => :'String', + :'extensions' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::EInvoicing::V1::TaxIdentifierResponseValue` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::EInvoicing::V1::TaxIdentifierResponseValue`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'identifier_type') + self.identifier_type = attributes[:'identifier_type'] + end + + if attributes.key?(:'identifier') + self.identifier = attributes[:'identifier'] + end + + if attributes.key?(:'extensions') + self.extensions = attributes[:'extensions'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + identifier_type == o.identifier_type && + identifier == o.identifier && + extensions == o.extensions + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [identifier_type, identifier, extensions].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::EInvoicing::V1.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/tax_identifier_schema_by_country200_response.rb b/lib/avalara_sdk/models/EInvoicing/V1/tax_identifier_schema_by_country200_response.rb new file mode 100644 index 0000000..7f53092 --- /dev/null +++ b/lib/avalara_sdk/models/EInvoicing/V1/tax_identifier_schema_by_country200_response.rb @@ -0,0 +1,235 @@ +=begin +#Avalara E-Invoicing API + +#An API that supports sending data for an E-Invoicing compliance use-case. + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 + class TaxIdentifierSchemaByCountry200Response + # The two-letter ISO-3166 country code of the tax identifier. + attr_accessor :country_code + + # The JSON Schema definition, following Draft-07 specification, used to validate tax identifier data. + attr_accessor :schema + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'country_code' => :'countryCode', + :'schema' => :'schema' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'country_code' => :'String', + :'schema' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::EInvoicing::V1::TaxIdentifierSchemaByCountry200Response` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::EInvoicing::V1::TaxIdentifierSchemaByCountry200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'country_code') + self.country_code = attributes[:'country_code'] + else + self.country_code = nil + end + + if attributes.key?(:'schema') + self.schema = attributes[:'schema'] + else + self.schema = nil + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @country_code.nil? + invalid_properties.push('invalid value for "country_code", country_code cannot be nil.') + end + + if @schema.nil? + invalid_properties.push('invalid value for "schema", schema cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @country_code.nil? + return false if @schema.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + country_code == o.country_code && + schema == o.schema + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [country_code, schema].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::EInvoicing::V1.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/trading_partner.rb b/lib/avalara_sdk/models/EInvoicing/V1/trading_partner.rb new file mode 100644 index 0000000..faf5b54 --- /dev/null +++ b/lib/avalara_sdk/models/EInvoicing/V1/trading_partner.rb @@ -0,0 +1,411 @@ +=begin +#Avalara E-Invoicing API + +#An API that supports sending data for an E-Invoicing compliance use-case. + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 + # Represents a participant in the Avalara directory. + class TradingPartner + # Avalara unique ID of the participant in the directory. + attr_accessor :id + + # Name of the participant (typically, the name of the business entity). + attr_accessor :name + + # The network where the participant is present. When creating or updating a trading partner, the value provided for the attribute 'network' will be ignored. + attr_accessor :network + + # Registration date of the participant if available. + attr_accessor :registration_date + + # A list of identifiers associated with the trading partner. Each identifier should consistently include the fields name, and value to maintain clarity and ensure consistent structure across entries. When creating or updating a trading partner, the attribute 'name' must be agreed upon with Avalara to ensure consistency. Failing to adhere to the agreed values will result in a validation error. Further, when creating or updating a trading partner, the value provided for the attribute 'displayName' will be ignored and instead retrieved from the standard set of display names maintained. + attr_accessor :identifiers + + attr_accessor :addresses + + # A list of document types supported by the trading partner for exchange. Each document type identifier value must match the standard list maintained by Avalara, which includes Peppol and other public network document type identifier schemes and values, as well as any approved partner-specific identifiers. The 'value' field must exactly match an entry from the provided document identifier list. Any attempt to submit unsupported document types will result in a validation error. Further, when creating or updating a trading partner, the value provided for the attributes 'name' and 'supportedByAvalara' will be ignored. + attr_accessor :supported_document_types + + attr_accessor :consents + + # Optional array used to carry additional metadata or configuration values that may be required by specific networks. When creating or updating a trading partner, the keys provided in the 'extensions' attribute must be selected from a predefined list of supported extensions. Using any unsupported keys will result in a validation error. + attr_accessor :extensions + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'name' => :'name', + :'network' => :'network', + :'registration_date' => :'registrationDate', + :'identifiers' => :'identifiers', + :'addresses' => :'addresses', + :'supported_document_types' => :'supportedDocumentTypes', + :'consents' => :'consents', + :'extensions' => :'extensions' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'name' => :'String', + :'network' => :'String', + :'registration_date' => :'String', + :'identifiers' => :'Array', + :'addresses' => :'Array
', + :'supported_document_types' => :'Array', + :'consents' => :'Consents', + :'extensions' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::EInvoicing::V1::TradingPartner` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::EInvoicing::V1::TradingPartner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + else + self.name = nil + end + + if attributes.key?(:'network') + self.network = attributes[:'network'] + end + + if attributes.key?(:'registration_date') + self.registration_date = attributes[:'registration_date'] + end + + if attributes.key?(:'identifiers') + if (value = attributes[:'identifiers']).is_a?(Array) + self.identifiers = value + end + else + self.identifiers = nil + end + + if attributes.key?(:'addresses') + if (value = attributes[:'addresses']).is_a?(Array) + self.addresses = value + end + else + self.addresses = nil + end + + if attributes.key?(:'supported_document_types') + if (value = attributes[:'supported_document_types']).is_a?(Array) + self.supported_document_types = value + end + else + self.supported_document_types = nil + end + + if attributes.key?(:'consents') + self.consents = attributes[:'consents'] + end + + if attributes.key?(:'extensions') + if (value = attributes[:'extensions']).is_a?(Array) + self.extensions = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + if @name.to_s.length > 250 + invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 250.') + end + + if @name.to_s.length < 3 + invalid_properties.push('invalid value for "name", the character length must be great than or equal to 3.') + end + + if @identifiers.nil? + invalid_properties.push('invalid value for "identifiers", identifiers cannot be nil.') + end + + if @identifiers.length < 1 + invalid_properties.push('invalid value for "identifiers", number of items must be greater than or equal to 1.') + end + + if @addresses.nil? + invalid_properties.push('invalid value for "addresses", addresses cannot be nil.') + end + + if @addresses.length < 1 + invalid_properties.push('invalid value for "addresses", number of items must be greater than or equal to 1.') + end + + if @supported_document_types.nil? + invalid_properties.push('invalid value for "supported_document_types", supported_document_types cannot be nil.') + end + + if @supported_document_types.length < 1 + invalid_properties.push('invalid value for "supported_document_types", number of items must be greater than or equal to 1.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + return false if @name.nil? + return false if @name.to_s.length > 250 + return false if @name.to_s.length < 3 + return false if @identifiers.nil? + return false if @identifiers.length < 1 + return false if @addresses.nil? + return false if @addresses.length < 1 + return false if @supported_document_types.nil? + return false if @supported_document_types.length < 1 + true + end + + # Custom attribute writer method with validation + # @param [Object] name Value to be assigned + def name=(name) + if name.nil? + fail ArgumentError, 'name cannot be nil' + end + + if name.to_s.length > 250 + fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 250.' + end + + if name.to_s.length < 3 + fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 3.' + end + + @name = name + end + + # Custom attribute writer method with validation + # @param [Object] identifiers Value to be assigned + def identifiers=(identifiers) + if identifiers.nil? + fail ArgumentError, 'identifiers cannot be nil' + end + + if identifiers.length < 1 + fail ArgumentError, 'invalid value for "identifiers", number of items must be greater than or equal to 1.' + end + + @identifiers = identifiers + end + + # Custom attribute writer method with validation + # @param [Object] addresses Value to be assigned + def addresses=(addresses) + if addresses.nil? + fail ArgumentError, 'addresses cannot be nil' + end + + if addresses.length < 1 + fail ArgumentError, 'invalid value for "addresses", number of items must be greater than or equal to 1.' + end + + @addresses = addresses + end + + # Custom attribute writer method with validation + # @param [Object] supported_document_types Value to be assigned + def supported_document_types=(supported_document_types) + if supported_document_types.nil? + fail ArgumentError, 'supported_document_types cannot be nil' + end + + if supported_document_types.length < 1 + fail ArgumentError, 'invalid value for "supported_document_types", number of items must be greater than or equal to 1.' + end + + @supported_document_types = supported_document_types + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + name == o.name && + network == o.network && + registration_date == o.registration_date && + identifiers == o.identifiers && + addresses == o.addresses && + supported_document_types == o.supported_document_types && + consents == o.consents && + extensions == o.extensions + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, name, network, registration_date, identifiers, addresses, supported_document_types, consents, extensions].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::EInvoicing::V1.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/update_trading_partner200_response.rb b/lib/avalara_sdk/models/EInvoicing/V1/update_trading_partner200_response.rb new file mode 100644 index 0000000..24a11e7 --- /dev/null +++ b/lib/avalara_sdk/models/EInvoicing/V1/update_trading_partner200_response.rb @@ -0,0 +1,231 @@ +=begin +#Avalara E-Invoicing API + +#An API that supports sending data for an E-Invoicing compliance use-case. + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 + class UpdateTradingPartner200Response + # Avalara unique ID of the participant in the directory. + attr_accessor :id + + # The status of the create operation. + attr_accessor :status + + # A human-readable message providing additional context or feedback about the outcome of the operation. + attr_accessor :message + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'status' => :'status', + :'message' => :'message' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'status' => :'String', + :'message' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::EInvoicing::V1::UpdateTradingPartner200Response` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::EInvoicing::V1::UpdateTradingPartner200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + status == o.status && + message == o.message + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, status, message].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::EInvoicing::V1.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/validation_error.rb b/lib/avalara_sdk/models/EInvoicing/V1/validation_error.rb new file mode 100644 index 0000000..e0275cf --- /dev/null +++ b/lib/avalara_sdk/models/EInvoicing/V1/validation_error.rb @@ -0,0 +1,222 @@ +=begin +#Avalara E-Invoicing API + +#An API that supports sending data for an E-Invoicing compliance use-case. + + +=end + +require 'date' +require 'time' + +module AvalaraSdk::EInvoicing::V1 + # Represents a specific validation failure within a request. + class ValidationError + # The name of the field that failed validation. + attr_accessor :field + + # A human-readable explanation of the error for the specific field. + attr_accessor :message + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'field' => :'field', + :'message' => :'message' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'field' => :'String', + :'message' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::EInvoicing::V1::ValidationError` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::EInvoicing::V1::ValidationError`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'field') + self.field = attributes[:'field'] + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + warn '[DEPRECATED] the `valid?` method is obsolete' + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + field == o.field && + message == o.message + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [field, message].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = AvalaraSdk::EInvoicing::V1.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/avalara_sdk/models/EInvoicing/V1/webhooks_error_response.rb b/lib/avalara_sdk/models/EInvoicing/V1/webhooks_error_response.rb index a17fbb8..8f6d36e 100644 --- a/lib/avalara_sdk/models/EInvoicing/V1/webhooks_error_response.rb +++ b/lib/avalara_sdk/models/EInvoicing/V1/webhooks_error_response.rb @@ -10,8 +10,7 @@ require 'time' module AvalaraSdk::EInvoicing::V1 - # Wrapper for errors occurring during webhook subscription or delivery processing. - class WebhooksErrorResponse + class WebhooksErrorResponse attr_accessor :error # Attribute mapping from ruby-style variable name to JSON key.